@opendaw/studio-core 0.0.58 → 0.0.60
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.
- package/dist/AudioOfflineRenderer.d.ts +2 -2
- package/dist/AudioOfflineRenderer.d.ts.map +1 -1
- package/dist/AudioOfflineRenderer.js +9 -9
- package/dist/AudioUtils.d.ts +4 -0
- package/dist/AudioUtils.d.ts.map +1 -0
- package/dist/AudioUtils.js +20 -0
- package/dist/EffectBox.d.ts +2 -2
- package/dist/EffectBox.d.ts.map +1 -1
- package/dist/EffectFactories.d.ts +3 -0
- package/dist/EffectFactories.d.ts.map +1 -1
- package/dist/EffectFactories.js +17 -3
- package/dist/Engine.d.ts +1 -1
- package/dist/Engine.d.ts.map +1 -1
- package/dist/EngineFacade.d.ts +1 -1
- package/dist/EngineFacade.d.ts.map +1 -1
- package/dist/EngineFacade.js +1 -1
- package/dist/EngineWorklet.d.ts.map +1 -1
- package/dist/EngineWorklet.js +7 -8
- package/dist/ExternalLib.d.ts +0 -1
- package/dist/ExternalLib.d.ts.map +1 -1
- package/dist/ExternalLib.js +0 -1
- package/dist/FilePickerAcceptTypes.d.ts.map +1 -1
- package/dist/Preferences.d.ts +4 -0
- package/dist/Preferences.d.ts.map +1 -1
- package/dist/Preferences.js +2 -0
- package/dist/RecordingWorklet.d.ts +2 -1
- package/dist/RecordingWorklet.d.ts.map +1 -1
- package/dist/WavFile.d.ts +4 -7
- package/dist/WavFile.d.ts.map +1 -1
- package/dist/WavFile.js +22 -21
- package/dist/Workers.d.ts +2 -0
- package/dist/Workers.d.ts.map +1 -1
- package/dist/Workers.js +11 -0
- package/dist/capture/CaptureAudio.d.ts.map +1 -1
- package/dist/capture/CaptureAudio.js +0 -2
- package/dist/capture/RecordAudio.d.ts.map +1 -1
- package/dist/capture/RecordAudio.js +3 -1
- package/dist/cloud/CloudBackupProjects.js +4 -4
- package/dist/cloud/CloudBackupSamples.d.ts.map +1 -1
- package/dist/cloud/CloudBackupSamples.js +3 -9
- package/dist/cloud/CloudBackupSoundfonts.js +1 -1
- package/dist/dawproject/DawProjectExporter.d.ts.map +1 -1
- package/dist/dawproject/DawProjectExporter.js +2 -12
- package/dist/dawproject/DawProjectImporter.d.ts.map +1 -1
- package/dist/dawproject/DawProjectImporter.js +5 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/midi/MIDIReceiver.d.ts +12 -0
- package/dist/midi/MIDIReceiver.d.ts.map +1 -0
- package/dist/midi/MIDIReceiver.js +65 -0
- package/dist/midi/MidiDevices.d.ts +4 -1
- package/dist/midi/MidiDevices.d.ts.map +1 -1
- package/dist/midi/MidiDevices.js +40 -1
- package/dist/processors.js +17 -19
- package/dist/processors.js.map +4 -4
- package/dist/project/Project.d.ts.map +1 -1
- package/dist/project/Project.js +14 -2
- package/dist/project/ProjectApi.d.ts +13 -4
- package/dist/project/ProjectApi.d.ts.map +1 -1
- package/dist/project/ProjectApi.js +71 -29
- package/dist/project/ProjectBundle.d.ts +2 -2
- package/dist/project/ProjectBundle.d.ts.map +1 -1
- package/dist/project/ProjectBundle.js +3 -3
- package/dist/project/ProjectMeta.d.ts +2 -0
- package/dist/project/ProjectMeta.d.ts.map +1 -1
- package/dist/project/ProjectMeta.js +1 -0
- package/dist/project/ProjectMigration.d.ts.map +1 -1
- package/dist/project/ProjectMigration.js +47 -5
- package/dist/project/ProjectProfile.d.ts +1 -0
- package/dist/project/ProjectProfile.d.ts.map +1 -1
- package/dist/project/ProjectProfile.js +5 -0
- package/dist/project/audio/AudioContentFactory.d.ts +34 -0
- package/dist/project/audio/AudioContentFactory.d.ts.map +1 -0
- package/dist/project/audio/AudioContentFactory.js +107 -0
- package/dist/project/audio/AudioContentHelpers.d.ts +7 -0
- package/dist/project/audio/AudioContentHelpers.d.ts.map +1 -0
- package/dist/project/audio/AudioContentHelpers.js +17 -0
- package/dist/project/audio/AudioContentModifier.d.ts +10 -0
- package/dist/project/audio/AudioContentModifier.d.ts.map +1 -0
- package/dist/project/audio/AudioContentModifier.js +129 -0
- package/dist/project/audio/AudioFileBoxFactory.d.ts +8 -0
- package/dist/project/audio/AudioFileBoxFactory.d.ts.map +1 -0
- package/dist/project/audio/AudioFileBoxFactory.js +36 -0
- package/dist/project/audio/index.d.ts +4 -0
- package/dist/project/audio/index.d.ts.map +1 -0
- package/dist/project/audio/index.js +3 -0
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +1 -0
- package/dist/samples/DefaultSampleLoader.d.ts +2 -1
- package/dist/samples/DefaultSampleLoader.d.ts.map +1 -1
- package/dist/samples/DefaultSampleLoader.js +1 -1
- package/dist/samples/DefaultSampleLoaderManager.d.ts +3 -1
- package/dist/samples/DefaultSampleLoaderManager.d.ts.map +1 -1
- package/dist/samples/DefaultSampleLoaderManager.js +13 -0
- package/dist/samples/OpenSampleAPI.d.ts +2 -1
- package/dist/samples/OpenSampleAPI.d.ts.map +1 -1
- package/dist/samples/OpenSampleAPI.js +2 -2
- package/dist/samples/SampleAPI.d.ts +2 -1
- package/dist/samples/SampleAPI.d.ts.map +1 -1
- package/dist/samples/SampleProvider.d.ts +2 -1
- package/dist/samples/SampleProvider.d.ts.map +1 -1
- package/dist/samples/SampleService.d.ts.map +1 -1
- package/dist/samples/SampleStorage.d.ts +2 -1
- package/dist/samples/SampleStorage.d.ts.map +1 -1
- package/dist/samples/SampleStorage.js +6 -5
- package/dist/soundfont/OpenSoundfontAPI.d.ts.map +1 -1
- package/dist/soundfont/OpenSoundfontAPI.js +3 -3
- package/dist/workers-main.js +1 -5
- package/dist/workers-main.js.map +4 -4
- package/package.json +15 -15
package/dist/processors.js
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
var SS=Object.defineProperty;var As=(r,e)=>{for(var t in e)SS(r,t,{get:e[t],enumerable:!0})};var su=r=>r,R=r=>r!=null,_s=r=>r===null;var Hh=r=>r===void 0,Ra=r=>r!==void 0,Jh=r=>r==null,Ay=(r,e)=>r!=null?e(r):void 0,G=(r,e="asDefined failed")=>r??P(Ps(e)),Le=(r,e)=>r instanceof e,Ee=(r,e)=>r instanceof e?r:P(`${r} is not instance of ${e}`),_y=(r,e)=>{r instanceof e||P(`${r} is not instance of ${e}`)};var Ps=r=>r instanceof Function?r():r;var A=(r,...e)=>r?.apply(null,e),on=r=>R(r)&&typeof r=="object",Py=(r,e,t)=>{if(!(e in r))return!1;let o=r[e];return t==="null"?o===null:typeof o===t},r_=(r,...e)=>{let t=r;for(let o of e){if(!on(t)||!(o in t))return;t=t[o]}return t},bo=r=>{throw new Error(`Unhandled ${r}`)},P=r=>{throw typeof r=="string"?new Error(r):r},B=(r,e)=>r?void 0:P(Ps(e));var Ao=r=>new Proxy({},{get(){return P(r)}});var wy=class{value;status="success";constructor(e){this.value=e}error=Ao("Cannot access error when succeeded")},by=class{error;status="failure";constructor(e){this.error=e}value=Ao("Cannot access value when failed")},Es=r=>{try{return new wy(r())}catch(e){return new by(e)}};var _o=(r,e)=>Object.keys(e).length===0?P("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(r)?r:P(`Invalid enum value: ${String(r)}`),Vr=()=>{};var i_=r=>{};var Ey;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(Ey||(Ey={}));var I=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)=>G(e.at(0),t);static getLast=(e,t)=>G(e.at(-1),t);static getPrev=(e,t)=>{let o=e.indexOf(t);return o===-1?P(`${t} not found in ${e}`):G(e.at((o-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let o=e.indexOf(t);return o===-1?P(`${t} not found in ${e}`):G(e.at((o+1)%e.length),"Internal Error")};static removeLast=(e,t)=>G(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 P(`${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=Ey.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=>R(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryFrom=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...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=G(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=>P(R(t)?Ps(t):"unwrap failed");unwrapOrElse=t=>Ps(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)=>Ps(o);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>P(Ps(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(m||(m={}));var Po;(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)}};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());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=()=>P(`'${this.reason}'`);map=()=>this;flatMap=()=>this;match=t=>t.err(this.reason);toVoid=()=>r.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Po||(Po={}));var je;(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)]})(je||(je={}));var ot=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 I.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var Qh=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 Yh;(function(r){r.parseCssRgbOrRgba=e=>{let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(R(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)'`)},r.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))}`},r.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,c=0,d=0;if(s!==a){let h=s-a;switch(d=l>.5?h/(2-s-a):h/(s+a),s){case o:c=((i-n)/h+(i<n?6:0))*60;break;case i:c=((n-o)/h+2)*60;break;case n:c=((o-i)/h+4)*60;break}}return{h:c,s:d,l}},r.hslStringToHex=e=>{let[t,o,i]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,o/100,i/100)}})(Yh||(Yh={}));var nn=(r,e)=>r-e;var bi=Math.PI*2,_k=Math.PI/2,Sy=Math.PI/4,Pk=1/Math.sqrt(2),X=(r,e,t)=>Math.max(e,Math.min(r,t)),zr=r=>Math.max(0,Math.min(r,1)),o_=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),Eo=(r,e)=>Math.floor(r/e)*e;var Xh=(r,e,t)=>r+(e-r)*t,n_=(r,e,t)=>r*Math.pow(e/r,t);var au=(r,e)=>NS(r/e)*e,NS=r=>r-Math.floor(r),So=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var Ny=(r,e)=>r*e/((2*e-1)*(r-1)+e);var Ur;(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=X(n,1e-15,.999999999999999);return s*s/(1-s*2)*(Math.pow((1-s)/s,2*i)-1)}},r.inverseAt=(i,n)=>{let s=X(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:c}=r.coefficients({slope:i,steps:n,y0:s,y1:a});for(let d=0,h=s;d<n;d++)yield h=l*h+c}r.walk=t;function*o(i,n){let s=1/n,a=r.normalizedAt(s,i),c=(r.normalizedAt(2*s,i)-a)/a;for(let d=0,h=0;d<n;d++)yield h=c*h+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)})(Ur||(Ur={}));var Li=new DataView(new ArrayBuffer(8)),Qt;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(Li.setInt8(0,e),Li.getInt8(0)),r.toShort=e=>(Li.setInt16(0,e),Li.getInt16(0)),r.toInt=e=>(Li.setInt32(0,e),Li.getInt32(0))})(Qt||(Qt={}));var No;(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)!==0?2143289344:a},r.intBitsToFloat=s=>(n[0]=s,i[0]),r.floatToRawIntBits=s=>(i[0]=s,n[0]),r.toFloat32=s=>(Li.setFloat32(0,s),Li.getFloat32(0))})(No||(No={}));var sn;(function(r){r.floatToIntBits=e=>{let t=No.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 No.intBitsToFloat((e&32768)<<16|o<<13|1023)}else if(t!==0){o=115712;do t<<=1,o-=1024;while((t&1024)===0);t&=1023}return No.intBitsToFloat((e&32768)<<16|(o|t)<<13)}})(sn||(sn={}));var ep;(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=>(Li.setFloat64(0,s),Li.getFloat64(0))})(ep||(ep={}));var He=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);R(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 We=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?P(`position(${e}) cannot be negative.`):e>this.#e.byteLength?P(`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(So(t+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,o.getInt8(i))}}},Oa=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}},tp=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(No.floatToIntBits(e))}writeDouble(e){this.writeLong(ep.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(He.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},Ze=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?P(`position(${e}) cannot be negative.`):e>this.#e.byteLength?P(`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 FS=r=>R(r)?r.value!==void 0?"value":r.get!==void 0?"get":P(`Cannot resolve method key of ${r}`):P("Cannot resolve method key of undefined descriptor"),Va=(r,e,t)=>{if(!R(t))return function(n,s){if(s&&s.kind==="getter")return function(){let a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!R(a?.get))return P(`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=FS(t),i=G(t[o]);return{[o]:function(...n){if(n.length>0)return P("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 s_;(function(r){r.Transient=Object.freeze({modify:(e,t)=>m.wrap(e()),mark:()=>{}})})(s_||(s_={}));var Fo;(function(r){function*e(){}r.empty=e,r.next=o=>{let{value:i,done:n}=o.next();return n?null:i};function*t(...o){for(let i of o)for(let n of i)yield n}r.flatten=t})(Fo||(Fo={}));var za;(function(r){r[r.T=0]="T",r[r.R=1]="R",r[r.B=2]="B",r[r.L=3]="L"})(za||(za={}));var Ua;(function(r){r[r.TL=0]="TL",r[r.TR=1]="TR",r[r.BR=2]="BR",r[r.BL=3]="BL"})(Ua||(Ua={}));var a_;(function(r){r.outerTangentPoints=(e,t)=>{let o=t.x-e.x,i=t.y-e.y,n=Math.atan2(i,o)+Math.acos((e.r-t.r)/Math.sqrt(o*o+i*i)),s=Math.cos(n),a=Math.sin(n);return[{x:e.x+e.r*s,y:e.y+e.r*a},{x:t.x+t.r*s,y:t.y+t.r*a}]}})(a_||(a_={}));var l_;(function(r){r.zero=()=>({x:0,y:0}),r.create=(e,t)=>({x:e,y:t}),r.clone=e=>({...e}),r.floor=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),r.length=e=>Math.sqrt(e.x*e.x+e.y*e.y),r.distance=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),r.add=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),r.subtract=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),r.scaleBy=(e,t)=>({x:e.x*t,y:e.y*t}),r.scaleTo=(e,t)=>{let o=t/r.length(e);return{x:e.x*o,y:e.y*o}},r.fromClient=e=>({x:e.clientX,y:e.clientY})})(l_||(l_={}));var lu;(function(r){r.Empty=Object.freeze({x:0,y:0,width:0,height:0}),r.corners=e=>{let t=e.x,o=e.y,i=t+e.width,n=o+e.height;return[{x:t,y:o},{x:i,y:o},{x:i,y:n},{x:t,y:n}]},r.inflate=(e,t)=>({x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}),r.contains=(e,t)=>{let o=t.x>=e.x&&t.y>=e.y,i=t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height;return o&&i},r.isPointInside=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,r.intersect=(e,t)=>{let o=Math.max(e.x,t.x),i=Math.min(e.x+e.width,t.x+t.width),n=Math.min(e.y+e.height,t.y+t.height),s=Math.max(e.y,t.y);return i>o&&n>s},r.axis=(e,t)=>{switch(t){case za.T:return e.y;case za.R:return e.x+e.width;case za.B:return e.y+e.height;case za.L:return e.x;default:return bo(t)}},r.corner=(e,t)=>{switch(t){case Ua.TL:return{x:e.x,y:e.y};case Ua.TR:return{x:e.x+e.width,y:e.y};case Ua.BR:return{x:e.x+e.width,y:e.y+e.height};case Ua.BL:return{x:e.x,y:e.y+e.height};default:return bo(t)}},r.center=e=>({x:e.x+e.width*.5,y:e.y+e.height*.5}),r.isEmpty=e=>e.width===0||e.height===0,r.union=(e,t)=>{if(r.isEmpty(e))r.isEmpty(t)||(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height);else if(!r.isEmpty(t)){let o=t.x,i=t.y,n=Math.min(e.x,o),s=Math.min(e.y,i);e.width=Math.max(e.x+e.width,o+t.width)-n,e.height=Math.max(e.y+e.height,i+t.height)-s,e.x=n,e.y=s}}})(lu||(lu={}));var c_;(function(r){r.width=e=>e.xMax-e.xMin,r.height=e=>e.yMax-e.yMin,r.from=(e,t)=>{e.xMin=t.xMin,e.xMax=t.xMax,e.yMin=t.yMin,e.yMax=t.yMax},r.extend=(e,t)=>{e.xMin-=t,e.yMin-=t,e.xMax+=t,e.yMax+=t},r.padding=(e,[t,o,i,n])=>(e.xMin+=n,e.yMin+=t,e.xMax-=o,e.yMax-=i,e),r.intersectPoint=(e,t)=>e.xMin<=t.x&&t.x<e.xMax&&e.yMin<=t.y&&t.y<e.yMax,r.intersectThat=(e,t)=>t.xMin<e.xMax&&t.xMax>e.xMin&&t.yMin<e.yMax&&t.yMax>e.yMin,r.center=e=>({x:(e.xMin+e.xMax)*.5,y:(e.yMin+e.yMax)*.5})})(c_||(c_={}));var u_;(function(r){r.Identity=Object.freeze([0,0,0,0])})(u_||(u_={}));var d_;(function(r){r.intersects=(o,i,n,s,a,l,c,d)=>{let h=e(o,i,n,s,a,l),f=e(o,i,n,s,c,d);if((h|f)===0||(h&f)!==0)return!1;let v=t(a,l,c,d,o,n);return v!==t(a,l,c,d,i,n)||v!==t(a,l,c,d,i,s)||v!==t(a,l,c,d,o,s)};let e=(o,i,n,s,a,l)=>{let c=0;return a<=o?c|=1:a>=i&&(c|=2),l<=n?c|=8:l>=s&&(c|=4),c},t=(o,i,n,s,a,l)=>(n-o)*(l-i)-(a-o)*(s-i)>=0})(d_||(d_={}));var h_;(function(r){r.Identity={valueToAxis:e=>e,axisToValue:e=>e},r.toClamped=(e,t,o)=>({valueToAxis:i=>e.valueToAxis(X(i,t,o)),axisToValue:i=>X(e.axisToValue(i),t,o)}),r.createClamped=(e,t)=>({valueToAxis:o=>X(o,e,t),axisToValue:o=>X(o,e,t)})})(h_||(h_={}));var p_;(function(r){r.fromBuffers=async(...e)=>{let t=e.reduce((n,s)=>n+s.byteLength,0),o=new Uint8Array(t),i=0;for(let n of e)o.set(new Uint8Array(n),i),i+=n.byteLength;return await crypto.subtle.digest("SHA-256",o)},r.equals=(e,t)=>{B(e.byteLength===32,"First hash has invalid length"),B(t.byteLength===32,"Second hash has invalid length");let o=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<32;n++)if(o[n]!==i[n])return!1;return!0},r.toString=e=>Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")})(p_||(p_={}));var cu;(function(r){r.intersect1D=(e,t,o,i)=>Math.max(e,o)<=Math.min(t,i)})(cu||(cu={}));var gt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...o)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?A(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 f_=(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 Ss=class{static createIfAbsent(e,t,o){let i=e.get(t);return i===void 0&&(i=o(t),e.set(t,i)),i}};var uu=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var Ns=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 He.some(this.#e.entries(),o=>e===o[0]&&o[1].includes(t))}containsKey(e){return He.includes(this.#e.keys(),e)}containsValue(e){return He.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??I.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let o=Ss.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())o.push(t);else{let i=je.stableInsert(o,t,this.#t.unwrap());o.splice(i,0,t)}}addAll(e,t){let o=Ss.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??I.empty()}forEach(e){He.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}},ja=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 He.some(this.map.entries(),o=>e===o[0]&&o[1].has(t))}containsKey(e){return He.includes(this.map.keys(),e)}containsValue(e){return He.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??uu.empty()}isEmpty(){return this.keyCount()===0}add(e,t){Ss.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let o=Ss.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??uu.empty()}forEach(e){He.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 W=Object.freeze({Empty:{terminate:Vr},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),j=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:()=>I.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 W.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 Er;(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 P(`'${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)})(Er||(Er={}));var m_;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return W.Empty}catchupAndSubscribe(t){return t(this),W.Empty}}})(m_||(m_={}));var g_;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return W.Empty}catchupAndSubscribe(e){return e(this),W.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)}}})(g_||(g_={}));var an=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()||(R(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 Yt=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 Fy=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+X(e,0,1)*this.#r}clamp(e){return X(e,this.#e,this.#t)}floating(){return!0}},By=class{#e;#t;#r;constructor(e,t){this.#e=X(Math.round(e),Qt.MIN_VALUE,Qt.MAX_VALUE),this.#t=X(Math.round(t),Qt.MIN_VALUE,Qt.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(X(e,0,1)*this.#r)}clamp(e){return X(Math.round(e),this.#e,this.#t)}floating(){return!1}},$y=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.log(t/e)}x(e){return Math.log(X(e,this.#e,this.#t)/this.#e)/this.#r}y(e){return this.#e*Math.exp(X(e,0,1)*this.#r)}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},ky=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(o=>o===e);return t===-1?P(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(X(e,0,1)*(this.#e.length-1));return t>-1?G(this.#e.at(t),`Could not find value for ${e}`):P(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},Iy=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}},F;(function(r){r.linear=(n,s)=>new Fy(n,s),r.linearInteger=(n,s)=>new By(n,s),r.exponential=(n,s)=>new $y(n,s),r.values=n=>new ky(n),r.decibel=(n,s,a)=>new Iy(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})(F||(F={}));var S;(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 c=a.indexOf(l);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:s[c]}}},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,c){this.#e=s??"",this.#t=a??0,this.#r=l??!1,this.#i=c??!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?X(l/200+.5,0,1):X(l/100,0,1)};{a.endsWith(this.#e)&&this.#e.length>0&&(a=a.slice(0,-this.#e.length));let h=/(\d+)(\D+)/.exec(a)?.at(2)?.at(0);if(R(h)){let f=t.indexOf(h);if(f>-1)return{type:"explicit",value:l*Math.pow(10,(f-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 R(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})})(S||(S={}));var ln;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(ln||(ln={}));var v_;(function(r){r.Empty=Object.freeze(e=>{}),r.split=(e,t)=>{let o=new Float32Array(t);return I.create(i=>n=>{o[i]=n,e(o.reduce((s,a)=>s+a,0)/t)},t)},r.splitWithWeights=(e,t)=>{let o=t.length,i=new Float32Array(o);if(t.length===0)return P("Weights must not be empty");if(t.some(a=>a<=0))return P("Weights must be greater than zero");let n=t.reduce((a,l)=>a+l,0),s=n>0?t.map(a=>a/n):I.create(()=>1/o,o);return I.create(a=>l=>{i[a]=l,e(i.reduce((c,d,h)=>c+d*s[h],0))},o)}})(v_||(v_={}));var La;(function(r){r.create=(e=252854082)=>new Ty(e),r.monotoneAscending=(e,t=128,o=r.create())=>{let i=e.length;if(i<2)return P("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}})(La||(La={}));var Ty=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 lr;(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,c])=>{let d=a;c instanceof e?d[l]=c.read(i,d[l]):typeof c=="object"&&n(c,d[l])})};n(this.#e,this.#t)}write(i){let n=(s,a)=>{Object.entries(s).forEach(([l,c])=>{let d=a;c instanceof e?c.write(i,d[l]):typeof c=="object"&&n(c,d[l])})};n(this.#e,this.#t)}#i(){let i=new Oa;return this.write(i),i.count}}})(lr||(lr={}));var Ka=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=je.leftMostMapped(this.#r,o,this.#t,this.#e),n=this.#r[i];return R(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=je.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[o];if(R(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 P(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=je.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return R(o)&&this.#t(this.#e(o),e)===0?(this.#r.splice(t,1),o):P(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=je.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return R(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 G(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let o=this.#i(e);if(R(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 R(this.#i(e))}hasValue(e){return R(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(){I.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=je.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return R(o)&&this.#t(this.#e(o),e)===0?o:void 0}};var y_;(function(r){r.hyphenToCamelCase=e=>e.replace(/-([a-z])/g,t=>t[1].toUpperCase()),r.fallback=(e,t)=>R(e)&&e.length>0?e:t,r.endsWithDigit=e=>/\d$/.test(e),r.nonEmpty=(e,t)=>R(e)&&e.trim().length>0?e:t,r.toArrayBuffer=e=>{let t=new ArrayBuffer(e.length),o=new Uint8Array(t);for(let i=0;i<e.length;i++)o[i]=e.charCodeAt(i);return t},r.getUniqueName=(e,t)=>{let o=new Set(e),i=t,n=1;if(o.has(t)||o.has(`${t} 1`))n=2;else return t;for(;o.has(i=`${t} ${n++}`););return i}})(y_||(y_={}));var Wa=(()=>{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:Vr}),some:t=>t.progress(e)}),install:e=>{B(r.isEmpty(),"RuntimeNotification already installed"),r=m.wrap(e)}}})();var x_;(function(r){let e=new te;r.subscribe=t=>e.subscribe(t),r.dispatch=t=>e.notify(t)})(x_||(x_={}));var cn=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 bo(e)}}};var Za;(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 P("Insufficient memory allocated.");let n=new Uint8Array(o),s=We.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 Ze(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}}})(Za||(Za={}));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:P(`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=I.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 P("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 P("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 Ka(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=>(B(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 w_;(function(r){r.create=n=>R(n)?R(n?.snap)?r.snap(n?.trackLength,n?.snap?.snapLength,Array.isArray(n?.snap?.threshold)?n?.snap.threshold:[n?.snap?.threshold]):r.identity(n?.trackLength):r.identity(),r.snap=(n=e,s=t,a)=>new i(n,s/n,a),r.identity=(n=e)=>new o(n);let e=128,t=24;class o{length;#e=NaN;#t=NaN;#r=1;constructor(s){this.length=s}begin(s){this.#t=this.#e=s}moveBy(s){B(!isNaN(this.#t),()=>"value has never been set"),this.#e+=s/this.length*this.#r,this.#t=X(this.#e,0,1)}ratio(s){this.#r=s}value(){return B(!isNaN(this.#t),()=>"value has never been set"),this.#t}disable(){}enable(){}}class i{#e;#t;#r;#i;#o=NaN;#n=NaN;#s=1;#l=!0;constructor(s,a,l){B(a>0,()=>`margin(${a}) must be greater then 0`),B(I.isSorted(l),()=>"thresholds are not sorted"),B(a<s,()=>`margin(${a}) must be lower then length(${s})`),this.#e=s,this.#t=a,this.#r=l,this.#i=l.map((c,d)=>c+d*this.#t)}begin(s){this.#o=this.#l?this.valueToX(s):s,this.#n=s}moveBy(s){B(isFinite(this.#n)&&isFinite(this.#o),()=>"value has never been set (moveBy)"),this.#o+=s/this.#e*this.#s,this.#n=this.#l?this.xToValue(this.#o):X(this.#o,0,1)}ratio(s){this.#s=s}value(){return B(isFinite(this.#n),()=>"value has never been set (value)"),this.#n}disable(){this.#l&&(this.#l=!1,this.#o=this.xToValue(this.#o))}enable(){this.#l||(this.#l=!0,this.#o=this.valueToX(this.#o))}valueToX(s){let a=je.rightMost(this.#r,s,nn);if(a<0)return s;{let l=this.#i[a],c=this.#r[a];return s===c?l+this.#t/2:l+this.#t+(s-c)}}xToValue(s){let a=X(s,0,1+this.#t*this.#r.length),l=je.rightMost(this.#i,a,nn);if(l<0)return a;{let c=this.#i[l],d=this.#r[l];return a>c+this.#t?a-(c+this.#t)+d:d}}get margin(){return this.#t}}})(w_||(w_={}));var rp;(function(r){class e extends Error{}r.Warning=e,r.warn=o=>{throw new e(o)};class t extends Error{constructor(i){super(`${i} not found`)}}r.FileNotFound=t,r.AbortError=typeof DOMException>"u"?{name:"AbortError",message:""}:Object.freeze(new DOMException("AbortError")),r.isAbort=o=>o===r.AbortError||r.isDOMException(o)&&o.name==="AbortError",r.CatchAbort=o=>o===r.AbortError?void 0:P(o),r.isOverconstrained=o=>on(o)&&"constraint"in o,r.isDOMException=o=>on(o)&&Py(o,"name","string")&&Py(o,"message","string"),r.toString=o=>{let i=n=>n.split(`
|
|
2
|
-
`).
|
|
3
|
-
`);if(o instanceof Error)return i(o.stack||o.message);if(typeof o=="string")return o;if(o&&typeof o=="object"){let n=o;if(n.stack)return i(n.stack);if(n.message)return n.message;try{return JSON.stringify(o,null,2)}catch{}}return String(o)}})(rp||(rp={}));var ip=Symbol.for("@openDAW/lib-std");globalThis[ip]?console.debug(`%c${ip.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[ip]=!0,console.debug(`%c${ip.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var ge=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=I.create(()=>new Float32Array(128),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(){B(!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){B(e.length===2,"mixLayout: target.length must be 2"),B(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){B(e.length===2,"mixLayout: target.length must be 2"),B(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<128;n++)t[n]+=i[n],o[n]+=i[n]}else{let[i,n]=this.#e;for(let s=0;s<128;s++)t[s]+=i[s],o[s]+=n[s]}}};var nt;(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"})(nt||(nt={}));var Ga=class{#e;#t=nt.Idle;#r=0;#i=0;#o=0;#n=0;#s=0;#l=0;#a=0;#c=0;#u=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==nt.Idle&&this.#t!==nt.Release}get complete(){return this.#t===nt.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.#h()}#h(){switch(this.#t){case nt.Attack:{let e=1-this.#r;this.#a=e*this.#e/Math.max(this.#o,1e-6);break}case nt.Decay:{let e=this.#r-this.#s;this.#c=e*this.#e/Math.max(this.#n,1e-6);break}case nt.Release:{let e=this.#r;this.#u=e*this.#e/Math.max(this.#l,1e-6);break}case nt.Sustain:case nt.Idle:{this.#a=this.#e/Math.max(this.#o,1e-6),this.#c=(1-this.#s)*this.#e/Math.max(this.#n,1e-6),this.#u=this.#s*this.#e/Math.max(this.#l,1e-6);break}}}gateOn(){this.#t=nt.Attack}gateOff(){this.#t!==nt.Idle&&(this.#t=nt.Release,this.#h())}forceStop(){this.#t=nt.Idle,this.#r=0}process(e,t,o){for(let i=t;i<o;)switch(this.#t){case nt.Attack:for(;i<o;){if(this.#r+=this.#a,this.#r>=1){this.#r=1,this.#i=1,e[i++]=this.#r,this.#t=nt.Decay,this.#h();break}e[i++]=this.#i=this.#r}break;case nt.Decay:for(;i<o;){if(this.#r-=this.#c,this.#r<=this.#s){this.#r=this.#s,this.#i=2,e[i++]=this.#r,this.#t=nt.Sustain,this.#h();break}this.#i=1+(1-this.#r)/(1-this.#s),e[i++]=this.#r}break;case nt.Sustain:e.fill(this.#s,i,o);return;case nt.Release:for(;i<o;){if(this.#r-=this.#u,this.#r<=0){this.#r=0,this.#i=0,e[i++]=this.#r,this.#t=nt.Idle,this.#h();break}this.#i=3+(1-this.#r/this.#s),e[i++]=this.#r}break;case nt.Idle:e.fill(0,i,o);return}}};var b_;(function(r){function e(t,o,i={}){let{interval:n=64,scanSteps:s=1024,scanSamples:a=2048,minBPM:l=90,maxBPM:c=180}=i,d=new Float32Array(Math.floor(t.length/n)),h=0,f=0,v=0;for(let J of t){let ve=Math.abs(J);h+=(ve-h)*(ve>h?1/8:1/512),++f===n&&(f=0,d[v++]=h)}if(!d.length)return NaN;let g=(J,ve)=>J[Math.floor(ve)]??0,y=J=>o/(J/60)/n,x=J=>o/(J*n)*60,_=[-32,-16,-8,-4,-2,-1,1,2,4,8,16,32],D=[-.5,-.25,.25,.5],V=J=>{let ve=Math.random()*d.length,Ue=g(d,ve),Mt=0,Pr=0;for(let Ct of _){let ke=1/Math.abs(Ct);Mt+=ke*Math.abs(g(d,ve+Ct*J)-Ue),Pr+=ke}for(let Ct of D){let ke=Math.abs(Ct);Mt-=ke*Math.abs(g(d,ve+Ct*J)-Ue),Pr+=ke}return Mt/Pr},K=J=>{let ve=0;for(let Ue=0;Ue<a;++Ue)ve+=V(J);return ve/a},H=y(l),be=y(c),Te=(H-be)/s,ne=l,Me=1/0;for(let J=be;J<=H;J+=Te){let ve=x(J),Ue=K(J)*(l/ve);Ue<Me&&(Me=Ue,ne=ve)}return ne}r.detect=e})(b_||(b_={}));var Ki=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=X(e,0,1),e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let o=bi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=(1-n)/2,a=s,l=2*s,c=s,d=1+i,h=-2*n,f=1-i;this.setNormalizedCoefficients(a,l,c,d,h,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=X(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let o=bi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=(1+n)/2,a=s,l=-2*s,c=s,d=1+i,h=-2*n,f=1-i;this.setNormalizedCoefficients(a,l,c,d,h,f)}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=X(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=bi*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,c=o+1,d=o-1,h=o*(c-d*a+l),f=2*o*(d-c*a),v=o*(c-d*a-l),g=c+d*a+l,y=-2*(d+c*a),x=c+d*a-l;this.setNormalizedCoefficients(h,f,v,g,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=X(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=bi*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,c=o+1,d=o-1,h=o*(c+d*a+l),f=-2*o*(d+c*a),v=o*(c+d*a-l),g=c-d*a+l,y=2*(d-c*a),x=c-d*a-l;this.setNormalizedCoefficients(h,f,v,g,y,x)}else this.setNormalizedCoefficients(o*o,0,0,1,0,0);return this}setPeakingParams(e,t,o){e=X(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=bi*e,s=Math.sin(n)/(2*t),a=Math.cos(n),l=1+s*i,c=-2*a,d=1-s*i,h=1+s/i,f=-2*a,v=1-s/i;this.setNormalizedCoefficients(l,c,d,h,f,v)}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=X(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let o=bi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=1-i,a=-2*n,l=1+i,c=1+i,d=-2*n,h=1-i;this.setNormalizedCoefficients(s,a,l,c,d,h)}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=X(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let o=bi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=1,a=-2*n,l=1,c=1+i,d=-2*n,h=1-i;this.setNormalizedCoefficients(s,a,l,c,d,h)}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=bi*e;if(t>0){let i=Math.sin(o)/(2*t),n=Math.cos(o),s=i,a=0,l=-i,c=1+i,d=-2*n,h=1-i;this.setNormalizedCoefficients(s,a,l,c,d,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,o){B(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 c=0;c<e.length;++c){let d=-Math.PI*2*e[c],h=Math.cos(d),f=Math.sin(d),v=i+((n+s*h)*h-s*f*f),g=(n+s*h)*f+s*f*h,y=1+((a+l*h)*h-l*f*f),x=(a+l*h)*f+l*f*h,_=y*y+x*x,D=(v*y+g*x)/_,V=(g*y-v*x)/_;t[c]=Math.sqrt(D*D+V*V),o[c]=Math.atan2(V,D)}}};var vt=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,c){let d=this.#e,h=this.#t,f=this.#r,v=this.#i;for(let g=l;g<c;g++){let y=s[g],x=a[g]=o*y+i*d+n*h-e*f-t*v+1e-18-1e-18;h=d,d=y,v=f,f=x}this.#e=d,this.#t=h,this.#r=f,this.#i=v}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}},un=class{#e;#t;constructor(e){this.#e=I.create(()=>new vt,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}},op=class{#e=new Ki;#t;#r;#i;#o;#n=-1;constructor(e,t,o){this.#r=e,this.#i=t,this.#o=o,this.#t=new un(4)}get order(){return this.#t.order}set order(e){this.#t.order=e}reset(){this.#t.reset()}process(e,t,o,i,n,s){let l=1/this.#o,c=Math.log(this.#i/this.#r),d=i/this.#t.order**1.25,h=this.#t,f=this.#e,v=n,g=this.#n;for(;v<s;){let y=Math.floor(zr(o[v])*512),x=v+1;for(;x<s&&Math.floor(zr(o[x])*512)===y;)++x;y!==g&&(g=y,f.setLowpassParams(this.#r*Math.exp(y/512*c)*l,d)),h.process(f,e,t,v,x),v=x}this.#n=g}};var A_=Math.log(10)/20,du=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Ke=r=>Math.exp(r*A_),My=r=>Math.log(r)/A_,qa=r=>Ke(20*Math.log10(r));var BS=.02,np=class{#e;#t;#r;#i;#o;#n;#s=NaN;#l=NaN;#a=0;#c=0;#u=0;#h=8;#d=0;#p=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*BS)|0,this.#r=new Ki,this.#r.setLowpassParams(.5),this.#i=[new vt,new vt],this.#o=[new Float32Array(128),new Float32Array(128)],this.#n=new Float32Array(2)}process(e,t,o,i){let[n,s]=e,[a,l]=t,[c,d]=this.#o;this.#i[0].process(this.#r,n,c,o,i),this.#i[1].process(this.#r,s,d,o,i);let h=Ke(this.#d),f=Ke(-this.#d/2),v=this.#e/this.#s,g=Math.pow(2,this.#h)-1,y=1/g;for(let x=o;x<i;x++)this.#c>0&&(this.#s+=this.#a,--this.#c===0&&(this.#a=0,this.#s=this.#l),this.#r.setLowpassParams(this.#s/this.#e)),this.#u+=1,this.#u>=v&&(this.#u-=v,this.#n[0]=X(Math.round(c[x]*h*g)*y,-1,1),this.#n[1]=X(Math.round(d[x]*h*g)*y,-1,1)),a[x]=(n[x]*(1-this.#p)+this.#n[0]*this.#p)*f,l[x]=(s[x]*(1-this.#p)+this.#n[1]*this.#p)*f;this.#f=!0}setCrush(e){let t=n_(20,.5*this.#e,e);this.#f&&isFinite(this.#s)?(this.#l=t,this.#a=(t-this.#s)/this.#t,this.#c=this.#t):(this.#s=t,this.#r.setLowpassParams(this.#s/this.#e))}setBitDepth(e){this.#h=X(e,1,16)}setBoost(e){this.#d=e}setMix(e){this.#p=zr(e)}reset(){this.#f=!1,this.#l=NaN,this.#a=0,this.#c=0,this.#u=0,this.#n.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var __;(function(r){r.Major=[0,2,4,5,7,9,11],r.Minor=[0,2,3,5,7,8,10],r.Minor7=[0,3,7,10],r.Minor9=[0,3,7,10,14],r.Dominant7=[0,2,4,5,7,9,10],r.NoteLabels=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],r.compile=(e,t,o,i)=>I.create(n=>{let s=o+n*2,a=e[s%7]+Math.floor(s/7)*12;return t+a},i),r.toString=e=>r.NoteLabels[e%12]+(Math.floor(e/12)-2)})(__||(__={}));var sp=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=Xh(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=this.#r<0?1-t:t;return o<=this.#i?1-(1-o*this.#n)**this.#o*this.#t:((1-o)*this.#s)**this.#o*this.#t-this.#t+1}};var hu;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(hu||(hu={}));var Fs;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(Fs||(Fs={}));var cr;(function(r){r.globalToLocal=(t,o)=>au(o-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:o,loopOffset:i,loopDuration:n},s,a)=>{let l=t-i,c=l+n;if(l>=a||c<=s)return m.None;let d=Math.max(l,s),h=Math.min(c,a);return m.wrap({index:0,rawStart:l,rawEnd:c,regionStart:Math.max(l,t),regionEnd:Math.min(c,o),resultStart:d,resultEnd:h,resultStartValue:l<d?(d-l)/n:0,resultEndValue:c>h?(h-l)/n:1})};function*e({position:t,complete:o,loopOffset:i,loopDuration:n},s,a){let l=t-i,c=Math.max(t,s),d=Math.min(o,a),h=Math.floor((c-l)/n),f=l+h*n;for(;f<d;){let v=f+n,g=Math.max(f,t),y=Math.min(v,o),x=Math.max(f,c),_=Math.min(v,d),D=f<x?(x-f)/n:0,V=v>_?(_-f)/n:1;yield{index:h++,rawStart:f,rawEnd:v,regionStart:g,regionEnd:y,resultStart:x,resultEnd:_,resultStartValue:D,resultEndValue:V},f=v}}r.locateLoops=e})(cr||(cr={}));var dn=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 ap(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()?Fo.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,o){return this.#e.isEmpty()?Fo.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,o)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},hn=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 ap(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()?Fo.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return Fo.empty();let o=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(o);if(i===null)return Fo.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++o),i===null||i.position>=t)return Fo.empty();return this.#e.iterate(o,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},Ha=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=je.leftMost(this.#e,e,Fs.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*R(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(Fs.complete(o)<e)this.#e.splice(t,1),yield o;else return}}*releaseAll(){if(this.#e.length!==0)for(let e=this.#e.length-1;e>=0;e--){let t=this.#e[e];Number.POSITIVE_INFINITY>t.duration&&(this.#e.splice(e,1),yield t)}}isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}clear(){I.clear(this.#e)}},ap=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=je.leftMostMapped(this.#e,o,nn,hu.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,I.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(),je.rightMostMapped(this.#e,e,nn,hu.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),je.leftMostMapped(this.#e,e,nn,hu.PositionExtractor)}iterateFrom(e,t){let o=this.floorLastIndex(e),i=o;if(i<0)return this.iterate(0,Qt.MAX_VALUE,t);for(;i>=0;){let n=this.optAt(i);if(n!==null&&t!==void 0&&t(n))return this.iterate(i,Qt.MAX_VALUE,t);i--}return this.iterate(o,Qt.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,o=ln.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 lp=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 c=0;c<this.#e;++c)i=r.reverse(c)>>>this.#t,i>c&&(s=e[c],e[c]=e[i],e[i]=s,s=t[c],t[c]=t[i],t[i]=s);let a=this.#r,l=this.#i;for(let c=2;c<=this.#e;c<<=1){let d=c>>1,h=this.#e/c;for(o=0;o<this.#e;o+=c){let f=o+d;for(i=o,n=0;i<f;i++,n=n+h|0){let v=i+d|0,g=a[n],y=l[n],x=e[v],_=t[v],D=x*g+_*y,V=_*g-x*y,K=e[i],H=t[i];e[v]=K-D,t[v]=H-V,e[i]=K+D,t[i]=H+V}}if(c===this.#e)break}}};var Cy=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var Dy=(r,e)=>Math.floor(3840/e)*r,P_=(r,e=4,t=4)=>{let o=Dy(1,t),i=Math.floor(r/o),n=Math.floor(i/e),a=(Math.floor(r)-Dy(n*e,t))%o,l=Math.floor(a/240),c=a%240;return{bars:n,beats:i-n*e,semiquavers:l,ticks:c}},E_=(r,e)=>r*e/60*960,S_=(r,e)=>r*60/960/e,$S=(r,e)=>e*60/960/r,kS=(r,e,t)=>E_(r/t,e),IS=(r,e,t)=>S_(r,e)*t,Q={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:Dy,toParts:P_,secondsToPulses:E_,pulsesToSeconds:S_,secondsToBpm:$S,samplesToPulses:kS,pulsesToSamples:IS,toString:(r,e=4,t=4)=>{let{bars:o,beats:i,semiquavers:n,ticks:s}=P_(r|0,e,t);return`${o+1}.${i+1}.${n+1}:${s}`}};var Xt;(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))}}})(Xt||(Xt={}));var Wi=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 Ja=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 cp=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){B(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),B(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){I.remove(this.#e,e);let t=this.#t.delete(e);B(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??I.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){let o=G(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`);B(!o.includes(e),`${e} is already marked.`),o.push(e)}removeEdge([e,t]){let o=G(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);B(o.includes(e),`${e} is not marked.`),I.remove(o,e)}isEmpty(){return this.#e.length===0}},up=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))G(this.#o.get(i),`Could not find Successor for ${i}`).add(o);let t;do{t=!1;for(let o of this.#e.vertices()){G(e.get(o)).clear();for(let i of G(this.#o.get(o)))for(let n of G(this.#o.get(i)))this.#o.get(o)?.has(n)||(t=!0,G(e.get(o)).add(n))}for(let o of this.#e.vertices()){let i=G(this.#o.get(o));G(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(G(this.#o.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#s(t)}this.#t.push(e)}}#l(){I.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#o.clear()}};var pu;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(pu||(pu={}));var dp=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=Eo(t,o),n=(t-i)/o,s=e?this.#e.fx(n):this.#e.fy(n);return i+s*o}};var Oe;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(Oe||(Oe={}));var hp=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,o,i,n){let s=o/this.sampleRate;switch(t){case Oe.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 Oe.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 Oe.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 Oe.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 pp;(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)=>zr((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)]})(pp||(pp={}));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=Fs.complete(e)-Fs.complete(t);return o!==0?o:e.pitch-t.pitch}})(er||(er={}));var fu=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 Oe.sine:for(let a=i;a<n;a++){let l=this.#t%1;e[a]=Math.sin(2*Math.PI*l),this.#t+=s}break;case Oe.saw:for(let a=i;a<n;a++){let l=this.#t%1,c=2*l-1;c-=this.#i(l,s),e[a]=c,this.#t+=s}break;case Oe.square:for(let a=i;a<n;a++){let l=this.#t%1,c=l<.5?1:-1;c+=this.#i(l,s),c-=this.#i((l+.5)%1,s),e[a]=c,this.#t+=s}break;case Oe.triangle:for(let a=i;a<n;a++){let l=this.#t%1,c=l<.5?1:-1;c+=this.#i(l,s),c-=this.#i((l+.5)%1,s),this.#r+=c*(4*s),e[a]=this.#r,this.#t+=s}break}}generateFromFrequencies(e,t,o,i,n){switch(o){case Oe.sine:for(let s=i;s<n;s++){let a=t[s]*this.#e,l=this.#t%1;e[s]=Math.sin(2*Math.PI*l),this.#t+=a}break;case Oe.saw:for(let s=i;s<n;s++){let a=t[s]*this.#e,l=this.#t%1,c=2*l-1;c-=this.#i(l,a),e[s]=c,this.#t+=a}break;case Oe.square:for(let s=i;s<n;s++){let a=t[s]*this.#e,l=this.#t%1,c=l<.5?1:-1;c+=this.#i(l,a),c-=this.#i((l+.5)%1,a),e[s]=c,this.#t+=a}break;case Oe.triangle:for(let s=i;s<n;s++){let a=this.#t%1,l=t[s]*this.#e,c=a<.5?1:-1;c+=this.#i(a,l),c-=this.#i((a+.5)%1,l),this.#r+=c*(4*l),this.#r*=.9995,e[s]=this.#r,this.#t+=l}break}}#i(e,t){return e<t?(e/=t,e+e-e*e-1):e>1-t?(e=(e-1)/t,e*e+e+e+1):0}};var jr;(function(r){let e;(function(t){t[t.Linear=0]="Linear",t[t.EqualPower=1]="EqualPower"})(e=r.Mixing||(r.Mixing={})),r.zero=()=>({ll:0,lr:0,rl:0,rr:0}),r.identity=()=>({ll:1,lr:0,rl:0,rr:1}),r.update=(t,{gain:o,panning:i,invertL:n,invertR:s,stereo:a,swap:l},c=e.EqualPower)=>{let[d,h]=r.panningToGains(i,c),f=d*o,v=h*o;n&&(f*=-1),s&&(v*=-1);let g=Math.max(0,-a),y=Math.max(0,a),x=1-y,_=1+y,D=g*.5,V=1-g,K=(x+_)*.5,H=(x-_)*.5,be=(x-_)*.5,Te=(x+_)*.5,ne=f*(D+V)*K+v*D*H,Me=f*(D+V)*be+v*D*Te,J=f*D*K+v*(D+V)*H,ve=f*D*be+v*(D+V)*Te;l?(t.ll=Me,t.rl=ne,t.lr=ve,t.rr=J):(t.ll=ne,t.lr=J,t.rl=Me,t.rr=ve)},r.panningToGains=(t,o)=>{let i=X(t,-1,1);switch(o){case e.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case e.EqualPower:return[Math.cos((i+1)*Sy),Math.sin((i+1)*Sy)]}},r.applyFrame=(t,o,i)=>[t.ll*o+t.rl*i,t.lr*o+t.rr*i],r.processFrames=(t,o,i,n,s)=>{let[a,l]=o,[c,d]=i;for(let h=n;h<s;h++){let f=a[h],v=l[h];c[h]=t.ll*f+t.rl*v,d[h]=t.lr*f+t.rr*v}},r.replaceFrames=(t,[o,i],n,s)=>{for(let a=n;a<s;a++){let l=o[a],c=i[a];o[a]=t.ll*l+t.rl*c,i[a]=t.lr*l+t.rr*c}}})(jr||(jr={}));var Kt;(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=jr.zero();#r=jr.zero();#i=jr.zero();#o=0;constructor(i){this.#e=i}update(i,n,s){jr.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,c]=i,[d,h]=n;if(this.isInterpolating())for(let f=s;f<a;f++){let v=l[f],g=c[f],y=this.moveAndGet();d[f]=y.ll*v+y.rl*g,h[f]=y.lr*v+y.rr*g}else{let f=this.#r;for(let v=s;v<a;v++){let g=l[v],y=c[v];d[v]=f.ll*g+f.rl*y,h[v]=f.lr*g+f.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})(Kt||(Kt={}));var mu=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]),Ry=new Float32Array(12),N_=new Float32Array(11);for(let r=0,e=0,t=0;r<mu.length;r++)r%2===0?Ry[e++]=mu[r]:N_[t++]=mu[r];var Oy=class{#e=new Float32Array(Ry.length);#t=new Float32Array(mu.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=Ry,a=N_;for(let l=o;l<i;l++){let c=e[l],d=(l-o)*2;n[this.#r]=c;let h=0;for(let v=0;v<s.length;v++){let g=(this.#r-v+n.length)%n.length;h+=n[g]*s[v]}t[d]=h*2;let f=0;for(let v=0;v<a.length;v++){let g=(this.#r-v+n.length-1)%n.length;f+=n[g]*a[v]}t[d+1]=f*2,this.#r=(this.#r+1)%n.length}}downsample(e,t,o,i){let n=this.#t,s=mu;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 c=0;for(let d=0;d<s.length;d++){let h=(this.#i-1-d+n.length)%n.length;c+=n[h]*s[d]}t[a]=c}}},fp=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=I.create(()=>new Oy,t),this.#r=I.create(o=>new Float32Array(128*(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 c=0;c<this.#t.length;c++){let h=c===this.#t.length-1?t:this.#r[c];this.#t[c].upsample(s,h,a,l),s=h,a=0,l=n*(2<<c)}}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 c=l===0,d=c?t:this.#r[l-1],h=c?o:0,f=c?i:a/2;this.#t[l].downsample(s,d,h,f),s=d,a=f}}},mp=class{#e;#t;constructor(e){this.#e=new fp(e),this.#t=new fp(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 Qa=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)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var gp=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 c=t;c<o;++c){let d=s[c],h=a[c],f=Math.max(Math.abs(d),Math.abs(h));if(l=f>l?i*(l-f)+f:n*(l-f)+f,l>1){let v=1/l;s[c]=d*v,a[c]=h*v}}this.#o=l}};var Ai=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 vp=class{#e=new j;#t;#r;constructor(e){this.#t=this.#e.own(new te),this.#e.own(e.subscribe(t=>{this.#r=t.getValue(),this.#t.notify(this)})),this.#r=e.getValue()}subscribe(e){return this.#t.subscribe(e)}getTempoAt(e){return this.#r}positionToSeconds(e){return Q.pulsesToSeconds(e,this.#r)}positionToPPQN(e){return Q.secondsToPulses(e,this.#r)}intervalToSeconds(e,t){return Q.pulsesToSeconds(t-e,this.#r)}intervalToPPQN(e,t){return Q.secondsToPulses(t-e,this.#r)}terminate(){this.#t.terminate()}};var Dt;(function(r){r.Musical="musical",r.Seconds="seconds"})(Dt||(Dt={}));var Ya;(function(r){function e(o,i,n){return new zy(o,i,n)}r.musical=e;function t(o,i,n,s){return new Vy(o,i,n,s)}r.aware=t})(Ya||(Ya={}));var Vy=class{#e;#t;#r;#i;constructor(e,t,o,i){this.#i=i,this.#t=t,this.#r=o,this.#e=e}toPPQN(){let e=this.#i.getValue();if(this.getTimeBase()===Dt.Musical)return e;let t=this.#r.getValue(),o=this.#e.positionToSeconds(t),i=o+e;return this.#e.intervalToPPQN(o,i)}fromPPQN(e){if(this.getTimeBase()===Dt.Musical)this.#i.setValue(e);else{let t=this.#r.getValue(),o=this.#e.intervalToSeconds(t,t+e);this.#i.setValue(o)}}toSeconds(){let e=this.#i.getValue();if(this.getTimeBase()===Dt.Seconds)return e;let t=this.#r.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#i.getValue()}getTimeBase(){return _o(this.#t.getValue(),Dt)}},zy=class{#e;#t;#r;constructor(e,t,o){this.#r=o,this.#t=t,this.#e=e}toPPQN(){return this.#r.getValue()}fromPPQN(e){this.#r.setValue(e)}toSeconds(){let e=this.#r.getValue(),t=this.#t.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#r.getValue()}getTimeBase(){return Dt.Musical}};var yp=Q.fromSignature(1,384);var pn={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},xp;(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:P(`${i} and ${n} are identical in terms of comparison`)};function*e(i,n,s){if(i.isEmpty())return He.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=je.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:c}=a.next();if(l)return s;if(c.position<=n){let{done:d,value:h}=a.next();if(d)return c.value;if(n<h.position)return o(c,h,n);if(c.interpolation===pn.None)return c.value}return c.value};function*t(i,n,s,a){if(i.isEmpty())return;let l=i.iterateFrom(n),{done:c,value:d}=l.next();if(c)return;let h=s/a,f=d;if(f.position>n){for(;n<f.position;)if(yield{position:n,value:f.value},n+=h,n>s)return;f.position<=s&&(yield f)}for(;n<=s;){let{done:v,value:g}=l.next();if(v)break;for(;n<g.position;){if(n>s)return;yield{position:n,value:o(f,g,n)},n+=h}g.position<s&&(f.interpolation===pn.None&&(yield{position:g.position,value:f.value}),yield g),f=g}for(;n<=s;)yield{position:n,value:f.value},n+=h}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"?Ur.valueAt({slope:s.slope,steps:a.position-n,y0:i,y1:a.value},l-n):P("Unknown interpolation")})(xp||(xp={}));var gu;(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 c=0;c<o;++c)i[c]=.35875-.48829*Math.cos(s*c)+.14128*Math.cos(a*c)-.01168*Math.cos(l*c);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}}}})(gu||(gu={}));var wp=Symbol.for("@openDAW/lib-dsp");globalThis[wp]?console.debug(`%c${wp.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[wp]=!0,console.debug(`%c${wp.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var bp=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=I.create(()=>new Qa(sampleRate*o),t);let n=lr.createBuilder({peak:lr.floats(t),rms:lr.floats(t)})();this.#o=Za.writer(n,e,s=>{let a=Math.exp(-(128*this.#n)/(sampleRate*i));for(let l=0;l<t;++l){let c=this.#t[l],d=this.#r[l];s.peak[l]=c,s.rms[l]=Math.sqrt(d),this.#t[l]=c*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<128;++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 he=class r{static newSet(e){return new Ka(e,r.Comparator)}static compose=(e,...t)=>{let o=t.length===0?this.#e:new Int16Array(t);return B(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 B(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=je.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,...I.create(()=>e.readShort(),o))}},Bs;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>he.Comparator(e,t),r.equals=(e,t)=>{let[o,i]=je.rangeMapped(t,e,he.Comparator,r.AddressReader);return t.slice(o,i+1)},r.startsWith=(e,t)=>{let[o,i]=je.rangeMapped(t,e,he.MinimalComparator,r.AddressReader);return t.slice(o,i+1).filter(n=>n.address.startsWith(e))},r.endsWith=(e,t)=>{let o=je.leftMostMapped(t,e,he.LengthComparator,r.AddressReader),i=je.rightMostMapped(t,e,he.MinimalComparator,r.AddressReader);return t.slice(o,i+1).filter(n=>e.startsWith(n.address))}})(Bs||(Bs={}));var Zi=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 gt}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let o=he.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():He.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 P(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 Uy=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},Xa=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Z=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 A(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 Zi(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 I.empty()}record(){return Er.empty()}getField(e){return P()}optField(e){return m.None}read(e){}write(e){}toJSON(){}fromJSON(e){return P("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()}`}};Uy([Va,Xa("design:type",Zi),Xa("design:paramtypes",[])],Z.prototype,"pointerHub",null);Uy([Va,Xa("design:type",he),Xa("design:paramtypes",[])],Z.prototype,"address",null);Uy([Va,Xa("design:type",String),Xa("design:paramtypes",[])],Z.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,accepts:[]});var Ap=class r extends Z{static create(e,t,o){return new r(e,t,o)}#e;constructor(e,t,o){super(e),this.#e=I.create(i=>t({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),o)}accept(e){return A(e.visitArrayField,this)}fields(){return this.#e}record(){return I.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return G(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 P("Type mismatch")}};var fn;(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=We.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)=>{B(t.readInt()===1179403347,"Serializer header is corrupt");let i=t.readShort();for(let n=0;n<i;n++){let s=t.readShort();if(Hh(o[s]))continue;let a=t.readInt(),l=new Int8Array(a);t.readBytes(l);let{status:c,error:d}=Es(()=>o[s]?.read(new Ze(l.buffer)));c==="failure"&&console.warn(o,d)}}})(fn||(fn={}));var TS=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},F_=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},M=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=he.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 G(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 Zi(this)}estimateMemory(){let e=new Oa;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ee(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){fn.readFields(e,this.#o)}write(e){fn.writeFields(e,this.#o)}serialize(){let e=We.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=We.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[t,o])=>{let i=o.toJSON();return R(i)&&(e[t]=i),e},{})}fromJSON(e){if(on(e))Object.entries(e).forEach(([t,o])=>{let i=this.#o[parseInt(t)];R(o)&&i.fromJSON(o)});else return P("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return I.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(`
|
|
4
|
-
`)),console.debug(" unstages",[...e].map(o=>o.toString()).join(`
|
|
5
|
-
`),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()}`}};TS([Va,F_("design:type",Zi),F_("design:paramtypes",[])],M.prototype,"pointerHub",null);var Be;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(Be||(Be={}));var _p;(function(r){r.create=()=>new jy})(_p||(_p={}));var jy=class{#e=new vu(Bs.equals);#t=new vu(Bs.startsWith);#r=new vu(Bs.endsWith);#i=[];#o=0;#n=!1;subscribe(e,t,o){let i=new Ly(t,e,this.#o++,o);if(this.#n){let n=new Ky(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 Be.This:return this.#e.subscribe(e);case Be.Parent:return this.#t.subscribe(e);case Be.Children:return this.#r.subscribe(e);default:return bo(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Ly=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: ${Be[this.propagation]}, order: ${this.order} }`}},vu=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(Bs.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Ky=class{monitor;propagation;#e=new j;#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 ct;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(ct||(ct={}));var ks={[ct.Boolean]:{type:ct.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[ct.Float32]:{type:ct.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[ct.Int32]:{type:ct.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[ct.String]:{type:ct.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[ct.Bytes]:{type:ct.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},$s=class extends Z{#e;#t;#r;constructor(e,t,o){super(e),this.#e=t,this.#t=this.clamp(o),this.#r=this.#t}accept(e){return A(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Be.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){B(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){B(!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)?P("not implemented"):e}fromJSON(e){return P("Type mismatch")}reset(){this.setValue(this.#t)}},T=class r extends $s{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,ct.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return ks[ct.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){B(!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()))}},E=class r extends $s{static create(e,t=0){return new r(e,t)}constructor(e,t){super(e,ct.Float32,t)}serialization(){return ks[ct.Float32]}equals(e){return this.getValue()===e}clamp(e){return No.toFloat32(e)}read(e){this.setValue(e.readFloat())}write(e){B(!this.deprecated,"FLoat32Field.write: deprecated field"),e.writeFloat(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString()))}},N=class r extends $s{static create(e,t=0){return new r(e,t)}constructor(e,t){super(e,ct.Int32,t)}serialization(){return ks[ct.Int32]}equals(e){return this.getValue()===e}clamp(e){return Qt.toInt(e)}read(e){this.setValue(e.readInt())}write(e){B(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=Qt.MIN_VALUE&&e<=Qt.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends $s{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,ct.String,t)}serialization(){return ks[ct.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){B(!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()))}},B_=class r extends $s{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,ct.Bytes,t)}serialization(){return ks[ct.Bytes]}equals(e){return this.getValue().length===e.length&&this.getValue().every((t,o)=>e[o]===t)}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){B(!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 $_;(function(r){r.decode=e=>{let t=e.readInt();return I.create(()=>{switch(e.readString()){case"new":{let i=b.fromDataInput(e),n=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new yu(i,n,s.buffer)}case"pointer":{let i=he.read(e),n=e.readBoolean()?m.wrap(he.read(e)):m.None,s=e.readBoolean()?m.wrap(he.read(e)):m.None;return new wu(i,n,s)}case"primitive":{let i=he.read(e),n=e.readString(),s=ks[n],a=s.decode(e),l=s.decode(e);return new xu(i,s,a,l)}case"delete":{let i=b.fromDataInput(e),n=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new bu(i,n,s.buffer)}}},t)}})($_||($_={}));var yu=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 Ze(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()}},xu=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}`}},wu=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()}`}},bu=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 Ze(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 mR=Symbol("Unreferenceable"),k=class r extends Z{static create(e,t,o){return new r(e,t,o)}static encodeWith(e,t){B(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=m.wrap(e);let o=Es(t);if(this.#e=m.None,o.status==="failure")throw o.error;return o.value}static decodeWith(e,t){B(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=m.wrap(e);let o=Es(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 P(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return A(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Be.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=Zi.validate(this,e.unwrap());t.nonEmpty()&&P(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()}resolvedTo(e){this.#o=e}read(e){let t=e.readBoolean()?m.wrap(he.read(e)):m.None;this.targetAddress=r.#t.match({none:()=>t,some:o=>o.map(this,t)})}write(e){B(!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(_s(e)||typeof e=="string"){let t=m.wrap(_s(e)?null:he.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:o=>o.map(this,t)})}else return P(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var Pp=class{#e;#t;#r;#i;constructor(){this.#e=he.newSet(e=>e.address),this.#t=he.newSet(e=>e.address),this.#r=he.newSet(([e])=>e),this.#i=he.newSet(([e])=>e.address)}watchVertex(e){if(Le(e,k)){if(!e.mandatory)return P("watchVertex called but has no edge requirement");this.#e.add(e)}else{if(!e.pointerRules.mandatory)return P("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 P(`${o} has outgoing edges: ${i.map(([s,a])=>`[${s.toString()}, ${a.toString()}]`)}`);let n=this.incomingEdgesOf(o);if(n.length>0)return P(`${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);I.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,I.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?P(`Pointer ${e.toString()} requires an edge.`):P(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?P(`Target ${e.toString()} requires an edge.`):P(`Illegal state: ${e} has no edge requirements.`)})}#o(e,t,o){let i=he.boxRange(e,t,o);return R(i)?e.values().slice(i[0],i[1]):I.empty()}#n(e,t,o){let i=he.boxRange(e,t,o);R(i)&&e.removeRange(i[0],i[1])}};var Is=class{#e;#t;#r;#i;#o;#n;#s;#l;#a;#c;#u=!1;#h=!1;constructor(e=m.None){this.#e=e,this.#t=b.newSet(t=>t.address.uuid),this.#r=[],this.#s=_p.create(),this.#i=new gt,this.#o=new gt,this.#n=new gt,this.#l=new Pp,this.#a=he.newSet(({pointer:t})=>t.address),this.#c=[]}beginTransaction(){B(!this.#u,"Transaction already in progress"),this.#u=!0,this.#n.proxy.onBeginTransaction()}endTransaction(){for(B(this.#u,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#d(e,t)),this.#r.length=0),this.#a.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.#a.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.#n.proxy.onEndTransaction()}inTransaction(){return this.#u}constructingBox(){return this.#h}createBox(e,t,o){return this.#e.unwrap("No box-factory installed")(e,this,t,o)}stageBox(e,t){this.#p(),B(!this.#h,"Cannot construct box while other box is constructing"),R(t)&&(this.#h=!0,t(e),this.#h=!1);let o=this.#t.add(e);B(o,`${e} already staged`);let i=new yu(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.#c.push(e)}unstageBox(e){this.#p();let t=this.#t.removeByKey(e.address.uuid);B(t===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let o=new bu(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 tp;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,o){if(this.#p(),e.isAttached()&&!this.#h){let i=new xu(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.#p(),t.nonEmpty()&&this.#l.disconnect(e),o.nonEmpty()&&this.#l.connect(e,o.unwrap());let i=new wu(e.address,t,o);this.#h?this.#r.push({pointerField:e,update:i}):(this.#d(e,i),this.#o.proxy.onUpdate(i))}#d(e,t){let{oldAddress:o,newAddress:i}=t;e.resolvedTo(i.flatMap(s=>this.findVertex(s))),this.#a.opt(e.address).match({none:()=>this.#a.add({pointer:e,initial:o,final:i,index:this.#a.size()}),some:s=>s.final=i}),this.#s.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e,t={}){let o=R(t.excludeBox)?t.excludeBox:ln.alwaysFalse,i=R(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,n=new Set,s=new Set,a=l=>{n.has(l)||o(l)||(n.add(l),l.outgoingEdges().filter(([c])=>!s.has(c)).forEach(([c,d])=>{let h=this.findVertex(d).unwrap(`Could not find target of ${c.toString()}`);if(s.add(c),h.pointerRules.mandatory&&(i||h.pointerHub.incoming().every(f=>s.has(f))))return a(h.box)}),l.incomingEdges().forEach(c=>{s.add(c),c.mandatory&&a(c.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();B(s,`pointer ${n.address} is broken`),B(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:P("Unknown address"))))}toArrayBuffer(){let e=We.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){B(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new Ze(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 Ze(a.buffer),c=l.readInt(),d=l.readString(),h=b.fromDataInput(l);i.push({creationIndex:c,name:d,uuid:h,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:G(e.toJSON())}))}#p(){B(this.#u,()=>"Modification only prohibited in transaction mode.")}};var el;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let o=r.collectIndexedBoxes(e),i=X(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=X(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=X(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 N,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:o})=>r.isIndexedBox(o)&&(t===void 0||o instanceof t)?o:P(`${o} has no index field`)).sort((o,i)=>o.index.getValue()-i.index.getValue())})(el||(el={}));var Ve=class extends Z{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return A(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return G(this.#e[e])}optField(e){return m.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Be.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){fn.readFields(e,this.#e)}write(e){fn.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(on(e))Object.entries(e).forEach(([t,o])=>{let i=this.#e[parseInt(t)];R(o)&&i.fromJSON(o)});else return P("Type mismatch")}};var tr;(function(r){r.sender=(o,i)=>i(new e(o)),r.executor=(o,i)=>new t(o,i);class e{#e;#t=new Map;#r;#i=0;constructor(i){this.#e=i,this.#r=i.subscribe(this.#o)}terminate(){this.#r.terminate()}dispatchAndForget=(i,...n)=>this.#e.send({type:"send",returnId:!1,func:i.name,args:Array.from(He.map(n,s=>({value:s})))});dispatchAndReturn=(i,...n)=>new Promise((s,a)=>{let l=He.reduce(n,(c,d,h)=>(typeof d=="function"&&c.push([h,d]),c),[]);this.#t.set(this.#i,{executorTuple:{resolve:s,reject:a},callbacks:new Map(l)}),this.#e.send({type:"send",returnId:this.#i,func:i.name,args:Array.from(He.map(n,(c,d)=>typeof c=="function"?{callback:d}:{value:c}))}),this.#i++});#o=i=>{let n=this.#t.get(i.returnId);R(n)?i.type==="resolve"?(n.executorTuple.resolve(i.resolve),this.#t.delete(i.returnId)):i.type==="reject"?(n.executorTuple.reject(i.reject),this.#t.delete(i.returnId)):i.type==="callback"&&n.callbacks?.get(i.funcAt).apply(this,i.args):P(`Promise has already been resolved. ${JSON.stringify(i)}`)}}class t{#e;#t;#r;constructor(i,n){this.#e=i,this.#t=n,this.#r=i.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=i=>{B(i.type==="send",()=>"Message type must be 'send'");let n=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),s=G(n[i.func],`${i.func.toString()} does not exists on ${this.#t}`),a=i.returnId;if(a===!1)s.apply(this.#t,i.args.map(l=>"value"in l?l.value:P(`${i.func.toString()} has no promise.`)));else try{s.apply(this.#t,i.args.map(c=>"callback"in c?(...d)=>this.#s(a,c.callback,d):c.value)).then(c=>{try{this.#o(a,c)}catch(d){this.#n(a,d)}},c=>this.#n(a,c))}catch(l){this.#n(a,l)}};#o=(i,n)=>this.#e.send({type:"resolve",returnId:i,resolve:n});#n=(i,n)=>this.#e.send({type:"reject",returnId:i,reject:n});#s=(i,n,s)=>this.#e.send({type:"callback",returnId:i,funcAt:n,args:s})}r.Executor=t})(tr||(tr={}));var k_;(function(r){r.ProgressArrayBuffer=e=>async t=>{if(!t.headers.has("Content-Length"))return console.debug("No Content-Length"),t.arrayBuffer();let o=parseInt(t.headers.get("Content-Length"));if(console.debug(`Content-Length: ${o}b`),isNaN(o)||o<4096)return t.arrayBuffer();e(0);let i=We.create(o),n=G(t.body,"response.body is empty").getReader();for(;;){let{done:s,value:a}=await n.read();if(s)break;a.forEach(l=>i.writeByte(l)),e(i.position/o)}return e(1),i.toArrayBuffer()}})(k_||(k_={}));var I_;(function(r){r.debounce=(()=>{let e;return(t,o=1e3)=>{clearTimeout(e),e=setTimeout(t,o)}})(),r.scheduleInterval=(e,t,...o)=>{let i=setInterval(e,t,...o);return{terminate:()=>clearInterval(i)}},r.scheduleTimeout=(e,t,...o)=>{let i=setTimeout(e,t,...o);return{terminate:()=>clearTimeout(i)}}})(I_||(I_={}));var T_={for:r=>new Wy(r)},Wy=class{#e;#t=new te;constructor(e){if(this.#e=e,R(e.onmessage)||R(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){this.#e.postMessage(e)}channel(e){return new Zy(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},Zy=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){this.#e.send({__id__:"42",channel:this.#t,message:e})}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var Ep;(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}=Es(()=>e.next());if(n==="success"){let{done:l,value:c}=s;l&&(clearInterval(i),t(c))}else clearInterval(i),o(a)},0)})})(Ep||(Ep={}));var Gy=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)}},mn;(function(r){class e{value;status="resolved";constructor(a){this.value=a}error=Ao("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(a){this.error=a}value=Ao("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(s,a)=>{let l=!0;return s.own(W.create(()=>l=!1)),new Promise((c,d)=>a.then(h=>{l&&c(h)},h=>{l&&d(h)}))},r.tryCatch=s=>s.then(a=>new e(a),a=>new t(a));let o=new Gy(3,cn.seconds(3));r.retry=(s,a=o)=>s().catch(l=>new Promise((c,d)=>{let h=f=>{a.retry(f,()=>s().then(v=>c(v),h))||d(f)};h(l)})),r.guardedRetry=(s,a)=>{let l=async(c=0)=>{try{return await s()}catch(d){if(a(d,++c))return console.debug("retrying after failure:",d),await Ep.timeSpan(cn.seconds(1)),l(c);throw new Error(`Failed after ${c} retries: ${d}`)}};return l()},r.approvedRetry=(s,a)=>{let l=async()=>{try{return await s()}catch(c){if(await Wa.approve(a(c)))return l();throw c}};return l()},r.fail=(s,a)=>{let l=()=>new Promise((c,d)=>setTimeout(()=>d("fails first"),s.millis()));return()=>{let c=l();return l=a,c}},r.timeout=(s,a,l)=>new Promise((c,d)=>{let h=!0,f=setTimeout(()=>{h=!1,d(new Error(l??"timeout"))},a.millis());s.then(v=>{h&&c(v)},v=>{h&&d(v)}).finally(()=>clearTimeout(f))}),r.sequentialAll=s=>s.reduce((a,l)=>a.then(async c=>[...c,await l()]),Promise.resolve([])),r.sequentialize=s=>{let a=Promise.resolve();return l=>{let c=()=>s(l),d=a.then(c,c);return a=d.catch(()=>{}),d}},r.memoizeAsync=(s,a)=>{let l=null,c=Date.now();return()=>{let d=Date.now();return(_s(l)||R(a)&&d-c>a.millis())&&(c=d,l=s(),l.catch(h=>(l=null,h))),l}},r.allWithLimit=async(s,a=1)=>{let l=new Array(s.length),c=0,d=!1,h=async()=>{for(;c<s.length&&!d;){let f=c++;try{let v=await s[f]();d||(l[f]=v)}catch(v){throw d=!0,v}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},h)),l},r.allSettledWithLimit=async(s,a=1)=>{let l=new Array(s.length),c=0,d=async()=>{for(;c<s.length;){let h=c++;try{let f=await s[h]();l[h]={status:"fulfilled",value:f}}catch(f){l[h]={status:"rejected",reason:f}}}};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(B(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[a,{resolve:l,reject:c}]=this.#e.shift();this.#t++,a().then(l,c)}}}r.Limit=i;class n{#e;#t;#r;#i=m.None;constructor(a,l,c){this.#e=a,this.#t=l,this.#r=c}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(),A(this.#r))})}terminate(){this.#i=m.None}}r.Latest=n})(mn||(mn={}));var M_;(function(r){let e=new mn.Limit(4);r.limitFetch=(t,o)=>e.add(()=>fetch(t,o)),r.DefaultRetry=(t,o)=>!Le(t,rp.FileNotFound)||o<=100})(M_||(M_={}));var C_=(r="debug")=>{let e=performance.now();return{lab:t=>console[r].call(console,`${t} in ${(performance.now()-e).toFixed(1)}ms`)}};var D_;(function(r){r.startEstimator=()=>{let e=performance.now();return t=>{if(t===0)return cn.POSITIVE_INFINITY;let o=performance.now()-e;return cn.millis(o/t-o)}}})(D_||(D_={}));var Sp=Symbol.for("@openDAW/lib-runtime");globalThis[Sp]?console.debug(`%c${Sp.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Sp]=!0,console.debug(`%c${Sp.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var R_=(r,e)=>tr.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 Ze(o.buffer))):i==="update-primitive"?r.findVertex(he.reconstruct(o.address)).unwrap(()=>`Could not find primitive field ${o.address}`).setValue(o.value):i==="update-pointer"?r.findVertex(he.reconstruct(o.address)).unwrap(()=>`Could not find pointer field ${o.address}`).targetAddress=R(o.target)?m.wrap(he.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 I.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var Np=Symbol.for("@openDAW/lib-box");globalThis[Np]?console.debug(`%c${Np.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Np]=!0,console.debug(`%c${Np.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var Fp=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 u;(function(r){r[r.Timeline=0]="Timeline",r[r.Selection=1]="Selection",r[r.PianoMode=2]="PianoMode",r[r.User=3]="User",r[r.AudioConnection=4]="AudioConnection",r[r.InstrumentHost=5]="InstrumentHost",r[r.AudioOutput=6]="AudioOutput",r[r.Capture=7]="Capture",r[r.NotesConnection=8]="NotesConnection",r[r.VoltageConnection=9]="VoltageConnection",r[r.AudioUnits=10]="AudioUnits",r[r.MidiEffectHost=11]="MidiEffectHost",r[r.AudioEffectHost=12]="AudioEffectHost",r[r.AudioBusses=13]="AudioBusses",r[r.AuxSend=14]="AuxSend",r[r.FileUploadState=15]="FileUploadState",r[r.Modulation=16]="Modulation",r[r.Automation=17]="Automation",r[r.Parameter=18]="Parameter",r[r.ParameterController=19]="ParameterController",r[r.MidiControl=20]="MidiControl",r[r.StepAutomation=21]="StepAutomation",r[r.Editing=22]="Editing",r[r.AudioFile=23]="AudioFile",r[r.SoundfontFile=24]="SoundfontFile",r[r.AudioUnit=25]="AudioUnit",r[r.MarkerTrack=26]="MarkerTrack",r[r.MarkerEvents=27]="MarkerEvents",r[r.ClipCollection=28]="ClipCollection",r[r.RegionCollection=29]="RegionCollection",r[r.TrackCollection=30]="TrackCollection",r[r.Device=31]="Device",r[r.MIDIDevice=32]="MIDIDevice",r[r.Groove=33]="Groove",r[r.ModularSetup=34]="ModularSetup",r[r.ModuleCollection=35]="ModuleCollection",r[r.ConnectionCollection=36]="ConnectionCollection",r[r.DeviceUserInterface=37]="DeviceUserInterface",r[r.NoteEvents=38]="NoteEvents",r[r.NoteEventFeature=39]="NoteEventFeature",r[r.NoteEventCollection=40]="NoteEventCollection",r[r.ValueEvents=41]="ValueEvents",r[r.ValueEventCollection=42]="ValueEventCollection",r[r.ValueInterpolation=43]="ValueInterpolation",r[r.Sample=44]="Sample"})(u||(u={}));var Au;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(Au||(Au={}));var O_;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(O_||(O_={}));var yt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(yt||(yt={}));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.Delete=23]="Delete",r[r.Dial=24]="Dial",r[r.DinSlot=25]="DinSlot",r[r.Disconnected=26]="Disconnected",r[r.Divide=27]="Divide",r[r.DragConnections=28]="DragConnections",r[r.Dropdown=29]="Dropdown",r[r.Dropbox=30]="Dropbox",r[r.DrumSet=31]="DrumSet",r[r.Tidal=32]="Tidal",r[r.Duration=33]="Duration",r[r.EditBox=34]="EditBox",r[r.Effects=35]="Effects",r[r.Embed=36]="Embed",r[r.EQ=37]="EQ",r[r.Eraser=38]="Eraser",r[r.Exclude=39]="Exclude",r[r.Exit=40]="Exit",r[r.ExpandWidth=41]="ExpandWidth",r[r.FileList=42]="FileList",r[r.Flask=43]="Flask",r[r.Focus=44]="Focus",r[r.Generator=45]="Generator",r[r.GoogleDrive=46]="GoogleDrive",r[r.Groove=47]="Groove",r[r.Guitar=48]="Guitar",r[r.GuitarTab=49]="GuitarTab",r[r.Headphone=50]="Headphone",r[r.Heart=51]="Heart",r[r.Help=52]="Help",r[r.HighPass=53]="HighPass",r[r.HighShelf=54]="HighShelf",r[r.Insert=55]="Insert",r[r.Invert=56]="Invert",r[r.Loop=57]="Loop",r[r.LowPass=58]="LowPass",r[r.LowShelf=59]="LowShelf",r[r.Magnet=60]="Magnet",r[r.MainMenu=61]="MainMenu",r[r.Maximized=62]="Maximized",r[r.Menu=63]="Menu",r[r.Merge=64]="Merge",r[r.Metronome=65]="Metronome",r[r.Microphone=66]="Microphone",r[r.Midi=67]="Midi",r[r.Minimized=68]="Minimized",r[r.Mix=69]="Mix",r[r.Mixing=70]="Mixing",r[r.Mute=71]="Mute",r[r.NanoWave=72]="NanoWave",r[r.New=73]="New",r[r.NoAudio=74]="NoAudio",r[r.Note=75]="Note",r[r.NotePad=76]="NotePad",r[r.OpenDAW=77]="OpenDAW",r[r.Panel=78]="Panel",r[r.Peak=79]="Peak",r[r.Pencil=80]="Pencil",r[r.Piano=81]="Piano",r[r.Playfield=82]="Playfield",r[r.Play=83]="Play",r[r.Pointer=84]="Pointer",r[r.Popout=85]="Popout",r[r.Primary=86]="Primary",r[r.Random=87]="Random",r[r.Record=88]="Record",r[r.Rectangle=89]="Rectangle",r[r.Region=90]="Region",r[r.Robot=91]="Robot",r[r.RoundDown=92]="RoundDown",r[r.RoundUp=93]="RoundUp",r[r.Run=94]="Run",r[r.Sawtooth=95]="Sawtooth",r[r.Saxophone=96]="Saxophone",r[r.Scissors=97]="Scissors",r[r.Search=98]="Search",r[r.Sine=99]="Sine",r[r.Solo=100]="Solo",r[r.SoundFont=101]="SoundFont",r[r.SpeakerHeadphone=102]="SpeakerHeadphone",r[r.Square=103]="Square",r[r.Stack=104]="Stack",r[r.Start=105]="Start",r[r.Stereo=106]="Stereo",r[r.Stop=107]="Stop",r[r.Subtract=108]="Subtract",r[r.Sun=109]="Sun",r[r.Swap=110]="Swap",r[r.System=111]="System",r[r.Table=112]="Table",r[r.Tape=113]="Tape",r[r.Time=114]="Time",r[r.Timeline=115]="Timeline",r[r.Tool=116]="Tool",r[r.Triangle=117]="Triangle",r[r.Unknown=118]="Unknown",r[r.UserFolder=119]="UserFolder",r[r.Velocity=120]="Velocity",r[r.Vinyl=121]="Vinyl",r[r.VUMeter=122]="VUMeter",r[r.Waveform=123]="Waveform",r[r.Zeitgeist=124]="Zeitgeist"})($e||($e={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})($e||($e={}));var Gi;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(Gi||(Gi={}));var V_=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?P(`Indices cannot be equal (${r}, ${e})`):t};var Bo=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},Rt=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)},Bp,_i,gn,$p,$o,Ot=class r{static create(e,t,o){return new r(e,t,o)}constructor(e,t,o){Bp.set(this,void 0),_i.set(this,void 0),gn.set(this,void 0),$p.set(this,void 0),$o.set(this,null),Bo(this,Bp,e,"f"),Bo(this,_i,b.newSet(i=>i.adapter.uuid),"f"),Bo(this,gn,new gt,"f"),Bo(this,$p,e.pointerHub.catchupAndSubscribe({onAdded:i=>{Bo(this,$o,null,"f");let n=t(i.box),s=n.indexField.subscribe(()=>{Bo(this,$o,null,"f"),Rt(this,gn,"f").proxy.onReorder(n)}),a=Rt(this,_i,"f").add({adapter:n,subscription:s});B(a,`Could not add ${n}`),Rt(this,gn,"f").proxy.onAdd(n)},onRemoved:i=>{Bo(this,$o,null,"f");let n=i.box.address.uuid,{adapter:s,subscription:a}=Rt(this,_i,"f").removeByKey(n);a.terminate(),Rt(this,gn,"f").proxy.onRemove(s)}},o),"f")}field(){return Rt(this,Bp,"f")}subscribe(e){return Rt(this,gn,"f").subscribe(e)}catchupAndSubscribe(e){return Rt(this,_i,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=je.exactMapped(this.adapters(),e,V_,o=>o.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return Rt(this,_i,"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 Rt(this,$o,"f")===null&&Bo(this,$o,Rt(this,_i,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),Rt(this,$o,"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=X(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=X(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 Rt(this,_i,"f").size()}isEmpty(){return this.size()===0}terminate(){Bo(this,$o,null,"f"),Rt(this,_i,"f").forEach(({subscription:e})=>e.terminate()),Rt(this,_i,"f").clear(),Rt(this,gn,"f").terminate(),Rt(this,$p,"f").terminate()}};Bp=new WeakMap,_i=new WeakMap,gn=new WeakMap,$p=new WeakMap,$o=new WeakMap;var Ts;(function(r){r.create=(e,t,o,i)=>{switch(e){case"RootBox":return tl.create(t,o,i);case"SelectionBox":return qi.create(t,o,i);case"UserInterfaceBox":return Ms.create(t,o,i);case"UploadFileBox":return kp.create(t,o,i);case"TimelineBox":return Cs.create(t,o,i);case"TrackBox":return rr.create(t,o,i);case"NoteEventBox":return vn.create(t,o,i);case"NoteEventRepeatBox":return Ip.create(t,o,i);case"NoteEventCollectionBox":return ko.create(t,o,i);case"NoteRegionBox":return Ds.create(t,o,i);case"NoteClipBox":return rl.create(t,o,i);case"ValueEventBox":return yn.create(t,o,i);case"ValueEventCollectionBox":return Io.create(t,o,i);case"ValueEventCurveBox":return xn.create(t,o,i);case"ValueRegionBox":return Rs.create(t,o,i);case"ValueClipBox":return il.create(t,o,i);case"AudioRegionBox":return wn.create(t,o,i);case"AudioClipBox":return ol.create(t,o,i);case"MarkerBox":return nl.create(t,o,i);case"AudioFileBox":return Sr.create(t,o,i);case"SoundfontFileBox":return Lr.create(t,o,i);case"AudioUnitBox":return Xe.create(t,o,i);case"CaptureAudioBox":return bn.create(t,o,i);case"CaptureMidiBox":return An.create(t,o,i);case"AudioBusBox":return Pi.create(t,o,i);case"AuxSendBox":return Os.create(t,o,i);case"GrooveShuffleBox":return sl.create(t,o,i);case"UnknownAudioEffectDeviceBox":return Tp.create(t,o,i);case"UnknownMidiEffectDeviceBox":return Mp.create(t,o,i);case"DeviceInterfaceKnobBox":return Cp.create(t,o,i);case"ModularDeviceBox":return Dp.create(t,o,i);case"StereoToolDeviceBox":return Rp.create(t,o,i);case"CompressorDeviceBox":return al.create(t,o,i);case"DelayDeviceBox":return Op.create(t,o,i);case"CrusherDeviceBox":return Vp.create(t,o,i);case"VelocityDeviceBox":return zp.create(t,o,i);case"FoldDeviceBox":return Up.create(t,o,i);case"TidalDeviceBox":return jp.create(t,o,i);case"RevampDeviceBox":return Lp.create(t,o,i);case"ReverbDeviceBox":return Kp.create(t,o,i);case"VaporisateurDeviceBox":return ll.create(t,o,i);case"MIDIOutputDeviceBox":return cl.create(t,o,i);case"MIDIOutputBox":return Ei.create(t,o,i);case"MIDIOutputParameterBox":return Si.create(t,o,i);case"SoundfontDeviceBox":return ul.create(t,o,i);case"NanoDeviceBox":return dl.create(t,o,i);case"PlayfieldDeviceBox":return hl.create(t,o,i);case"PlayfieldSampleBox":return _n.create(t,o,i);case"TapeDeviceBox":return pl.create(t,o,i);case"ArpeggioDeviceBox":return Wp.create(t,o,i);case"PitchDeviceBox":return Zp.create(t,o,i);case"ZeitgeistDeviceBox":return Gp.create(t,o,i);case"ModularBox":return qp.create(t,o,i);case"ModuleConnectionBox":return Hp.create(t,o,i);case"ModularAudioInputBox":return Jp.create(t,o,i);case"ModularAudioOutputBox":return Qp.create(t,o,i);case"ModuleDelayBox":return Yp.create(t,o,i);case"ModuleMultiplierBox":return Xp.create(t,o,i);case"ModuleGainBox":return ef.create(t,o,i);default:return P(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let o=new Ze(t),i=o.readString(),n=b.fromDataInput(o),s=r.create(i,e,n);return s.read(o),s}})(Ts||(Ts={}));var tf=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:N.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},0),2:E.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},8),3:E.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},1.5),4:T.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:N.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},0)}}};var tl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:p}),o)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return A(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 editingChannel(){return this.getField(111)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},u.Timeline,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[u.User],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},u.Groove,!0),10:Z.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[u.AudioUnits],mandatory:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[u.AudioBusses],mandatory:!1}}),30:Z.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!0}}),35:Z.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!1}}),40:tf.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),111:k.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},u.Editing,!1)}}};var qi=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:p}),o)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return A(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},u.Selection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},u.Selection,!0)}}};var Ms=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:p}),o)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return A(e.visitUserInterfaceBox,this)}get root(){return this.getField(1)}get selection(){return this.getField(10)}get uploadStates(){return this.getField(11)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},u.User,!0),10:Z.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[u.Selection],mandatory:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[u.FileUploadState],mandatory:!1}}),21:k.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},u.Editing,!1),22:k.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},u.Editing,!1),23:k.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},u.Editing,!1)}}};var kp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:p}),o)}static ClassName="UploadFileBox";constructor(e){super(e)}accept(e){return A(e.visitUploadFileBox,this)}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},u.FileUploadState,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},u.FileUploadState,!0)}}};var rf=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:N.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},4),2:N.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},4)}}};var of=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:T.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:N.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},0),3:N.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},15360)}}};var nf=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:Z.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p}),20:T.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Cs=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:p}),o)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return A(e.visitTimelineBox,this)}get root(){return this.getField(1)}get signature(){return this.getField(10)}get loopArea(){return this.getField(11)}get deprecatedMarkerTrack(){return this.getField(20)}get markerTrack(){return this.getField(21)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[u.Timeline],mandatory:!0}}),10:rf.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:of.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:Z.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),21:nf.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),30:N.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},491520),31:E.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},120)}}};var rr=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[u.Selection,u.PianoMode],mandatory:!1}}),o)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},u.TrackCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},u.Automation,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[u.RegionCollection],mandatory:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[u.ClipCollection],mandatory:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p}),20:T.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:T.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};var vn=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[u.Selection,u.NoteEventFeature],mandatory:!1}}),o)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},u.NoteEvents,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},240),20:N.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},60),21:E.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},.7874015748031497),22:N.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},1),23:E.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},0),24:E.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},0),25:N.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},100)}}};var Ip=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:p}),o)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},u.NoteEventFeature,!0),2:N.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},1),3:E.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},0),4:E.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},1)}}};var ko=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return A(e.visitNoteEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.NoteEvents],mandatory:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.NoteEventCollection],mandatory:!0}})}}};var Ds=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[u.Selection,u.Editing],mandatory:!1}}),o)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},u.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},u.NoteEventCollection,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p}),12:N.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p}),14:N.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p}),15:T.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:N.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p})}}};var Pn=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:T.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:T.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p}),6:N.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p})}}};var rl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[u.Selection,u.Editing],mandatory:!1}}),o)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return A(e.visitNoteClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get playback(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},u.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},u.NoteEventCollection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p}),4:Pn.create({parent:this,fieldKey:4,fieldName:"playback",deprecated:!1,pointerRules:p}),10:N.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p}),11:T.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p})}}};var yn=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},u.ValueEvents,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p}),12:N.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[u.ValueInterpolation],mandatory:!1}},1),13:E.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p}),14:E.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!1,pointerRules:p})}}};var Io=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return A(e.visitValueEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.ValueEvents],mandatory:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.ValueEventCollection],mandatory:!0}})}}};var xn=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:p}),o)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return A(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},u.ValueInterpolation,!0),2:E.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},.5)}}};var Rs=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[u.Selection,u.Editing],mandatory:!1}}),o)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},u.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},u.ValueEventCollection,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p}),12:N.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p}),14:T.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:N.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p})}}};var il=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[u.Selection,u.Editing],mandatory:!1}}),o)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return A(e.visitValueClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get playback(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},u.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},u.ValueEventCollection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p}),4:Pn.create({parent:this,fieldKey:4,fieldName:"playback",deprecated:!1,pointerRules:p}),10:N.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p}),11:T.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p})}}};var wn=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[u.Selection,u.Editing],mandatory:!1}}),o)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return A(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 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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},u.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},u.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!1,pointerRules:p},"pitch"),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p}),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p}),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p}),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p}),14:T.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:N.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p}),17:E.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p})}}};var ol=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[u.Selection,u.Editing],mandatory:!1}}),o)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return A(e.visitAudioClipBox,this)}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get playback(){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)}get gain(){return this.getField(14)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},u.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},u.AudioFile,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p}),4:Pn.create({parent:this,fieldKey:4,fieldName:"playback",deprecated:!1,pointerRules:p}),10:N.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p}),11:T.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p}),14:E.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p})}}};var nl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},u.MarkerTrack,!0),2:N.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p}),3:N.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p})}}};var Sr=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[u.AudioFile,u.FileUploadState],mandatory:!0}}),o)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return A(e.visitAudioFileBox,this)}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p}),2:E.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};var Lr=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[u.SoundfontFile],mandatory:!0}}),o)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return A(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};var Xe=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[u.Selection,u.Automation],mandatory:!1}}),o)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return A(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:p},"instrument"),2:k.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},u.AudioUnits,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:N.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p}),12:E.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),13:E.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),14:T.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),15:T.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[u.TrackCollection],mandatory:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MidiEffectHost],mandatory:!1}}),22:Z.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.InstrumentHost,u.AudioOutput],mandatory:!1}}),23:Z.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),24:Z.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[u.AuxSend],mandatory:!1}}),25:k.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},u.AudioOutput,!1),26:k.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},u.Capture,!1)}}};var bn=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),o)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return A(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:p}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:N.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},1),11:E.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},0)}}};var An=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),o)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return A(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:p}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:N.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},-1)}}};var Pi=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:p}),o)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},u.AudioBusses,!0),2:k.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},u.AudioOutput,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!1}}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:T.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var Os=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:p}),o)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},u.AuxSend,!0),2:k.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},u.AudioOutput,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},1),5:E.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),6:E.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var sl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[u.Groove],mandatory:!0}}),o)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return A(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:p}),10:E.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.6),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},480)}}};var Tp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Mp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.MidiEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Cp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p}),o)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},u.DeviceUserInterface,!0),2:k.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},u.ParameterController,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p}),10:E.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p}),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};var sf=class r extends Ve{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[u.DeviceUserInterface],mandatory:!1}})}}};var Dp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},u.ModularSetup,!0),11:sf.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var Rp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:E.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),13:T.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),14:T.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),15:T.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),20:N.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},1)}}};var al=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return A(e.visitCompressorDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get automakeup(){return this.getField(11)}get autoattack(){return this.getField(12)}get autorelease(){return this.getField(13)}get inputgain(){return this.getField(14)}get threshold(){return this.getField(15)}get ratio(){return this.getField(16)}get knee(){return this.getField(17)}get attack(){return this.getField(18)}get release(){return this.getField(19)}get makeup(){return this.getField(20)}get mix(){return this.getField(21)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),11:T.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!0),12:T.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),13:T.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),14:E.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),15:E.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},-10),16:E.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},2),17:E.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),18:E.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),19:E.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},5),20:E.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),21:E.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1)}}};var Op=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},4),11:E.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.5),12:E.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),13:E.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),14:E.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},-6),15:E.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0)}}};var Vp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),11:N.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},16),12:E.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),13:E.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1)}}};var zp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="VelocityDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.MidiEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.5),11:E.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:N.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:p},2048),13:E.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),14:E.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),15:E.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1)}}};var Up=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),11:N.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},0),12:E.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0)}}};var jp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="TidalDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},-.25),11:E.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.5),20:E.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},3),21:E.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),22:E.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),23:E.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0)}}};var _u=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:T.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:N.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:E.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var Pu=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:T.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var fl=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:T.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:E.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var Lp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_u.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Pu.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:fl.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:fl.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:fl.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Pu.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:_u.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:E.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var Kp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.5),11:E.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),12:E.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.5),13:E.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),14:E.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},-3),15:E.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0)}}};var af=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:N.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),2:E.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},-1/0),3:N.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),4:E.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var lf=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:N.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),2:E.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),3:T.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),10:E.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:E.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var cf=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:E.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.001),2:E.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.001),3:E.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.001),4:E.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.001)}}};var ll=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},-6),11:N.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:E.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),13:N.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),14:E.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),15:E.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),16:E.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),17:E.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),18:E.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),19:E.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.001),20:E.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),21:E.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),22:N.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),23:N.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),24:E.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},30),25:E.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),26:N.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),27:E.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),30:lf.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:Ap.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>af.create(e),2),50:cf.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:N.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p})}}};var uf=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:C.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var cl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="MIDIOutputDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:uf.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!1,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p}),12:N.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!1,pointerRules:p},10),13:Z.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[u.Parameter],mandatory:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},u.MIDIDevice,!1)}}};var Ei=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:p}),o)}static ClassName="MIDIOutputBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},u.MIDIDevice,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},10),6:T.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var Si=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:p}),o)}static ClassName="MIDIOutputParameterBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},u.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:N.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},64),4:E.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!0}})}}};var ul=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},u.SoundfontFile,!1),11:N.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p})}}};var dl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},-3),15:k.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},u.AudioFile,!1),20:E.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.1)}}};var hl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[u.Sample],mandatory:!1}})}}};var _n=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[u.Editing],mandatory:!1}}),o)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},u.Sample,!0),11:k.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},u.AudioFile,!0),12:Z.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MidiEffectHost],mandatory:!1}}),13:Z.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),15:N.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:p}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:T.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:T.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:T.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:p}),41:T.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:p}),42:T.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:p}),43:T.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:p}),44:N.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:p},0),45:E.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),46:E.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},0),47:E.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),48:E.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.001),49:E.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},.02)}}};var pl=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.Automation],mandatory:!1}}),o)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:E.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:E.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),13:E.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var Wp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.MidiEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:N.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),12:N.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},9),13:E.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),14:N.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},1),15:E.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var Zp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.MidiEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),12:N.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}})}}};var Gp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[u.Device,u.Selection],mandatory:!1}}),o)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},u.MidiEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p}),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},u.Groove,!0)}}};var qp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:p}),o)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return A(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},u.ModularSetup,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!0}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[u.ModuleCollection],mandatory:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[u.ConnectionCollection],mandatory:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:p})}}};var Hp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:p}),o)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return A(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},u.ConnectionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},u.VoltageConnection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},u.VoltageConnection,!0)}}};var Kr=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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},u.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:N.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p}),5:T.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:T.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var Jp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return A(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:Kr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var Qp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return A(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:Kr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var Yp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return A(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:Kr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}},500)}}};var Xp=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return A(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:Kr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p})}}};var ef=class r extends M{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),o)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return A(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:Kr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}})}}};var Hi;(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(u.ValueInterpolation).at(0)?.box;R(o)?(_y(o,xn),o.slope.setValue(t.slope)):xn.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 R(t)?(_y(t,xn),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?pn.None:e.getValue()===1?pn.Linear:P("Unknown Interpolation value")}})(Hi||(Hi={}));var En=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)},Eu,ml,st,Su,Sn,Nu,To=class r{constructor(e,t){this.type="value-event",Eu.set(this,new j),ml.set(this,void 0),st.set(this,void 0),Su.set(this,void 0),Sn.set(this,void 0),Nu.set(this,!1),En(this,ml,e,"f"),En(this,st,t,"f"),En(this,Su,Ce(this,Eu,"f").own(new Qh(()=>Hi.read(Ce(this,st,"f").interpolation))),"f");let o=()=>{Ce(this,Su,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Ce(this,Eu,"f").ownAll(Ce(this,st,"f").subscribe(Be.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.collection.unwrap(),s=i.address.fieldKeys,a=I.equals(Ce(this,st,"f").index.address.fieldKeys,s),l=I.equals(Ce(this,st,"f").position.address.fieldKeys,s);a||l?n.requestSorting():n.onEventPropertyChanged()}}),Ce(this,st,"f").interpolation.subscribe(o),Ce(this,st,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Ce(this,Sn,"f").terminate(),En(this,Sn,i.subscribe(Be.Children,o),"f"),o()},onRemoved:()=>{Ce(this,Sn,"f").terminate(),En(this,Sn,W.Empty,"f"),o()}})),En(this,Sn,Ce(this,st,"f").interpolation.pointerHub.filter(u.ValueInterpolation).at(0)?.box.subscribe(Be.Children,o)??W.Empty,"f")}onSelected(){En(this,Nu,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){En(this,Nu,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Ce(this,Sn,"f").terminate(),Ce(this,Eu,"f").terminate()}get box(){return Ce(this,st,"f")}get uuid(){return Ce(this,st,"f").address.uuid}get address(){return Ce(this,st,"f").address}get position(){return Ce(this,st,"f").position.getValue()}get index(){return Ce(this,st,"f").index.getValue()}set interpolation(e){Hi.write(Ce(this,st,"f").interpolation,e)}get interpolation(){return Ce(this,Su,"f").get()}get value(){return Ce(this,st,"f").value.getValue()}get isSelected(){return Ce(this,Nu,"f")}get collection(){return Ce(this,st,"f").events.targetVertex.map(e=>Ce(this,ml,"f").boxAdapters.adapterFor(e.box,Wr))}copyTo(e){let t=yn.create(Ce(this,ml,"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 Hi.write(t.interpolation,e?.interpolation??this.interpolation),Ce(this,ml,"f").boxAdapters.adapterFor(t,r)}copyFrom(e){return Ce(this,st,"f").position.setValue(e?.position??this.position),Ce(this,st,"f").index.setValue(e?.index??this.index),Ce(this,st,"f").events.refer(e?.events??this.collection.unwrap().box.events),Ce(this,st,"f").value.setValue(e?.value??this.value),Hi.write(Ce(this,st,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Eu=new WeakMap,ml=new WeakMap,st=new WeakMap,Su=new WeakMap,Sn=new WeakMap,Nu=new WeakMap;To.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 Fu=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)},Bu,$u,Nn,Zr,Vs,ku,Mo,df,Wr=class r{constructor(e,t){Bu.add(this),$u.set(this,new j),Nn.set(this,void 0),Zr.set(this,void 0),Vs.set(this,void 0),ku.set(this,void 0),Mo.set(this,void 0),Fu(this,Nn,e,"f"),Fu(this,Zr,t,"f"),Fu(this,Vs,new te,"f"),Fu(this,ku,b.newSet(i=>i.uuid),"f"),Fu(this,Mo,dn.create(To.Comparator),"f");let o=i=>{let n=G(i.accept({visitValueEventBox:s=>De(this,Nn,"f").boxAdapters.adapterFor(s,To)}),`Could not find adapter for ${i}`);De(this,ku,"f").add(n)&&(De(this,Mo,"f").add(n),De(this,Bu,"m",df).call(this))};De(this,Zr,"f").events.pointerHub.incoming().forEach(({box:i})=>o(i)),De(this,$u,"f").own(De(this,Zr,"f").events.pointerHub.subscribe({onAdded:({box:i})=>o(i),onRemoved:({box:{address:{uuid:i}}})=>{De(this,Mo,"f").remove(De(this,ku,"f").removeByKey(i)),De(this,Bu,"m",df).call(this)}})),De(this,$u,"f").own(De(this,Zr,"f").owners.pointerHub.subscribe({onAdded:()=>De(this,Vs,"f").notify(this),onRemoved:()=>De(this,Vs,"f").notify(this)}))}valueAt(e,t){return xp.valueAt(De(this,Mo,"f"),e,t)}copy(){let e=De(this,Nn,"f").boxGraph,t=Io.create(e,b.generate());return De(this,Mo,"f").asArray().forEach(o=>o.copyTo({events:t.events})),De(this,Nn,"f").boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),o=this.events.greaterEqual(e);if(o===null)return t===null?m.None:m.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t===null)return m.wrap(this.createEvent({position:e,value:o.value,index:o.index,interpolation:o.interpolation}));if(t.position===e)return m.wrap(t);if(t.interpolation.type==="none")return m.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t.interpolation.type==="linear"){let{position:i,value:n}=t,{position:s,value:a}=o;return m.wrap(this.createEvent({position:e,value:Xh(n,a,(e-i)/(s-i)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:i,value:n}=t,{position:s,value:a}=o,l=s-i,c=e-i,d=Ur.byHalf(l,n,Ur.valueAt({slope:t.interpolation.slope,steps:l,y0:n,y1:a},l*.5),a),h=Ur.valueAt(d,c),f=Ur.slopeByHalf(n,Ur.valueAt(d,c*.5),h);return Hi.write(t.box.interpolation,pn.Curve(f)),m.wrap(this.createEvent({position:e,value:h,index:0,interpolation:pn.Curve(Ur.slopeByHalf(h,Ur.valueAt(d,(c+l)*.5),a))}))}return P("Unknown interpolation type")}subscribeChange(e){return De(this,Vs,"f").subscribe(e)}createEvent({position:e,index:t,value:o,interpolation:i}){let n=yn.create(De(this,Nn,"f").boxGraph,b.generate(),s=>{s.position.setValue(e),s.index.setValue(t),s.value.setValue(o),s.events.refer(De(this,Zr,"f").events)});return Hi.write(n.interpolation,i),De(this,Nn,"f").boxAdapters.adapterFor(n,To)}requestSorting(){De(this,Mo,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){De(this,Bu,"m",df).call(this)}terminate(){De(this,$u,"f").terminate()}get box(){return De(this,Zr,"f")}get uuid(){return De(this,Zr,"f").address.uuid}get address(){return De(this,Zr,"f").address}get numOwners(){return De(this,Zr,"f").owners.pointerHub.filter(u.ValueEventCollection).length}get events(){return De(this,Mo,"f")}toString(){return`{ValueEventCollectionBox ${b.toString(De(this,Zr,"f").address.uuid)}}`}};$u=new WeakMap,Nn=new WeakMap,Zr=new WeakMap,Vs=new WeakMap,ku=new WeakMap,Mo=new WeakMap,Bu=new WeakSet,df=function(){De(this,Vs,"f").notify(this)};var zs=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},ye=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)},Us,Fn,js,xt,Ls,Mu,Iu,Tu,gl,Bn=class{constructor(e,t){Us.add(this),this.type="value-clip",Fn.set(this,new j),js.set(this,void 0),xt.set(this,void 0),Ls.set(this,void 0),Mu.set(this,void 0),Iu.set(this,void 0),Tu.set(this,W.Empty),zs(this,js,e,"f"),zs(this,xt,t,"f"),zs(this,Iu,!0,"f"),zs(this,Ls,ye(this,Fn,"f").own(new Yt(!1)),"f"),zs(this,Mu,ye(this,Fn,"f").own(new te),"f"),ye(this,Fn,"f").own(ye(this,xt,"f").pointerHub.subscribe({onAdded:()=>ye(this,Us,"m",gl).call(this),onRemoved:()=>ye(this,Us,"m",gl).call(this)})),ye(this,Fn,"f").own(ye(this,xt,"f").subscribe(Be.Children,o=>ye(this,Us,"m",gl).call(this))),ye(this,Fn,"f").own(ye(this,xt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{ye(this,Tu,"f").terminate(),zs(this,Tu,o.match({none:()=>W.Empty,some:({box:i})=>ye(this,js,"f").boxAdapters.adapterFor(i,Wr).subscribeChange(()=>ye(this,Us,"m",gl).call(this))}),"f"),ye(this,Us,"m",gl).call(this)})),zs(this,Iu,!1,"f")}valueAt(e,t){let o=this.optCollection;return o.isEmpty()?t:o.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return ye(this,Ls,"f").catchupAndSubscribe(e)}subscribeChange(e){return ye(this,Mu,"f").subscribe(e)}accept(e){return A(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&ye(this,xt,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:ye(this,xt,"f").events.targetVertex.unwrap();il.create(ye(this,js,"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(ye(this,xt,"f").clips.targetVertex.unwrap()),o.events.refer(t)})}onSelected(){ye(this,Ls,"f").setValue(!0)}onDeselected(){ye(this,Ls,"f").setValue(!1)}get isSelected(){return ye(this,Ls,"f").getValue()}terminate(){ye(this,Tu,"f").terminate(),ye(this,Fn,"f").terminate()}get box(){return ye(this,xt,"f")}get uuid(){return ye(this,xt,"f").address.uuid}get address(){return ye(this,xt,"f").address}get indexField(){return ye(this,xt,"f").index}get duration(){return ye(this,xt,"f").duration.getValue()}get mute(){return ye(this,xt,"f").mute.getValue()}get hue(){return ye(this,xt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return ye(this,xt,"f").events.targetVertex.map(e=>ye(this,js,"f").boxAdapters.adapterFor(e.box,Wr))}get label(){return ye(this,xt,"f").label.getValue()}get trackBoxAdapter(){return ye(this,Iu,"f")?m.None:ye(this,xt,"f").clips.targetVertex.map(e=>ye(this,js,"f").boxAdapters.adapterFor(e.box,ut))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${b.toString(ye(this,xt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Fn=new WeakMap,js=new WeakMap,xt=new WeakMap,Ls=new WeakMap,Mu=new WeakMap,Iu=new WeakMap,Tu=new WeakMap,Us=new WeakSet,gl=function(){ye(this,Mu,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var z_=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},Ks=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)},hf,Co,Ji=class{constructor(e,t){hf.set(this,void 0),Co.set(this,void 0),z_(this,hf,e,"f"),z_(this,Co,t,"f")}get box(){return Ks(this,Co,"f")}get uuid(){return Ks(this,Co,"f").address.uuid}get address(){return Ks(this,Co,"f").address}get startInSeconds(){return Ks(this,Co,"f").startInSeconds.getValue()}get endInSeconds(){return Ks(this,Co,"f").endInSeconds.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}getOrCreateLoader(){return Ks(this,hf,"f").sampleManager.getOrCreate(Ks(this,Co,"f").address.uuid)}terminate(){}};hf=new WeakMap,Co=new WeakMap;var Do=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)},vl,yl,xl,Pt,Ws,Ou,Cu,Du,wl,Ru,$n=class{constructor(e,t){vl.add(this),this.type="audio-clip",yl.set(this,new j),xl.set(this,void 0),Pt.set(this,void 0),Ws.set(this,void 0),Ou.set(this,void 0),Cu.set(this,void 0),Du.set(this,m.None),wl.set(this,m.None),Do(this,xl,e,"f"),Do(this,Pt,t,"f"),Do(this,Cu,!0,"f"),Do(this,Ws,Se(this,yl,"f").own(new Yt(!1)),"f"),Do(this,Ou,Se(this,yl,"f").own(new te),"f"),Se(this,yl,"f").ownAll(Se(this,Pt,"f").pointerHub.subscribe({onAdded:()=>Se(this,vl,"m",Ru).call(this),onRemoved:()=>Se(this,vl,"m",Ru).call(this)}),Se(this,Pt,"f").file.catchupAndSubscribe(o=>{Do(this,Du,o.targetVertex.map(i=>Se(this,xl,"f").boxAdapters.adapterFor(i.box,Ji)),"f"),Se(this,wl,"f").ifSome(i=>i.terminate()),Do(this,wl,Se(this,Du,"f").map(i=>i.getOrCreateLoader().subscribe(()=>Se(this,vl,"m",Ru).call(this))),"f")}),Se(this,Pt,"f").subscribe(Be.Children,o=>Se(this,vl,"m",Ru).call(this)),{terminate:()=>{Se(this,wl,"f").ifSome(o=>o.terminate()),Do(this,wl,m.None,"f")}}),Do(this,Cu,!1,"f")}catchupAndSubscribeSelected(e){return Se(this,Ws,"f").catchupAndSubscribe(e)}subscribeChange(e){return Se(this,Ou,"f").subscribe(e)}accept(e){return A(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){ol.create(Se(this,xl,"f").boxGraph,b.generate(),t=>{t.index.setValue(this.indexField.getValue()),t.gain.setValue(this.gain),t.label.setValue(this.label),t.hue.setValue(this.hue),t.duration.setValue(this.duration),t.mute.setValue(this.mute),t.clips.refer(Se(this,Pt,"f").clips.targetVertex.unwrap()),t.file.refer(Se(this,Pt,"f").file.targetVertex.unwrap())})}onSelected(){Se(this,Ws,"f").setValue(!0)}onDeselected(){Se(this,Ws,"f").setValue(!1)}get isSelected(){return Se(this,Ws,"f").getValue()}terminate(){Se(this,yl,"f").terminate()}get box(){return Se(this,Pt,"f")}get uuid(){return Se(this,Pt,"f").address.uuid}get address(){return Se(this,Pt,"f").address}get indexField(){return Se(this,Pt,"f").index}get duration(){return Se(this,Pt,"f").duration.getValue()}get mute(){return Se(this,Pt,"f").mute.getValue()}get hue(){return Se(this,Pt,"f").hue.getValue()}get gain(){return Se(this,Pt,"f").gain.getValue()}get file(){return Se(this,Du,"f").unwrap("Cannot access file.")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get label(){return Se(this,Pt,"f").label.getValue()}get trackBoxAdapter(){return Se(this,Cu,"f")?m.None:Se(this,Pt,"f").clips.targetVertex.map(e=>Se(this,xl,"f").boxAdapters.adapterFor(e.box,ut))}get isMirrowed(){return!1}get canMirror(){return!1}toString(){return`{AudioClipBoxAdapter ${b.toString(Se(this,Pt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};yl=new WeakMap,xl=new WeakMap,Pt=new WeakMap,Ws=new WeakMap,Ou=new WeakMap,Cu=new WeakMap,Du=new WeakMap,wl=new WeakMap,vl=new WeakSet,Ru=function(){Se(this,Ou,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Vu=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)},bl,Et,pf,zu,Zs=class r{constructor(e,t){this.type="note-event",bl.set(this,void 0),Et.set(this,void 0),pf.set(this,void 0),zu.set(this,!1),Vu(this,bl,e,"f"),Vu(this,Et,t,"f"),Vu(this,pf,ht(this,Et,"f").subscribe(Be.Children,o=>{if(!this.collection.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.collection.unwrap(),n=o.address.fieldKeys,s=I.equals(ht(this,Et,"f").pitch.address.fieldKeys,n),a=I.equals(ht(this,Et,"f").position.address.fieldKeys,n);s||a?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Vu(this,zu,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Vu(this,zu,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){ht(this,pf,"f").terminate()}get box(){return ht(this,Et,"f")}get uuid(){return ht(this,Et,"f").address.uuid}get address(){return ht(this,Et,"f").address}get position(){return ht(this,Et,"f").position.getValue()}get duration(){return ht(this,Et,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return ht(this,Et,"f").velocity.getValue()}get pitch(){return ht(this,Et,"f").pitch.getValue()}get cent(){return ht(this,Et,"f").cent.getValue()}get chance(){return ht(this,Et,"f").chance.getValue()}get playCount(){return ht(this,Et,"f").playCount.getValue()}get playCurve(){return ht(this,Et,"f").playCurve.getValue()}get isSelected(){return ht(this,zu,"f")}get collection(){return ht(this,Et,"f").events.targetVertex.map(e=>ht(this,bl,"f").boxAdapters.adapterFor(e.box,Gr))}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 ht(this,bl,"f").boxAdapters.adapterFor(vn.create(ht(this,bl,"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=I.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 ht(this,Et,"f").delete(),o}};bl=new WeakMap,Et=new WeakMap,pf=new WeakMap,zu=new WeakMap;var Qi=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)},Ro,Uu,kn,qr,Gs,ju,Hr,mf,gf,vf,In,ff,Lu,Gr=class r{constructor(e,t){Ro.add(this),Uu.set(this,new j),kn.set(this,void 0),qr.set(this,void 0),Gs.set(this,void 0),ju.set(this,void 0),Hr.set(this,void 0),mf.set(this,60),gf.set(this,60),vf.set(this,0),In.set(this,!1),Qi(this,kn,e,"f"),Qi(this,qr,t,"f"),Qi(this,Gs,new te,"f"),Qi(this,ju,b.newSet(i=>i.uuid),"f"),Qi(this,Hr,dn.create(er.Comparator),"f");let o=i=>{let n=G(i.accept({visitNoteEventBox:s=>ce(this,kn,"f").boxAdapters.adapterFor(s,Zs)}),`Could not find adapter for ${i}`);ce(this,ju,"f").add(n)&&(ce(this,Hr,"f").add(n),ce(this,Ro,"m",ff).call(this))};ce(this,qr,"f").events.pointerHub.incoming().forEach(({box:i})=>o(i)),ce(this,Uu,"f").own(ce(this,qr,"f").events.pointerHub.subscribe({onAdded:({box:i})=>o(i),onRemoved:({box:{address:{uuid:i}}})=>{ce(this,Hr,"f").remove(ce(this,ju,"f").removeByKey(i)),ce(this,Ro,"m",ff).call(this)}})),ce(this,Uu,"f").own(ce(this,qr,"f").owners.pointerHub.subscribe({onAdded:()=>ce(this,Gs,"f").notify(this),onRemoved:()=>ce(this,Gs,"f").notify(this)}))}copy(){let e=ce(this,kn,"f").boxGraph,t=ko.create(e,b.generate());return ce(this,Hr,"f").asArray().forEach(o=>o.copyTo({events:t.events})),ce(this,kn,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:o,pitch:i,chance:n,playCount:s,cent:a}){return ce(this,kn,"f").boxAdapters.adapterFor(vn.create(ce(this,kn,"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(ce(this,qr,"f").events)}),Zs)}subscribeChange(e){return ce(this,Gs,"f").subscribe(e)}selectable(){return ce(this,Hr,"f").asArray()}selectableAt(e){for(let t of ce(this,Hr,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return He.one(t);return He.empty()}selectablesBetween(e,t){let o=[];for(let i of ce(this,Hr,"f").asArray())cu.intersect1D(i.position,i.complete,e.u,t.u)&&cu.intersect1D(i.pitch,i.pitch,e.v,t.v)&&o.push(i);return o}requestSorting(){ce(this,Hr,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){ce(this,Ro,"m",ff).call(this)}terminate(){ce(this,Uu,"f").terminate()}get box(){return ce(this,qr,"f")}get uuid(){return ce(this,qr,"f").address.uuid}get address(){return ce(this,qr,"f").address}get numOwners(){return ce(this,qr,"f").owners.pointerHub.filter(u.NoteEventCollection).length}get events(){return ce(this,In,"f")||ce(this,Ro,"m",Lu).call(this),ce(this,Hr,"f")}get minPitch(){return ce(this,In,"f")||ce(this,Ro,"m",Lu).call(this),ce(this,mf,"f")}get maxPitch(){return ce(this,In,"f")||ce(this,Ro,"m",Lu).call(this),ce(this,gf,"f")}get maxDuration(){return ce(this,In,"f")||ce(this,Ro,"m",Lu).call(this),ce(this,vf,"f")}toString(){return`{NoteEventCollectionBox ${b.toString(ce(this,qr,"f").address.uuid)}}`}};Uu=new WeakMap,kn=new WeakMap,qr=new WeakMap,Gs=new WeakMap,ju=new WeakMap,Hr=new WeakMap,mf=new WeakMap,gf=new WeakMap,vf=new WeakMap,In=new WeakMap,Ro=new WeakSet,ff=function(){Qi(this,In,!1,"f"),ce(this,Gs,"f").notify(this)},Lu=function(){let e=127,t=0,o=0;ce(this,Hr,"f").asArray().forEach(({pitch:i,duration:n})=>{e=Math.min(e,i),t=Math.max(t,i),o=Math.max(o,n)}),Qi(this,mf,e,"f"),Qi(this,gf,t,"f"),Qi(this,vf,o,"f"),Qi(this,In,!0,"f")};var qs=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)},Hs,Al,Js,wt,Qs,Zu,Ku,Wu,_l,Pl=class{constructor(e,t){Hs.add(this),this.type="note-clip",Al.set(this,new j),Js.set(this,void 0),wt.set(this,void 0),Qs.set(this,void 0),Zu.set(this,void 0),Ku.set(this,void 0),Wu.set(this,W.Empty),qs(this,Js,e,"f"),qs(this,wt,t,"f"),qs(this,Ku,!0,"f"),qs(this,Qs,Ae(this,Al,"f").own(new Yt(!1)),"f"),qs(this,Zu,Ae(this,Al,"f").own(new te),"f"),Ae(this,Al,"f").ownAll(Ae(this,wt,"f").pointerHub.subscribe({onAdded:()=>Ae(this,Hs,"m",_l).call(this),onRemoved:()=>Ae(this,Hs,"m",_l).call(this)}),Ae(this,wt,"f").subscribe(Be.Children,o=>Ae(this,Hs,"m",_l).call(this)),Ae(this,wt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Ae(this,Wu,"f").terminate(),qs(this,Wu,o.match({none:()=>W.Empty,some:({box:i})=>Ae(this,Js,"f").boxAdapters.adapterFor(i,Gr).subscribeChange(()=>Ae(this,Hs,"m",_l).call(this))}),"f"),Ae(this,Hs,"m",_l).call(this)})),qs(this,Ku,!1,"f")}catchupAndSubscribeSelected(e){return Ae(this,Qs,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ae(this,Zu,"f").subscribe(e)}accept(e){return A(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ae(this,wt,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ae(this,wt,"f").events.targetVertex.unwrap();rl.create(Ae(this,Js,"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(Ae(this,wt,"f").clips.targetVertex.unwrap()),o.events.refer(t)})}onSelected(){Ae(this,Qs,"f").setValue(!0)}onDeselected(){Ae(this,Qs,"f").setValue(!1)}get isSelected(){return Ae(this,Qs,"f").getValue()}terminate(){Ae(this,Wu,"f").terminate(),Ae(this,Al,"f").terminate()}get box(){return Ae(this,wt,"f")}get uuid(){return Ae(this,wt,"f").address.uuid}get address(){return Ae(this,wt,"f").address}get indexField(){return Ae(this,wt,"f").index}get duration(){return Ae(this,wt,"f").duration.getValue()}get mute(){return Ae(this,wt,"f").mute.getValue()}get hue(){return Ae(this,wt,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ae(this,wt,"f").events.targetVertex.map(e=>Ae(this,Js,"f").boxAdapters.adapterFor(e.box,Gr))}get label(){return Ae(this,wt,"f").label.getValue()}get trackBoxAdapter(){return Ae(this,Ku,"f")?m.None:Ae(this,wt,"f").clips.targetVertex.map(e=>Ae(this,Js,"f").boxAdapters.adapterFor(e.box,ut))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${b.toString(Ae(this,wt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Al=new WeakMap,Js=new WeakMap,wt=new WeakMap,Qs=new WeakMap,Zu=new WeakMap,Ku=new WeakMap,Wu=new WeakMap,Hs=new WeakSet,_l=function(){Ae(this,Zu,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var yf={for:(r,e)=>G(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Pl),visitValueClipBox:t=>r.adapterFor(t,Bn),visitAudioClipBox:t=>r.adapterFor(t,$n)}),"")};var xf=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},Tn=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)},wf,El,Gu,qu,bf=class{constructor(e,t){wf.set(this,void 0),El.set(this,void 0),Gu.set(this,void 0),qu.set(this,void 0),xf(this,wf,e,"f"),xf(this,El,new j,"f"),xf(this,Gu,Tn(this,El,"f").own(new te),"f"),xf(this,qu,Tn(this,El,"f").own(Ot.create(e.box.clips,o=>yf.for(t,o),u.ClipCollection)),"f"),Tn(this,qu,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return Tn(this,wf,"f")}get collection(){return Tn(this,qu,"f")}dispatchChange(){Tn(this,Gu,"f").notify()}subscribeChanges(e){return Tn(this,Gu,"f").subscribe(e)}terminate(){Tn(this,El,"f").terminate()}};wf=new WeakMap,El=new WeakMap,Gu=new WeakMap,qu=new WeakMap;var Vt=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},L=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)},Yi,Hu,Ys,xe,Mn,Cn,Dn,Ju,Rn,Sl,Nl,Fl,Qu,Oo,On=class r{constructor(e,t){Yi.add(this),this.type="audio-region",Hu.set(this,void 0),Ys.set(this,void 0),xe.set(this,void 0),Mn.set(this,void 0),Cn.set(this,void 0),Dn.set(this,void 0),Ju.set(this,void 0),Rn.set(this,m.None),Sl.set(this,W.Empty),Nl.set(this,W.Empty),Fl.set(this,void 0),Qu.set(this,void 0),Vt(this,Ys,e,"f"),Vt(this,xe,t,"f"),Vt(this,Hu,new j,"f");let{timeBase:o,position:i,duration:n,loopOffset:s,loopDuration:a}=t;Vt(this,Mn,Ya.aware(e.tempoMap,o,i,n),"f"),Vt(this,Cn,Ya.aware(e.tempoMap,o,i,s),"f"),Vt(this,Dn,Ya.aware(e.tempoMap,o,i,a),"f"),Vt(this,Ju,new te,"f"),Vt(this,Fl,!1,"f"),Vt(this,Qu,!0,"f"),L(this,Hu,"f").ownAll(L(this,xe,"f").pointerHub.subscribe({onAdded:()=>L(this,Yi,"m",Oo).call(this),onRemoved:()=>L(this,Yi,"m",Oo).call(this)}),L(this,xe,"f").file.catchupAndSubscribe(l=>{Vt(this,Rn,l.targetVertex.map(c=>L(this,Ys,"f").boxAdapters.adapterFor(c.box,Ji)),"f"),L(this,Sl,"f").terminate(),Vt(this,Sl,L(this,Rn,"f").mapOr(c=>c.getOrCreateLoader().subscribe(()=>L(this,Yi,"m",Oo).call(this)),W.Empty),"f")}),L(this,xe,"f").timeBase.catchupAndSubscribe(l=>{L(this,Nl,"f").terminate(),_o(l.getValue(),Dt)===Dt.Seconds&&Vt(this,Nl,e.tempoMap.subscribe(()=>L(this,Yi,"m",Oo).call(this)),"f")}),L(this,xe,"f").subscribe(Be.Children,l=>{if(!this.trackBoxAdapter.isEmpty()&&(l.type==="primitive"||l.type==="pointer")){let c=this.trackBoxAdapter.unwrap();L(this,xe,"f").position.address.equals(l.address)?(c.regions.onIndexingChanged(),L(this,Yi,"m",Oo).call(this)):L(this,Yi,"m",Oo).call(this)}}),{terminate:()=>{L(this,Sl,"f").terminate(),Vt(this,Sl,W.Empty,"f"),L(this,Nl,"f").terminate(),Vt(this,Nl,W.Empty,"f")}}),Vt(this,Qu,!1,"f")}subscribeChange(e){return L(this,Ju,"f").subscribe(e)}accept(e){return A(e.visitAudioRegionBoxAdapter,this)}onSelected(){Vt(this,Fl,!0,"f"),L(this,Yi,"m",Oo).call(this)}onDeselected(){Vt(this,Fl,!1,"f"),L(this,Yi,"m",Oo).call(this)}get isSelected(){return L(this,Fl,"f")}get box(){return L(this,xe,"f")}get uuid(){return L(this,xe,"f").address.uuid}get address(){return L(this,xe,"f").address}get position(){return L(this,xe,"f").position.getValue()}get duration(){return L(this,Mn,"f").toPPQN()}get complete(){return this.position+this.duration}get loopOffset(){return L(this,Cn,"f").toPPQN()}get loopDuration(){return L(this,Dn,"f").toPPQN()}get offset(){return this.position-this.loopOffset}get mute(){return L(this,xe,"f").mute.getValue()}get hue(){return L(this,xe,"f").hue.getValue()}get gain(){return L(this,xe,"f").gain.getValue()}get file(){return L(this,Rn,"f").unwrap("Cannot access file.")}get timeBase(){return _o(L(this,xe,"f").timeBase.getValue(),Dt)}get hasCollection(){return L(this,Rn,"f").nonEmpty()}get optCollection(){return m.None}get label(){if(L(this,Rn,"f").isEmpty())return"No Audio File";let e=L(this,Rn,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):L(this,xe,"f").label.getValue()}get isMirrowed(){return!1}get canMirror(){return!1}get trackBoxAdapter(){return L(this,xe,"f").regions.targetVertex.map(e=>L(this,Ys,"f").boxAdapters.adapterFor(e.box,ut))}set position(e){L(this,xe,"f").position.setValue(e)}set duration(e){L(this,Mn,"f").fromPPQN(e)}set loopOffset(e){L(this,Cn,"f").fromPPQN(e)}set loopDuration(e){L(this,Dn,"f").fromPPQN(e)}get playback(){return _o(L(this,xe,"f").playback.getValue(),Au)}setPlayback(e,t=!1){let o=this.timeBase===Dt.Musical;if(L(this,xe,"f").playback.setValue(e),e===Au.NoSync){if(o)if(t){let i=L(this,Mn,"f").toSeconds(),n=L(this,Dn,"f").toSeconds(),s=L(this,Cn,"f").toSeconds();L(this,xe,"f").timeBase.setValue(Dt.Seconds),L(this,xe,"f").duration.setValue(i),L(this,xe,"f").loopDuration.setValue(n),L(this,xe,"f").loopOffset.setValue(s)}else{let i=this.file.endInSeconds-this.file.startInSeconds,n=L(this,Dn,"f").toSeconds(),s=i/n,a=L(this,Mn,"f").toSeconds(),l=L(this,Cn,"f").toSeconds();L(this,xe,"f").timeBase.setValue(Dt.Seconds),L(this,xe,"f").duration.setValue(a*s),L(this,xe,"f").loopDuration.setValue(i),L(this,xe,"f").loopOffset.setValue(l*s)}}else if(!o){let i=L(this,Mn,"f").toPPQN(),n=L(this,Dn,"f").toPPQN(),s=L(this,Cn,"f").toPPQN();L(this,xe,"f").timeBase.setValue(Dt.Musical),L(this,xe,"f").duration.setValue(i),L(this,xe,"f").loopOffset.setValue(s),L(this,xe,"f").loopDuration.setValue(n)}}copyTo(e){return L(this,Ys,"f").boxAdapters.adapterFor(wn.create(L(this,Ys,"f").boxGraph,b.generate(),t=>{t.timeBase.setValue(L(this,xe,"f").timeBase.getValue()),t.position.setValue(e?.position??L(this,xe,"f").position.getValue()),t.duration.setValue(e?.duration??L(this,xe,"f").duration.getValue()),t.loopOffset.setValue(e?.loopOffset??L(this,xe,"f").loopOffset.getValue()),t.loopDuration.setValue(e?.loopDuration??L(this,xe,"f").loopDuration.getValue()),t.regions.refer(e?.track??L(this,xe,"f").regions.targetVertex.unwrap()),t.file.refer(L(this,xe,"f").file.targetVertex.unwrap()),t.mute.setValue(this.mute),t.hue.setValue(this.hue),t.label.setValue(this.label),t.gain.setValue(this.gain)}),r)}consolidate(){}canFlatten(e){return!1}flatten(e){return m.None}terminate(){L(this,Hu,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${b.toString(L(this,xe,"f").address.uuid)}}`}};Hu=new WeakMap,Ys=new WeakMap,xe=new WeakMap,Mn=new WeakMap,Cn=new WeakMap,Dn=new WeakMap,Ju=new WeakMap,Rn=new WeakMap,Sl=new WeakMap,Nl=new WeakMap,Fl=new WeakMap,Qu=new WeakMap,Yi=new WeakSet,Oo=function(){L(this,Qu,"f")||(L(this,Ju,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var Vo=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)},Xi,Af,eo,Je,ed,Yu,Bl,Xu,zo,Vn=class r{constructor(e,t){Xi.add(this),this.type="note-region",Af.set(this,new j),eo.set(this,void 0),Je.set(this,void 0),ed.set(this,void 0),Yu.set(this,void 0),Bl.set(this,void 0),Xu.set(this,W.Empty),Vo(this,eo,e,"f"),Vo(this,Je,t,"f"),Vo(this,ed,new te,"f"),Vo(this,Bl,!1,"f"),Vo(this,Yu,!0,"f"),ue(this,Af,"f").ownAll(ue(this,Je,"f").pointerHub.subscribe({onAdded:()=>ue(this,Xi,"m",zo).call(this),onRemoved:()=>ue(this,Xi,"m",zo).call(this)}),ue(this,Je,"f").subscribe(Be.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackBoxAdapter.unwrap();ue(this,Je,"f").position.address.equals(o.address)?(i.regions.onIndexingChanged(),ue(this,Xi,"m",zo).call(this)):ue(this,Xi,"m",zo).call(this)}}),ue(this,Je,"f").events.catchupAndSubscribe(({targetVertex:o})=>{ue(this,Xu,"f").terminate(),Vo(this,Xu,o.match({none:()=>W.Empty,some:({box:i})=>ue(this,eo,"f").boxAdapters.adapterFor(i,Gr).subscribeChange(()=>ue(this,Xi,"m",zo).call(this))}),"f"),ue(this,Xi,"m",zo).call(this)})),Vo(this,Yu,!1,"f")}set position(e){ue(this,Je,"f").position.setValue(e)}set duration(e){ue(this,Je,"f").duration.setValue(e)}set loopOffset(e){ue(this,Je,"f").loopOffset.setValue(e)}set loopDuration(e){ue(this,Je,"f").loopDuration.setValue(e)}subscribeChange(e){return ue(this,ed,"f").subscribe(e)}accept(e){return A(e.visitNoteRegionBoxAdapter,this)}onSelected(){Vo(this,Bl,!0,"f"),ue(this,Xi,"m",zo).call(this)}onDeselected(){Vo(this,Bl,!1,"f"),ue(this,Xi,"m",zo).call(this)}get isSelected(){return ue(this,Bl,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let o=t.unwrap(),i=cr.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(){ue(this,Xu,"f").terminate(),ue(this,Af,"f").terminate()}get box(){return ue(this,Je,"f")}get uuid(){return ue(this,Je,"f").address.uuid}get address(){return ue(this,Je,"f").address}get position(){return ue(this,Je,"f").position.getValue()}get duration(){return ue(this,Je,"f").duration.getValue()}get loopOffset(){return ue(this,Je,"f").loopOffset.getValue()}get loopDuration(){return ue(this,Je,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return ue(this,Je,"f").mute.getValue()}get hue(){return ue(this,Je,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return ue(this,Je,"f").events.targetVertex.map(e=>ue(this,eo,"f").boxAdapters.adapterFor(e.box,Gr))}get label(){return ue(this,Je,"f").label.getValue()}get trackBoxAdapter(){return ue(this,Yu,"f")?m.None:ue(this,Je,"f").regions.targetVertex.map(e=>ue(this,eo,"f").boxAdapters.adapterFor(e.box,ut))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),o=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return ue(this,eo,"f").boxAdapters.adapterFor(Ds.create(ue(this,eo,"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??ue(this,Je,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=ue(this,eo,"f").boxGraph,o=ko.create(t,b.generate());e.events.asArray().forEach(i=>i.copyTo({events:o.events})),ue(this,Je,"f").events.refer(o.owners)})}canFlatten(e){return e.length>0&&I.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=ue(this,eo,"f").boxGraph,o=e.toSorted(hn.Comparator),i=I.getFirst(o,"Internal error (no first)"),n=I.getLast(o,"Internal error (no last)"),s=i.position,a=n.position+n.duration,l=i.trackBoxAdapter.unwrap(),c=ko.create(t,b.generate()),d=Array.from(l.regions.collection.iterateRange(s,a));return d.filter(h=>h.isSelected).forEach(h=>{let f=h;for(let{resultStart:v,resultEnd:g,rawStart:y}of cr.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),_=Math.floor(g-y);for(let D of f.optCollection.unwrap().events.iterateRange(x,_))D.copyTo({position:D.position+y-i.position,events:c.events})}}),d.forEach(({box:h})=>h.delete()),m.wrap(Ds.create(t,b.generate(),h=>{h.position.setValue(s),h.duration.setValue(a-s),h.loopDuration.setValue(a-s),h.loopOffset.setValue(0),h.hue.setValue(this.hue),h.mute.setValue(this.mute),h.label.setValue(this.label),h.events.refer(c.owners),h.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${b.toString(ue(this,Je,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Af=new WeakMap,eo=new WeakMap,Je=new WeakMap,ed=new WeakMap,Yu=new WeakMap,Bl=new WeakMap,Xu=new WeakMap,Xi=new WeakSet,zo=function(){ue(this,ed,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var Uo=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)},Ni,$l,to,Qe,id,kl,td,rd,ro,jo=class r{constructor(e,t){Ni.add(this),this.type="value-region",$l.set(this,new j),to.set(this,void 0),Qe.set(this,void 0),id.set(this,void 0),kl.set(this,void 0),td.set(this,void 0),rd.set(this,W.Empty),Uo(this,to,e,"f"),Uo(this,Qe,t,"f"),Uo(this,td,!0,"f"),Uo(this,id,new te,"f"),Uo(this,kl,!1,"f"),se(this,$l,"f").own(se(this,Qe,"f").pointerHub.subscribe({onAdded:()=>se(this,Ni,"m",ro).call(this),onRemoved:()=>se(this,Ni,"m",ro).call(this)})),se(this,$l,"f").own(se(this,Qe,"f").subscribe(Be.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackBoxAdapter.unwrap();se(this,Qe,"f").position.address.equals(o.address)?(i.regions.onIndexingChanged(),se(this,Ni,"m",ro).call(this)):se(this,Ni,"m",ro).call(this)}})),se(this,$l,"f").own(se(this,Qe,"f").events.catchupAndSubscribe(({targetVertex:o})=>{se(this,rd,"f").terminate(),Uo(this,rd,o.match({none:()=>W.Empty,some:({box:i})=>se(this,to,"f").boxAdapters.adapterFor(i,Wr).subscribeChange(()=>se(this,Ni,"m",ro).call(this))}),"f"),se(this,Ni,"m",ro).call(this)})),Uo(this,td,!1,"f")}valueAt(e,t){let o=this.optCollection;return o.isEmpty()?t:o.unwrap().valueAt(cr.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(cr.globalToLocal(this,this.complete),e)}subscribeChange(e){return se(this,id,"f").subscribe(e)}accept(e){return A(e.visitValueRegionBoxAdapter,this)}onSelected(){Uo(this,kl,!0,"f"),se(this,Ni,"m",ro).call(this)}onDeselected(){Uo(this,kl,!1,"f"),se(this,Ni,"m",ro).call(this)}get isSelected(){return se(this,kl,"f")}onValuesPropertyChanged(){se(this,Ni,"m",ro).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){se(this,rd,"f").terminate(),se(this,$l,"f").terminate()}get box(){return se(this,Qe,"f")}get uuid(){return se(this,Qe,"f").address.uuid}get address(){return se(this,Qe,"f").address}get position(){return se(this,Qe,"f").position.getValue()}get duration(){return se(this,Qe,"f").duration.getValue()}get loopOffset(){return se(this,Qe,"f").loopOffset.getValue()}get loopDuration(){return se(this,Qe,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return se(this,Qe,"f").mute.getValue()}get hue(){return se(this,Qe,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return se(this,Qe,"f").events.targetVertex.map(e=>se(this,to,"f").boxAdapters.adapterFor(e.box,Wr))}get label(){return se(this,Qe,"f").label.getValue()}get trackBoxAdapter(){return se(this,td,"f")?m.None:se(this,Qe,"f").regions.targetVertex.map(e=>se(this,to,"f").boxAdapters.adapterFor(e.box,ut))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}set position(e){se(this,Qe,"f").position.setValue(e)}set duration(e){se(this,Qe,"f").duration.setValue(e)}set loopOffset(e){se(this,Qe,"f").loopOffset.setValue(e)}set loopDuration(e){se(this,Qe,"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 se(this,to,"f").boxAdapters.adapterFor(Rs.create(se(this,to,"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??se(this,Qe,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=se(this,to,"f").boxGraph,o=Io.create(t,b.generate());e.asArray().forEach(i=>i.copyTo({events:o.events})),se(this,Qe,"f").events.refer(o.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return m.None;let t=se(this,to,"f").boxGraph,o=e.toSorted(hn.Comparator),i=I.getFirst(o,"Internal error (no first)"),n=I.getLast(o,"Internal error (no last)"),s=i.position,a=n.position+n.duration,l=i.trackBoxAdapter.unwrap(),c=Io.create(t,b.generate()),d=Array.from(l.regions.collection.iterateRange(s,a));return d.filter(h=>h.isSelected).forEach(h=>{let f=h;for(let{resultStart:v,resultEnd:g,rawStart:y}of cr.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),_=Math.floor(g-y);for(let D of f.events.unwrap().iterateRange(x,_));}}),d.forEach(({box:h})=>h.delete()),m.wrap(Rs.create(t,b.generate(),h=>{h.position.setValue(s),h.duration.setValue(a-s),h.loopDuration.setValue(a-s),h.loopOffset.setValue(0),h.hue.setValue(this.hue),h.mute.setValue(this.mute),h.label.setValue(this.label),h.events.refer(c.owners),h.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${b.toString(se(this,Qe,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};$l=new WeakMap,to=new WeakMap,Qe=new WeakMap,id=new WeakMap,kl=new WeakMap,td=new WeakMap,rd=new WeakMap,Ni=new WeakSet,ro=function(){se(this,id,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var U_=(r,e)=>r.position-e.position,j_={for:(r,e)=>G(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,Vn),visitAudioRegionBox:t=>r.adapterFor(t,On),visitValueRegionBox:t=>r.adapterFor(t,jo)}),"")};var Il=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},Tt=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)},od,Xs,nd,Tl,ea,Ml,_f=class{constructor(e,t){od.set(this,void 0),Xs.set(this,void 0),nd.set(this,void 0),Tl.set(this,void 0),ea.set(this,void 0),Ml.set(this,void 0),Il(this,od,e,"f"),Il(this,Xs,new j,"f"),Il(this,nd,Tt(this,Xs,"f").own(new te),"f"),Il(this,Tl,Tt(this,Xs,"f").own(new gt),"f"),Il(this,ea,hn.create(U_),"f"),Il(this,Ml,b.newSet(o=>o.uuid),"f"),Tt(this,Xs,"f").ownAll(Tt(this,od,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{let i=j_.for(t,o),n=Tt(this,Ml,"f").add(i);B(n,`Cannot add ${o}`),Tt(this,ea,"f").add(i),Tt(this,Tl,"f").forEach(s=>s.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:o}}})=>{let i=Tt(this,Ml,"f").removeByKey(o);Tt(this,ea,"f").remove(i),Tt(this,Tl,"f").forEach(n=>n.onRemoved(i)),this.dispatchChange()}},u.RegionCollection))}get trackBoxAdapter(){return Tt(this,od,"f")}get collection(){return Tt(this,ea,"f")}get adapters(){return Tt(this,Ml,"f")}onIndexingChanged(){Tt(this,ea,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),Tt(this,Tl,"f").subscribe(e)}subscribeChanges(e){return Tt(this,nd,"f").subscribe(e)}dispatchChange(){Tt(this,nd,"f").notify()}terminate(){Tt(this,Xs,"f").terminate()}};od=new WeakMap,Xs=new WeakMap,nd=new WeakMap,Tl=new WeakMap,ea=new WeakMap,Ml=new WeakMap;var ee;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(ee||(ee={}));(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}}})(ee||(ee={}));var Pf;(function(r){r.isDeviceBox=e=>"host"in e&&Le(e.host,k)&&"label"in e&&Le(e.label,C)&&"enabled"in e&&Le(e.enabled,T)&&"minimized"in e&&Le(e.minimized,T),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===u.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Le(e.index,N)&&(e.host.pointerType===u.MidiEffectHost||e.host.pointerType===u.AudioEffectHost),r.lookupHostField=e=>R(e)&&"host"in e&&Le(e.host,k)?e.host:P(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>R(e)&&"label"in e&&Le(e.label,C)?e.label:P(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>R(e)&&"enabled"in e&&Le(e.enabled,T)?e.enabled:P(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>R(e)&&"minimized"in e&&Le(e.minimized,T)?e.minimized:P(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>R(e)&&"index"in e&&Le(e.index,N)?e.index:P(`Could not find 'index' field in '${e?.name}'`)})(Pf||(Pf={}));var L_;(function(r){r.toTrackType=e=>{switch(e){case"midi":return ee.Notes;case"audio":return ee.Audio;default:return P()}}})(L_||(L_={}));var re;(function(r){r.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),r.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),r.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",r.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",r.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",r.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",r.deleteEffectDevices=e=>{if(e.length===0)return;B(I.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(u.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(u.MidiEffectHost):P("unknown type")).map(({box:i})=>Pf.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())}})(re||(re={}));var Ef=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)},sd,Sf,Fi,ta,Nf,Ff=class{constructor(e,t){sd.set(this,void 0),Sf.set(this,new te),Fi.set(this,void 0),ta.set(this,void 0),Nf.set(this,void 0),Ef(this,sd,e,"f"),Ef(this,Fi,Ot.create(e.box.tracks,o=>t.adapterFor(o,ut),u.TrackCollection),"f"),Ef(this,ta,b.newSet(({uuid:o})=>o),"f"),Ef(this,Nf,zt(this,Fi,"f").catchupAndSubscribe({onAdd:o=>zt(this,ta,"f").add({uuid:o.uuid,subscription:o.regions.subscribeChanges(()=>zt(this,Sf,"f").notify())}),onRemove:({uuid:o})=>zt(this,ta,"f").removeByKey(o).subscription.terminate(),onReorder:o=>{}}),"f")}create(e,t,o){let i=zt(this,sd,"f").box.graph,n=zt(this,sd,"f").box.tracks;rr.create(i,b.generate(),s=>{s.index.setValue(o??zt(this,Fi,"f").getMinFreeIndex()),s.type.setValue(e),s.tracks.refer(n),s.target.refer(t)})}controls(e){return m.wrap(zt(this,Fi,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=zt(this,Fi,"f").adapters(),o=t.indexOf(e);if(o===-1)return P(`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 zt(this,Fi,"f")}values(){return zt(this,Fi,"f").adapters()}catchupAndSubscribe(e){return zt(this,Fi,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return zt(this,Sf,"f").subscribe(e)}terminate(){zt(this,Fi,"f").terminate(),zt(this,Nf,"f").terminate(),zt(this,ta,"f").forEach(({subscription:e})=>e.terminate()),zt(this,ta,"f").clear()}};sd=new WeakMap,Sf=new WeakMap,Fi=new WeakMap,ta=new WeakMap,Nf=new WeakMap;var K_=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},Bi=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)},Bf,Nr,ir=class{constructor(e,t){this.type="bus",this.accepts="audio",Bf.set(this,void 0),Nr.set(this,void 0),K_(this,Bf,e,"f"),K_(this,Nr,t,"f")}catchupAndSubscribe(e){return e(this),Bi(this,Nr,"f").subscribe(Be.Children,()=>e(this))}get uuid(){return Bi(this,Nr,"f").address.uuid}get address(){return Bi(this,Nr,"f").address}get box(){return Bi(this,Nr,"f")}get enabledField(){return Bi(this,Nr,"f").enabled}get minimizedField(){return Bi(this,Nr,"f").minimized}get iconField(){return Bi(this,Nr,"f").icon}get labelField(){return Bi(this,Nr,"f").label}get colorField(){return Bi(this,Nr,"f").color}get iconSymbol(){return $e.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Bi(this,Bf,"f").boxAdapters.adapterFor(Bi(this,Nr,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}toString(){return`{${this.constructor.name}}`}};Bf=new WeakMap,Nr=new WeakMap;var ad=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)},Lo,Cl,Dl,Jr,ld,$f=class{constructor(e,t){Lo.set(this,void 0),Cl.set(this,void 0),Dl.set(this,void 0),Jr.set(this,void 0),ld.set(this,W.Empty),ad(this,Lo,new j,"f"),ad(this,Cl,at(this,Lo,"f").own(new te),"f"),ad(this,Dl,at(this,Lo,"f").own(new Yt($e.Unknown)),"f"),ad(this,Jr,at(this,Lo,"f").own(new Yt(m.None)),"f"),at(this,Lo,"f").own(at(this,Jr,"f").subscribe(o=>{at(this,ld,"f").terminate(),ad(this,ld,o.getValue().match({none:()=>(at(this,Cl,"f").notify(m.None),W.Empty),some:({labelField:i,iconField:n})=>W.many(n.catchupAndSubscribe(s=>at(this,Dl,"f").setValue($e.fromName(s.getValue()))),i.catchupAndSubscribe(s=>at(this,Cl,"f").notify(m.wrap(s.getValue()))))}),"f")})),at(this,Lo,"f").own(e.catchupAndSubscribe({onAdded:({box:o})=>{B(at(this,Jr,"f").getValue().isEmpty(),"Already set");let i=o instanceof Pi?t.adapterFor(o,ir):t.adapterFor(o,re.isInstrument);at(this,Jr,"f").getValue().unwrapOrNull()!==i&&at(this,Jr,"f").setValue(m.wrap(i))},onRemoved:({box:o})=>{B(at(this,Jr,"f").getValue().unwrap("Cannot remove").box.address.equals(o.address),"Unexpected value to remove"),at(this,Jr,"f").setValue(m.None)}},u.InstrumentHost,u.AudioOutput))}getValue(){return at(this,Jr,"f").getValue()}subscribe(e){return at(this,Jr,"f").subscribe(e)}catchupAndSubscribe(e){return e(at(this,Jr,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),at(this,Cl,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return at(this,Dl,"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 at(this,Dl,"f")}terminate(){at(this,Lo,"f").terminate(),at(this,ld,"f").terminate()}};Lo=new WeakMap,Cl=new WeakMap,Dl=new WeakMap,Jr=new WeakMap,ld=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},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)},kf,Ko,pe=class{constructor(e){kf.set(this,void 0),Ko.set(this,void 0),W_(this,kf,e,"f"),W_(this,Ko,he.newSet(t=>t.address),"f")}terminate(){ra(this,Ko,"f").forEach(e=>e.terminate()),ra(this,Ko,"f").clear()}parameters(){return ra(this,Ko,"f").values()}parameterAt(e){return ra(this,Ko,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,o,i,n){let s=new ia(ra(this,kf,"f"),e,t,o,i,n),a=ra(this,Ko,"f").add(s);return B(a,`Could not add adapter for ${e}`),s}removeParameter(e){return ra(this,Ko,"f").removeByKey(e)}};kf=new WeakMap,Ko=new WeakMap;var oa=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)},na,Qr,zn,Rl,If,Tf,cd,Ol=class{constructor(e,t){na.set(this,void 0),Qr.set(this,void 0),zn.set(this,void 0),Rl.set(this,void 0),If.set(this,void 0),Tf.set(this,void 0),cd.set(this,W.Empty),oa(this,na,e,"f"),oa(this,Qr,t,"f"),oa(this,zn,new j,"f"),oa(this,Rl,et(this,zn,"f").own(new te),"f"),et(this,zn,"f").own(t.targetBus.catchupAndSubscribe(()=>{et(this,cd,"f").terminate(),oa(this,cd,this.optTargetBus.match({none:()=>(et(this,Rl,"f").notify(m.None),W.Empty),some:o=>o.catchupAndSubscribe(i=>et(this,Rl,"f").notify(m.wrap(i)))}),"f")})),oa(this,If,et(this,zn,"f").own(new ia(et(this,na,"f"),et(this,Qr,"f").sendPan,F.bipolar(),S.percent({unit:"%",fractionDigits:0}),"panning")),"f"),oa(this,Tf,et(this,zn,"f").own(new ia(et(this,na,"f"),et(this,Qr,"f").sendGain,F.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),et(this,Rl,"f").subscribe(e)}get uuid(){return et(this,Qr,"f").address.uuid}get address(){return et(this,Qr,"f").address}get box(){return et(this,Qr,"f")}get indexField(){return et(this,Qr,"f").index}get sendPan(){return et(this,If,"f")}get sendGain(){return et(this,Tf,"f")}get targetBus(){return et(this,na,"f").boxAdapters.adapterFor(et(this,Qr,"f").targetBus.targetVertex.unwrap("no audioUnit").box,ir)}get optTargetBus(){return et(this,Qr,"f").targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>et(this,na,"f").boxAdapters.adapterFor(t,ir)})))}delete(){et(this,Qr,"f").delete()}terminate(){et(this,zn,"f").terminate(),et(this,cd,"f").terminate()}};na=new WeakMap,Qr=new WeakMap,zn=new WeakMap,Rl=new WeakMap,If=new WeakMap,Tf=new WeakMap,cd=new WeakMap;var ud=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},io=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)},Mf,Cf,Vl,zl,dd,Df=class{constructor(e,t){Mf.set(this,void 0),Cf.set(this,void 0),Vl.set(this,void 0),zl.set(this,void 0),dd.set(this,W.Empty),ud(this,Mf,e,"f"),ud(this,Cf,t,"f"),ud(this,Vl,new j,"f"),ud(this,zl,io(this,Vl,"f").own(new te),"f"),io(this,Vl,"f").own(e.catchupAndSubscribe(()=>{io(this,dd,"f").terminate(),ud(this,dd,this.adapter.match({none:()=>(io(this,zl,"f").notify(m.None),W.Empty),some:o=>o.catchupAndSubscribe(i=>io(this,zl,"f").notify(m.wrap(i)))}),"f")}))}subscribe(e){return io(this,zl,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return io(this,Mf,"f").targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>io(this,Cf,"f").adapterFor(t,ir)})))}terminate(){io(this,Vl,"f").terminate(),io(this,dd,"f").terminate()}};Mf=new WeakMap,Cf=new WeakMap,Vl=new WeakMap,zl=new WeakMap,dd=new WeakMap;var Wo=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},ie=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)},Rf,Z_,oo,Fr,dt,aa,Ul,sa,Of,Vf,zf,Uf,G_,q_,Yr=class{constructor(e,t){Rf.add(this),this.class="device-host",oo.set(this,new j),Fr.set(this,void 0),dt.set(this,void 0),aa.set(this,void 0),Ul.set(this,void 0),sa.set(this,void 0),Of.set(this,void 0),Vf.set(this,void 0),zf.set(this,void 0),Uf.set(this,void 0),Wo(this,Fr,e,"f"),Wo(this,dt,t,"f"),Wo(this,aa,ie(this,oo,"f").own(new pe(ie(this,Fr,"f"))),"f"),Wo(this,Ul,ie(this,oo,"f").own(new Ff(this,ie(this,Fr,"f").boxAdapters)),"f"),Wo(this,sa,ie(this,oo,"f").own(new $f(ie(this,dt,"f").input.pointerHub,ie(this,Fr,"f").boxAdapters)),"f"),Wo(this,Of,ie(this,oo,"f").own(Ot.create(ie(this,dt,"f").midiEffects,o=>ie(this,Fr,"f").boxAdapters.adapterFor(o,re.isMidiEffect),u.MidiEffectHost)),"f"),Wo(this,Vf,ie(this,oo,"f").own(Ot.create(ie(this,dt,"f").audioEffects,o=>ie(this,Fr,"f").boxAdapters.adapterFor(o,re.isAudioEffect),u.AudioEffectHost)),"f"),Wo(this,zf,ie(this,oo,"f").own(Ot.create(ie(this,dt,"f").auxSends,o=>ie(this,Fr,"f").boxAdapters.adapterFor(o,Ol),u.AuxSend)),"f"),Wo(this,Uf,ie(this,oo,"f").own(new Df(ie(this,dt,"f").output,ie(this,Fr,"f").boxAdapters)),"f"),this.namedParameter=ie(this,Rf,"m",G_).call(this,t),ie(this,Rf,"m",q_).call(this)}get box(){return ie(this,dt,"f")}get uuid(){return ie(this,dt,"f").address.uuid}get address(){return ie(this,dt,"f").address}get indexField(){return ie(this,dt,"f").index}get type(){return ie(this,dt,"f").type.getValue()}get captureBox(){return ie(this,dt,"f").capture.targetVertex}get tracks(){return ie(this,Ul,"f")}get input(){return ie(this,sa,"f")}get midiEffects(){return ie(this,Of,"f")}get audioEffects(){return ie(this,Vf,"f")}get inputAdapter(){return ie(this,sa,"f").getValue()}get auxSends(){return ie(this,zf,"f")}get output(){return ie(this,Uf,"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 ie(this,dt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ie(this,Fr,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return ie(this,dt,"f").midiEffects}get inputField(){return ie(this,dt,"f").input}get audioEffectsField(){return ie(this,dt,"f").audioEffects}get tracksField(){return ie(this,dt,"f").tracks}get minimizedField(){return ie(this,sa,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return ie(this,sa,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}indicesLimit(){let e=ie(this,Fr,"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){ie(this,Fr,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){ie(this,Ul,"f").collection.move(e,t)}deleteTrack(e){ie(this,Ul,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ie(this,oo,"f").terminate()}};Z_=Yr,oo=new WeakMap,Fr=new WeakMap,dt=new WeakMap,aa=new WeakMap,Ul=new WeakMap,sa=new WeakMap,Of=new WeakMap,Vf=new WeakMap,zf=new WeakMap,Uf=new WeakMap,Rf=new WeakSet,G_=function(e){return{volume:ie(this,aa,"f").createParameter(e.volume,Z_.VolumeMapper,S.decible,"volume"),panning:ie(this,aa,"f").createParameter(e.panning,F.bipolar(),S.panning,"panning",.5),mute:ie(this,aa,"f").createParameter(e.mute,F.bool,S.bool,"mute"),solo:ie(this,aa,"f").createParameter(e.solo,F.bool,S.bool,"solo")}},q_=function(){let e=this.address.toString(),t=ie(this,dt,"f").capture.targetAddress.unwrapOrUndefined(),o=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ie(this,dt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;B(this.type!==yt.Instrument||ie(this,dt,"f").capture.targetAddress.nonEmpty(),o)};Yr.VolumeMapper=F.decibel(-96,-9,6);var jl=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},Ge=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)},jf,Un,or,la,Lf,Kf,hd,H_,J_,ut=class{constructor(e,t){jf.add(this),Un.set(this,void 0),or.set(this,void 0),la.set(this,void 0),Lf.set(this,void 0),Kf.set(this,void 0),hd.set(this,void 0),jl(this,Un,e,"f"),jl(this,or,t,"f"),jl(this,la,new j,"f"),jl(this,Lf,Ge(this,la,"f").own(new bf(this,e.boxAdapters)),"f"),jl(this,Kf,Ge(this,la,"f").own(new _f(this,e.boxAdapters)),"f"),jl(this,hd,Ge(this,la,"f").own(new Yt(-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 W.many(Ge(this,jf,"m",H_).call(this,i=>{t[0].equals(i)||(t[0]=i,o())}),Ge(this,jf,"m",J_).call(this,i=>{t[1].equals(i)||(t[1]=i,o())}))}set targetDeviceName(e){Ge(this,or,"f").target.targetVertex.ifSome(t=>{let o=t.box;if(o instanceof Xe)return Ge(this,Un,"f").boxAdapters.adapterFor(o,Yr).input.getValue().ifSome(({labelField:n})=>n.setValue(e));if("label"in o&&o.label instanceof C)return o.label.setValue(e)})}get targetDeviceName(){return Ge(this,or,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof Xe?Ge(this,Un,"f").boxAdapters.adapterFor(t,Yr).input.label:"label"in t&&t.label instanceof C?m.wrap(t.label.getValue()):m.wrap(t.name)})}terminate(){Ge(this,la,"f").terminate()}get audioUnit(){return Ee(Ge(this,or,"f").tracks.targetVertex.unwrap().box,Xe)}get target(){return Ge(this,or,"f").target}get clips(){return Ge(this,Lf,"f")}get regions(){return Ge(this,Kf,"f")}get enabled(){return Ge(this,or,"f").enabled}get indexField(){return Ge(this,or,"f").index}get type(){return Ge(this,or,"f").type.getValue()}get box(){return Ge(this,or,"f")}get uuid(){return Ge(this,or,"f").address.uuid}get address(){return Ge(this,or,"f").address}get listIndex(){return Ge(this,hd,"f").getValue()}set listIndex(e){Ge(this,hd,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ee.Audio;case"note-clip":return this.type===ee.Notes;case"value-clip":return this.type===ee.Value;case"audio-region":return this.type===ee.Audio;case"note-region":return this.type===ee.Notes;case"value-region":return this.type===ee.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let o=t,i=Ge(this,Un,"f").clipSequencing.iterate(this.uuid,e,e+yp);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 Le(l,jo)?l.incomingValue(t):t}else if(Le(a,jo))return e<a.complete?a.valueAt(e,t):a.outgoingValue(t);return t},some:a=>s===e&&Le(a,Bn)?a.valueAt(e,t):t});return o}};Un=new WeakMap,or=new WeakMap,la=new WeakMap,Lf=new WeakMap,Kf=new WeakMap,hd=new WeakMap,jf=new WeakSet,H_=function(e){let t=Ge(this,or,"f").target.targetVertex;if(t.nonEmpty()){let o=t.unwrap().box;return o instanceof Xe?Ge(this,Un,"f").boxAdapters.adapterFor(o,Yr).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)),W.Empty)}return e(m.None),W.Empty},J_=function(e){let t=this.type;switch(t){case ee.Audio:case ee.Notes:return e(m.wrap(ee[t])),W.Empty;case ee.Value:{let o=Ge(this,or,"f").target.targetVertex.unwrap();if(o.isField())e(Ge(this,Un,"f").parameterFieldAdapters.opt(o.address).map(i=>i.name));else if(o.isBox())e(m.wrap(o.name));else return P("Illegal State. Vertex is not a field nor box.");return W.Empty}case ee.Undefined:return e(m.wrap("")),W.Empty;default:return e(m.None),W.Empty}};var Ut=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)},jn,Br,Ln,ca,Wf,Zf,ua,da,Kn,Wn,ha,Ll,pd,Q_=[u.Automation,u.Modulation,u.MidiControl,u.ParameterController],ia=class{constructor(e,t,o,i,n,s){jn.set(this,void 0),Br.set(this,void 0),Ln.set(this,void 0),ca.set(this,void 0),Wf.set(this,void 0),Zf.set(this,void 0),ua.set(this,new j),da.set(this,void 0),Kn.set(this,void 0),Wn.set(this,m.None),ha.set(this,m.None),Ll.set(this,null),pd.set(this,!1),Ut(this,jn,e,"f"),Ut(this,Br,t,"f"),Ut(this,Ln,o,"f"),Ut(this,ca,i,"f"),Ut(this,Wf,n,"f"),Ut(this,Zf,s??0,"f"),ae(this,ua,"f").own(ae(this,jn,"f").parameterFieldAdapters.register(this)),Ut(this,da,ae(this,ua,"f").own(new te),"f"),Ut(this,Kn,new gt,"f"),ae(this,ua,"f").own(ae(this,Br,"f").subscribe(()=>ae(this,da,"f").notify(this))),ae(this,ua,"f").own(ae(this,Br,"f").pointerHub.catchupAndSubscribe({onAdded:a=>{ae(this,Kn,"f").proxy.onControlSourceAdd(qy(a.pointerType)),a.box.accept({visitTrackBox:l=>{B(ae(this,Wn,"f").isEmpty(),"Already assigned");let c=ae(this,jn,"f").boxAdapters.adapterFor(l,ut);Ut(this,Wn,m.wrap(c),"f"),ae(this,jn,"f").isMainThread&&Ut(this,ha,m.wrap(ae(this,jn,"f").liveStreamReceiver.subscribeFloat(ae(this,Br,"f").address,d=>{ae(this,Ll,"f")!==d&&(Ut(this,Ll,d,"f"),ae(this,da,"f").notify(this))})),"f")}})},onRemoved:a=>{ae(this,Kn,"f").proxy.onControlSourceRemove(qy(a.pointerType)),a.box.accept({visitTrackBox:l=>{B(ae(this,Wn,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),Ut(this,Wn,m.None,"f"),ae(this,jn,"f").isMainThread&&(ae(this,ha,"f").ifSome(c=>c.terminate()),Ut(this,ha,m.None,"f"),Ut(this,Ll,null,"f"),ae(this,da,"f").notify(this))}})}},...Q_)),t.getValue()!==o.clamp(t.getValue())&&console.warn(`${n} (${t.getValue()}) is out of bounds`,o)}registerMidiControl(){return ae(this,Kn,"f").proxy.onControlSourceAdd("midi"),Ut(this,pd,!0,"f"),{terminate:()=>{Ut(this,pd,!1,"f"),ae(this,Kn,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ae(this,Br,"f")}get valueMapping(){return ae(this,Ln,"f")}get stringMapping(){return ae(this,ca,"f")}get name(){return ae(this,Wf,"f")}get anchor(){return ae(this,Zf,"f")}get type(){return ae(this,Br,"f").type}get address(){return ae(this,Br,"f").address}get track(){return ae(this,Wn,"f")}valueAt(e){let t=ae(this,Wn,"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 ae(this,da,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ae(this,pd,"f")&&e.onControlSourceAdd("midi"),ae(this,Br,"f").pointerHub.filter(...Q_).forEach(t=>e.onControlSourceAdd(qy(t.pointerType))),ae(this,Kn,"f").subscribe(e)}getValue(){return ae(this,Br,"f").getValue()}setValue(e){ae(this,Br,"f").setValue(e)}setUnitValue(e){this.setValue(ae(this,Ln,"f").y(e))}getUnitValue(){return ae(this,Ln,"f").x(this.getValue())}getControlledValue(){return ae(this,Ln,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ae(this,Ll,"f")??this.getUnitValue()}getControlledPrintValue(){return ae(this,ca,"f").x(this.getControlledValue())}getPrintValue(){return ae(this,ca,"f").x(this.getValue())}setPrintValue(e){let t=ae(this,ca,"f").y(e);t.type==="unitValue"?this.setUnitValue(X(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ae(this,Ln,"f").clamp(ae(this,Br,"f").initValue))}terminate(){ae(this,ha,"f").ifSome(e=>e.terminate()),Ut(this,ha,m.None,"f"),ae(this,ua,"f").terminate()}};jn=new WeakMap,Br=new WeakMap,Ln=new WeakMap,ca=new WeakMap,Wf=new WeakMap,Zf=new WeakMap,ua=new WeakMap,da=new WeakMap,Kn=new WeakMap,Wn=new WeakMap,ha=new WeakMap,Ll=new WeakMap,pd=new WeakMap;var qy=r=>{switch(r){case u.Automation:return"automated";case u.Modulation:return"modulated";case u.MidiControl:return"midi";case u.ParameterController:return"external";default:return P(`${r.toString()} is an unknown pointer type`)}};var Hy=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)},Zo,pa,Gf,qf=class{constructor(e,t,o){Zo.set(this,void 0),pa.set(this,void 0),Gf.set(this,void 0),Hy(this,Zo,b.newSet(i=>i.uuid),"f"),Hy(this,pa,new gt,"f"),Hy(this,Gf,e.catchupAndSubscribe({onAdded:i=>{let n=t(i.box),s=$i(this,Zo,"f").add(n);B(s,`Could not add ${n}`),$i(this,pa,"f").proxy.onAdd(n)},onRemoved:i=>{let n=i.box.address.uuid;$i(this,pa,"f").proxy.onRemove($i(this,Zo,"f").removeByKey(n))}},o),"f")}subscribe(e){return $i(this,pa,"f").subscribe(e)}catchupAndSubscribe(e){return $i(this,Zo,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return $i(this,Zo,"f").values()}size(){return $i(this,Zo,"f").size()}isEmpty(){return this.size()===0}terminate(){$i(this,Zo,"f").clear(),$i(this,pa,"f").terminate(),$i(this,Gf,"f").terminate()}};Zo=new WeakMap,pa=new WeakMap,Gf=new WeakMap;var Jy=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)},Qy,Hf,fd,Xr,no,Y_,ei=class{constructor(e,t){Qy.add(this),this.type="audio-effect",this.accepts="audio",fd.set(this,void 0),Xr.set(this,void 0),no.set(this,void 0),Jy(this,fd,e,"f"),Jy(this,Xr,t,"f"),Jy(this,no,new pe(St(this,fd,"f")),"f"),this.namedParameter=St(this,Qy,"m",Y_).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}deviceHost(){return St(this,fd,"f").boxAdapters.adapterFor(St(this,Xr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){St(this,no,"f").terminate()}};Hf=ei,fd=new WeakMap,Xr=new WeakMap,no=new WeakMap,Qy=new WeakSet,Y_=function(e){return{delay:St(this,no,"f").createParameter(e.delay,F.linearInteger(0,Hf.OffsetFractions.length-1),Hf.OffsetStringMapping,"delay"),feedback:St(this,no,"f").createParameter(e.feedback,F.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:St(this,no,"f").createParameter(e.cross,F.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"cross"),filter:St(this,no,"f").createParameter(e.filter,F.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:St(this,no,"f").createParameter(e.dry,F.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"dry"),wet:St(this,no,"f").createParameter(e.wet,F.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"wet")}};ei.OffsetFractions=Xt.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();ei.OffsetStringMapping=S.indices("",Hf.OffsetFractions.map(([r,e])=>`${r}/${e}`));var Yy=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},Nt=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)},Xy,md,ti,so,X_,Kl=class{constructor(e,t){Xy.add(this),this.type="audio-effect",this.accepts="audio",md.set(this,void 0),ti.set(this,void 0),so.set(this,void 0),Yy(this,md,e,"f"),Yy(this,ti,t,"f"),Yy(this,so,new pe(Nt(this,md,"f")),"f"),this.namedParameter=Nt(this,Xy,"m",X_).call(this,t)}get box(){return Nt(this,ti,"f")}get uuid(){return Nt(this,ti,"f").address.uuid}get address(){return Nt(this,ti,"f").address}get indexField(){return Nt(this,ti,"f").index}get labelField(){return Nt(this,ti,"f").label}get enabledField(){return Nt(this,ti,"f").enabled}get minimizedField(){return Nt(this,ti,"f").minimized}get host(){return Nt(this,ti,"f").host}deviceHost(){return Nt(this,md,"f").boxAdapters.adapterFor(Nt(this,ti,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Nt(this,so,"f").terminate()}};md=new WeakMap,ti=new WeakMap,so=new WeakMap,Xy=new WeakSet,X_=function(e){return{decay:Nt(this,so,"f").createParameter(e.decay,F.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Nt(this,so,"f").createParameter(e.preDelay,F.exponential(.001,.5),S.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Nt(this,so,"f").createParameter(e.damp,F.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"damping"),filter:Nt(this,so,"f").createParameter(e.filter,F.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"filter"),dry:Nt(this,so,"f").createParameter(e.dry,F.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Nt(this,so,"f").createParameter(e.wet,F.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"wet")}};var ex=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)},rx,gd,$r,ki,rP,Wl=class{constructor(e,t){rx.add(this),this.type="audio-effect",this.accepts="audio",gd.set(this,void 0),$r.set(this,void 0),ki.set(this,void 0),ex(this,gd,e,"f"),ex(this,$r,t,"f"),ex(this,ki,new pe(pt(this,gd,"f")),"f"),this.namedParameter=pt(this,rx,"m",rP).call(this,t)}get box(){return pt(this,$r,"f")}get uuid(){return pt(this,$r,"f").address.uuid}get address(){return pt(this,$r,"f").address}get indexField(){return pt(this,$r,"f").index}get labelField(){return pt(this,$r,"f").label}get enabledField(){return pt(this,$r,"f").enabled}get minimizedField(){return pt(this,$r,"f").minimized}get host(){return pt(this,$r,"f").host}get spectrum(){return pt(this,$r,"f").address.append(4095)}deviceHost(){return pt(this,gd,"f").boxAdapters.adapterFor(pt(this,$r,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){pt(this,ki,"f").terminate()}};gd=new WeakMap,$r=new WeakMap,ki=new WeakMap,rx=new WeakSet,rP=function(e){return{highPass:eP(pt(this,ki,"f"),e.highPass,"High-Pass"),lowShelf:tP(pt(this,ki,"f"),e.lowShelf,"Low-Shelf"),lowBell:tx(pt(this,ki,"f"),e.lowBell,"Low-Bell"),midBell:tx(pt(this,ki,"f"),e.midBell,"Mid-Bell"),highBell:tx(pt(this,ki,"f"),e.highBell,"High-Bell"),highShelf:tP(pt(this,ki,"f"),e.highShelf,"High-Shelf"),lowPass:eP(pt(this,ki,"f"),e.lowPass,"Low-Pass")}};var ix=F.exponential(20,2e4),iP=F.linear(-24,24),oP=F.exponential(.01,10),eP=(r,e,t)=>({enabled:r.createParameter(e.enabled,F.bool,S.bool,"enabled"),frequency:r.createParameter(e.frequency,ix,S.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,F.linearInteger(0,3),S.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,oP,S.numeric({fractionDigits:3}),`${t} Q`)}),tP=(r,e,t)=>({enabled:r.createParameter(e.enabled,F.bool,S.bool,"enabled"),frequency:r.createParameter(e.frequency,ix,S.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,iP,S.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),tx=(r,e,t)=>({enabled:r.createParameter(e.enabled,F.bool,S.bool,"enabled"),frequency:r.createParameter(e.frequency,ix,S.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,iP,S.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,oP,S.numeric({fractionDigits:3}),`${t} Q`)});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},ur=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)},Jf,Qf,dr,Zn=class{constructor(e,t){this.type="marker-event",Jf.set(this,new j),Qf.set(this,void 0),dr.set(this,void 0),nP(this,Qf,e,"f"),nP(this,dr,t,"f"),ur(this,Jf,"f").own(ur(this,dr,"f").subscribe(Be.Children,o=>{if(!this.trackAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackAdapter.unwrap();ur(this,dr,"f").position.address.equals(o.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return ur(this,dr,"f")}get uuid(){return ur(this,dr,"f").address.uuid}get address(){return ur(this,dr,"f").address}get position(){return ur(this,dr,"f").position.getValue()}get plays(){return ur(this,dr,"f").plays.getValue()}get hue(){return ur(this,dr,"f").hue.getValue()}get label(){return ur(this,dr,"f").label.getValue()}get trackAdapter(){return ur(this,dr,"f").track.targetVertex.map(e=>ur(this,Qf,"f").boxAdapters.adapterFor(e.box,ao).markerTrack)}terminate(){ur(this,Jf,"f").terminate()}toString(){return`{MarkerBoxAdapter ${b.toString(ur(this,dr,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Jf=new WeakMap,Qf=new WeakMap,dr=new WeakMap;Zn.Comparator=(r,e)=>r.position-e.position;var vd=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},ri=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)},yd,Zl,xd,fa,Yf,Xf=class{constructor(e,t){yd.set(this,void 0),Zl.set(this,void 0),xd.set(this,void 0),fa.set(this,void 0),Yf.set(this,void 0),vd(this,yd,e,"f"),vd(this,Zl,t,"f"),this.changeNotifier=new te,vd(this,xd,b.newSet(o=>o.uuid),"f"),vd(this,fa,dn.create(Zn.Comparator),"f"),vd(this,Yf,ri(this,Zl,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{if(o instanceof nl){let i=ri(this,yd,"f").boxAdapters.adapterFor(o,Zn),n=ri(this,xd,"f").add(i);B(n,"Could not add adapter"),ri(this,fa,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:o}}})=>{ri(this,fa,"f").remove(ri(this,xd,"f").removeByKey(o)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return ri(this,yd,"f")}get enabled(){return ri(this,Zl,"f").enabled.getValue()}get events(){return ri(this,fa,"f")}get object(){return ri(this,Zl,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){ri(this,fa,"f").onIndexingChanged(),this.dispatchChange()}terminate(){ri(this,Yf,"f").terminate()}};yd=new WeakMap,Zl=new WeakMap,xd=new WeakMap,fa=new WeakMap,Yf=new WeakMap;var sP=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},Go=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)},Ii,em,ao=class{constructor(e,t){Ii.set(this,void 0),em.set(this,void 0),sP(this,Ii,t,"f"),sP(this,em,new Xf(e,Go(this,Ii,"f").markerTrack),"f")}terminate(){}get box(){return Go(this,Ii,"f")}get uuid(){return Go(this,Ii,"f").address.uuid}get address(){return Go(this,Ii,"f").address}get markerTrack(){return Go(this,em,"f")}get signature(){return[Go(this,Ii,"f").signature.nominator.getValue(),Go(this,Ii,"f").signature.denominator.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=Go(this,Ii,"f").signature;return Q.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Go(this,Ii,"f").signature.subscribe(()=>e(this.signature))}};Ii=new WeakMap,em=new WeakMap;var MS=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},wd=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)},Gn,qn=class{constructor(e,t){Gn.set(this,void 0),MS(this,Gn,t,"f")}get box(){return wd(this,Gn,"f")}get uuid(){return wd(this,Gn,"f").address.uuid}get address(){return wd(this,Gn,"f").address}get source(){return wd(this,Gn,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return wd(this,Gn,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};Gn=new WeakMap;var ma=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},ii=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)},tm,ga,va,rm,im,bd,oi=class{constructor(e,t){tm.set(this,void 0),ga.set(this,void 0),va.set(this,void 0),rm.set(this,void 0),im.set(this,void 0),bd.set(this,!1),ma(this,tm,e,"f"),ma(this,ga,t,"f"),ma(this,va,new j,"f"),ma(this,rm,t.attributes,"f"),ma(this,im,ii(this,va,"f").own(new pe(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return ii(this,va,"f").own(e)}ownAll(...e){ii(this,va,"f").ownAll(...e)}onSelected(){ma(this,bd,!0,"f")}onDeselected(){ma(this,bd,!1,"f")}isSelected(){return ii(this,bd,"f")}get box(){return ii(this,ga,"f")}get attributes(){return ii(this,rm,"f")}get uuid(){return ii(this,ga,"f").address.uuid}get address(){return ii(this,ga,"f").address}get parameters(){return ii(this,im,"f")}get modular(){return ii(this,tm,"f").boxAdapters.adapterFor(ii(this,ga,"f").attributes.collection.targetVertex.unwrap().box,Hn)}terminate(){ii(this,va,"f").terminate()}};tm=new WeakMap,ga=new WeakMap,va=new WeakMap,rm=new WeakMap,im=new WeakMap,bd=new WeakMap;var om=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},qo=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)},nm,Jn,Ad,sm,Wt;(function(r){r.Input="input",r.Output="output"})(Wt||(Wt={}));var Zt=class r{static create(e,t,o,i){return new r(e,t,o,i??t.fieldName)}constructor(e,t,o,i){nm.set(this,void 0),Jn.set(this,void 0),Ad.set(this,void 0),sm.set(this,void 0),om(this,nm,e,"f"),om(this,Jn,t,"f"),om(this,Ad,o,"f"),om(this,sm,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 qo(this,Jn,"f").pointerHub.isEmpty()?I.empty():qo(this,Jn,"f").pointerHub.filter(u.VoltageConnection).map(({box:e})=>qo(this,nm,"f").adapterFor(e,qn))}get field(){return qo(this,Jn,"f")}get address(){return qo(this,Jn,"f").address}get direction(){return qo(this,Ad,"f")}get name(){return qo(this,sm,"f")}toString(){return`{ModuleConnectorAdapter address: ${qo(this,Jn,"f").address.toString()}, direction: ${qo(this,Ad,"f")}}`}};nm=new WeakMap,Jn=new WeakMap,Ad=new WeakMap,sm=new WeakMap;var ox=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},_d=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)},am,Pd,Ed,Gl=class extends oi{constructor(e,t){super(e,t),am.set(this,void 0),Pd.set(this,void 0),Ed.set(this,void 0),ox(this,am,this.parameters.createParameter(t.time,F.exponential(1,1e4),S.numeric({unit:"ms"}),"Time"),"f"),ox(this,Pd,Zt.create(e.boxAdapters,t.voltageInput,Wt.Input,"Input"),"f"),ox(this,Ed,Zt.create(e.boxAdapters,t.voltageOutput,Wt.Output,"Output"),"f")}get parameterTime(){return _d(this,am,"f")}get voltageInput(){return _d(this,Pd,"f")}get voltageOutput(){return _d(this,Ed,"f")}get inputs(){return[_d(this,Pd,"f")]}get outputs(){return[_d(this,Ed,"f")]}};am=new WeakMap,Pd=new WeakMap,Ed=new WeakMap;var CS=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},aP=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)},Sd,ql=class extends oi{constructor(e,t){super(e,t),Sd.set(this,void 0),CS(this,Sd,Zt.create(e.boxAdapters,t.input,Wt.Input,"Input"),"f")}get voltageInput(){return aP(this,Sd,"f")}get inputs(){return[aP(this,Sd,"f")]}get outputs(){return I.empty()}};Sd=new WeakMap;var nx=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},Nd=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)},lm,Fd,Bd,Hl=class extends oi{constructor(e,t){super(e,t),lm.set(this,void 0),Fd.set(this,void 0),Bd.set(this,void 0),nx(this,lm,this.parameters.createParameter(t.gain,F.DefaultDecibel,S.numeric({unit:"db"}),"Gain"),"f"),nx(this,Fd,Zt.create(e.boxAdapters,t.voltageInput,Wt.Input,"Input"),"f"),nx(this,Bd,Zt.create(e.boxAdapters,t.voltageOutput,Wt.Output,"Output"),"f")}get parameterGain(){return Nd(this,lm,"f")}get voltageInput(){return Nd(this,Fd,"f")}get voltageOutput(){return Nd(this,Bd,"f")}get inputs(){return[Nd(this,Fd,"f")]}get outputs(){return[Nd(this,Bd,"f")]}};lm=new WeakMap,Fd=new WeakMap,Bd=new WeakMap;var sx=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},ax=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)},cm,um,dm,Jl=class extends oi{constructor(e,t){super(e,t),cm.set(this,void 0),um.set(this,void 0),dm.set(this,void 0),sx(this,cm,Zt.create(e.boxAdapters,t.voltageInputX,Wt.Input,"X"),"f"),sx(this,um,Zt.create(e.boxAdapters,t.voltageInputY,Wt.Input,"Y"),"f"),sx(this,dm,Zt.create(e.boxAdapters,t.voltageOutput,Wt.Output,"Result"),"f")}get inputs(){return[ax(this,cm,"f"),ax(this,um,"f")]}get outputs(){return[ax(this,dm,"f")]}};cm=new WeakMap,um=new WeakMap,dm=new WeakMap;var DS=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},lP=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)},$d,Ql=class extends oi{constructor(e,t){super(e,t),$d.set(this,void 0),DS(this,$d,Zt.create(e.boxAdapters,t.output,Wt.Output,"Output"),"f")}get voltageOutput(){return lP(this,$d,"f")}get inputs(){return I.empty()}get outputs(){return[lP(this,$d,"f")]}};$d=new WeakMap;var Yl;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>G(t.accept({visitModuleGainBox:o=>e.adapterFor(o,Hl),visitModuleDelayBox:o=>e.adapterFor(o,Gl),visitModuleMultiplierBox:o=>e.adapterFor(o,Jl),visitModularAudioInputBox:o=>e.adapterFor(o,Ql),visitModularAudioOutputBox:o=>e.adapterFor(o,ql)}),`Could not find ModuleAdapter for ${t.name}`)})(Yl||(Yl={}));var cP=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},ya=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)},hm,pm,xa,lx,Xl=class{constructor(e,t){hm.add(this),pm.set(this,void 0),xa.set(this,void 0),cP(this,pm,e,"f"),cP(this,xa,t,"f")}get box(){return ya(this,xa,"f")}get uuid(){return ya(this,xa,"f").address.uuid}get address(){return ya(this,xa,"f").address}get moduleAdapter(){return Yl.adapterFor(ya(this,pm,"f").boxAdapters,ya(this,hm,"a",lx).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(ya(this,hm,"a",lx).address)}terminate(){}};pm=new WeakMap,xa=new WeakMap,hm=new WeakSet,lx=function(){return ya(this,xa,"f").parameter.targetVertex.unwrap("Parameter not assigned")};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},hr=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)},ec,pr,Qn=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",ec.set(this,void 0),pr.set(this,void 0),uP(this,ec,e,"f"),uP(this,pr,t,"f")}get box(){return hr(this,pr,"f")}get uuid(){return hr(this,pr,"f").address.uuid}get address(){return hr(this,pr,"f").address}get indexField(){return hr(this,pr,"f").index}get labelField(){return hr(this,pr,"f").label}get enabledField(){return hr(this,pr,"f").enabled}get minimizedField(){return hr(this,pr,"f").minimized}get host(){return hr(this,pr,"f").host}parameterAt(e){return P("Not yet implemented")}deviceHost(){return hr(this,ec,"f").boxAdapters.adapterFor(hr(this,pr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return hr(this,ec,"f").boxAdapters.adapterFor(hr(this,pr,"f").modularSetup.targetVertex.unwrap("No Modular found").box,Hn)}elements(){return hr(this,pr,"f").userInterface.elements.pointerHub.filter(u.DeviceUserInterface).map(e=>hr(this,ec,"f").boxAdapters.adapterFor(e.box,Xl))}terminate(){}};ec=new WeakMap,pr=new WeakMap;var kd=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},ze=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,Yn,rc,kr,wa,ba,Hn=class{constructor(e,t){tc.set(this,new j),Yn.set(this,void 0),rc.set(this,void 0),kr.set(this,void 0),wa.set(this,void 0),ba.set(this,void 0),kd(this,rc,e,"f"),kd(this,kr,t,"f"),kd(this,Yn,ze(this,tc,"f").own(new gt),"f"),kd(this,wa,b.newSet(a=>a.uuid),"f"),kd(this,ba,b.newSet(a=>a.uuid),"f");let o=a=>{let l=Yl.adapterFor(ze(this,rc,"f").boxAdapters,a.box);ze(this,wa,"f").add(l)&&ze(this,Yn,"f").proxy.onModuleAdded(l)},i=a=>ze(this,Yn,"f").proxy.onModuleRemoved(ze(this,wa,"f").removeByKey(a.address.uuid)),n=a=>{let l=ze(this,rc,"f").boxAdapters.adapterFor(a.box,qn);ze(this,ba,"f").add(l)&&ze(this,Yn,"f").proxy.onConnectionAdded(l)},s=a=>ze(this,Yn,"f").proxy.onConnectionRemoved(ze(this,ba,"f").removeByKey(a.address.uuid));ze(this,kr,"f").modules.pointerHub.filter(u.ModuleCollection).forEach(o),ze(this,kr,"f").connections.pointerHub.filter(u.ConnectionCollection).forEach(n),ze(this,tc,"f").own(ze(this,kr,"f").modules.pointerHub.subscribe({onAdded:o,onRemoved:i},u.ModuleCollection)),ze(this,tc,"f").own(ze(this,kr,"f").connections.pointerHub.subscribe({onAdded:n,onRemoved:s},u.ConnectionCollection))}catchupAndSubscribe(e){return Ay(e.onModuleAdded,t=>ze(this,wa,"f").forEach(o=>t(o))),Ay(e.onConnectionAdded,t=>ze(this,ba,"f").forEach(o=>t(o))),ze(this,Yn,"f").subscribe(e)}get box(){return ze(this,kr,"f")}get address(){return ze(this,kr,"f").address}get uuid(){return ze(this,kr,"f").address.uuid}get editingField(){return ze(this,kr,"f").editing}get labelField(){return ze(this,kr,"f").label}get modules(){return ze(this,wa,"f").values()}get connections(){return ze(this,ba,"f").values()}get device(){return ze(this,rc,"f").boxAdapters.adapterFor(G(ze(this,kr,"f").device.pointerHub.incoming().at(0),"No device found").box,Qn)}terminate(){console.debug(`terminate ${this}`),ze(this,tc,"f").terminate()}};tc=new WeakMap,Yn=new WeakMap,rc=new WeakMap,kr=new WeakMap,wa=new WeakMap,ba=new WeakMap;var Id=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)},cx,oc,Td,fm,ic,Cd,mm,Md,gm,dP,lo=class{constructor(e,t){cx.add(this),this.type="groove-adapter",Td.set(this,new j),fm.set(this,void 0),ic.set(this,void 0),Cd.set(this,void 0),mm.set(this,new dp({duration:()=>nr(this,gm,"f"),fx:o=>Ny(o,nr(this,Md,"f")),fy:o=>Ny(o,1-nr(this,Md,"f"))})),Md.set(this,0),gm.set(this,Q.SemiQuaver*2),Id(this,fm,e,"f"),Id(this,ic,t,"f"),Id(this,Cd,nr(this,Td,"f").own(new pe(nr(this,fm,"f"))),"f"),this.namedParameter=nr(this,cx,"m",dP).call(this,t),nr(this,Td,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(o=>Id(this,gm,o.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(o=>Id(this,Md,o_(o.getValue(),.01),"f")))}unwarp(e){return nr(this,mm,"f").unwarp(e)}warp(e){return nr(this,mm,"f").warp(e)}get box(){return nr(this,ic,"f")}get uuid(){return nr(this,ic,"f").address.uuid}get address(){return nr(this,ic,"f").address}terminate(){nr(this,Td,"f").terminate()}};oc=lo,Td=new WeakMap,fm=new WeakMap,ic=new WeakMap,Cd=new WeakMap,mm=new WeakMap,Md=new WeakMap,gm=new WeakMap,cx=new WeakSet,dP=function(e){return{duration:nr(this,Cd,"f").createParameter(e.duration,F.values(oc.DurationPPQNs),S.values("",oc.DurationPPQNs,oc.DurationStrings),"duration"),amount:nr(this,Cd,"f").createParameter(e.amount,F.unipolar(),S.percent({fractionDigits:0}),"amount")}};lo.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];lo.DurationPPQNs=oc.Durations.map(([r,e])=>Q.fromSignature(r,e));lo.DurationStrings=oc.Durations.map(([r,e])=>`${r}/${e}`);var nc=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)},co,Xn,sc,vm,ym,Dd,Rd,ux,es=class{constructor(e,t,o,i,n){co.set(this,void 0),Xn.set(this,void 0),sc.set(this,void 0),vm.set(this,void 0),ym.set(this,void 0),Dd.set(this,new j),Rd.set(this,void 0),ux.set(this,m.None),nc(this,co,e,"f"),nc(this,Xn,t,"f"),nc(this,sc,o,"f"),nc(this,vm,i,"f"),nc(this,ym,n??0,"f"),nc(this,Rd,lt(this,Dd,"f").own(new te),"f"),lt(this,Dd,"f").own(lt(this,co,"f").subscribe(()=>lt(this,Rd,"f").notify(this))),e.getValue()!==t.clamp(e.getValue())&&console.warn(`${i} (${e.getValue()}) is out of bounds`,t)}get field(){return lt(this,co,"f")}get valueMapping(){return lt(this,Xn,"f")}get stringMapping(){return lt(this,sc,"f")}get name(){return lt(this,vm,"f")}get anchor(){return lt(this,ym,"f")}get type(){return lt(this,co,"f").type}get address(){return lt(this,co,"f").address}get track(){return lt(this,ux,"f")}subscribe(e){return lt(this,Rd,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return lt(this,co,"f").getValue()}setValue(e){lt(this,co,"f").setValue(lt(this,Xn,"f").clamp(e))}setUnitValue(e){this.setValue(lt(this,Xn,"f").y(e))}getUnitValue(){return lt(this,Xn,"f").x(this.getValue())}getPrintValue(){return lt(this,sc,"f").x(this.getValue())}setPrintValue(e){let t=lt(this,sc,"f").y(e);t.type==="unitValue"?this.setUnitValue(X(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(lt(this,Xn,"f").clamp(lt(this,co,"f").initValue))}terminate(){lt(this,Dd,"f").terminate()}};co=new WeakMap,Xn=new WeakMap,sc=new WeakMap,vm=new WeakMap,ym=new WeakMap,Dd=new WeakMap,Rd=new WeakMap,ux=new WeakMap;var ac=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},ni=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)},uo,xm,wm,bm,Am,_m,Pm=class{constructor(e){uo.set(this,void 0),xm.set(this,void 0),wm.set(this,void 0),bm.set(this,void 0),Am.set(this,void 0),_m.set(this,void 0),ac(this,uo,e,"f"),ac(this,xm,new es(ni(this,uo,"f").keyboard,F.values([88,76,61,49]),S.numeric({fractionDigits:1}),"Keyboard Type"),"f"),ac(this,wm,new es(ni(this,uo,"f").timeRangeInQuarters,F.exponential(1,64),S.numeric({fractionDigits:1}),"Time-Range"),"f"),ac(this,bm,new es(ni(this,uo,"f").noteScale,F.exponential(.5,2),S.numeric({fractionDigits:1}),"Note Scale"),"f"),ac(this,Am,new es(ni(this,uo,"f").noteLabels,F.bool,S.bool,"Note Labels"),"f"),ac(this,_m,new es(ni(this,uo,"f").transpose,F.linearInteger(-48,48),S.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return ni(this,uo,"f").box.subscribe(Be.Children,()=>e(this))}get object(){return ni(this,uo,"f")}get keyboard(){return ni(this,xm,"f")}get timeRangeInQuarters(){return ni(this,wm,"f")}get noteScale(){return ni(this,bm,"f")}get noteLabels(){return ni(this,Am,"f")}get transpose(){return ni(this,_m,"f")}};uo=new WeakMap,xm=new WeakMap,wm=new WeakMap,bm=new WeakMap,Am=new WeakMap,_m=new WeakMap;var Od=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},Ft=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)},Aa,Ir,lc,Em,Sm,cc=class{constructor(e,t){Aa.set(this,void 0),Ir.set(this,void 0),lc.set(this,void 0),Em.set(this,void 0),Sm.set(this,void 0),Od(this,Aa,e,"f"),Od(this,Ir,t,"f"),Od(this,lc,Ot.create(Ft(this,Ir,"f").audioUnits,o=>Ft(this,Aa,"f").boxAdapters.adapterFor(o,Yr),u.AudioUnits),"f"),Od(this,Em,new qf(Ft(this,Ir,"f").audioBusses.pointerHub,o=>Ft(this,Aa,"f").boxAdapters.adapterFor(o,ir),u.AudioBusses),"f"),Od(this,Sm,new Pm(Ft(this,Ir,"f").pianoMode),"f")}get uuid(){return Ft(this,Ir,"f").address.uuid}get address(){return Ft(this,Ir,"f").address}get box(){return Ft(this,Ir,"f")}get audioBusses(){return Ft(this,Em,"f")}get audioUnits(){return Ft(this,lc,"f")}get clips(){return Ft(this,lc,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return Ft(this,Aa,"f").boxAdapters.adapterFor(Ft(this,Ir,"f").groove.targetVertex.unwrap("no groove").box,lo)}get timeline(){return Ft(this,Aa,"f").boxAdapters.adapterFor(Ft(this,Ir,"f").timeline.targetVertex.unwrap("no timeline").box,ao)}get pianoMode(){return Ft(this,Sm,"f")}get created(){return new Date(Ft(this,Ir,"f").created.getValue())}get midiOutputDevices(){return Ft(this,Ir,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ee(e,Ei))}terminate(){Ft(this,lc,"f").terminate()}};Aa=new WeakMap,Ir=new WeakMap,lc=new WeakMap,Em=new WeakMap,Sm=new WeakMap;var dx=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)},hx,Vd,Ti,ts,hP,uc=class{constructor(e,t){hx.add(this),this.type="instrument",this.accepts="audio",Vd.set(this,void 0),Ti.set(this,void 0),ts.set(this,void 0),dx(this,Vd,e,"f"),dx(this,Ti,t,"f"),dx(this,ts,new pe(Gt(this,Vd,"f")),"f"),this.namedParameter=Gt(this,hx,"m",hP).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 labelField(){return Gt(this,Ti,"f").label}get iconField(){return Gt(this,Ti,"f").icon}get defaultTrackType(){return ee.Audio}get enabledField(){return Gt(this,Ti,"f").enabled}get minimizedField(){return Gt(this,Ti,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Gt(this,Vd,"f").boxAdapters.adapterFor(Gt(this,Ti,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Gt(this,ts,"f").terminate()}};Vd=new WeakMap,Ti=new WeakMap,ts=new WeakMap,hx=new WeakSet,hP=function(e){return{flutter:Gt(this,ts,"f").createParameter(e.flutter,F.unipolar(),S.percent(),"flutter"),wow:Gt(this,ts,"f").createParameter(e.wow,F.unipolar(),S.percent(),"wow"),noise:Gt(this,ts,"f").createParameter(e.noise,F.unipolar(),S.percent(),"noise"),saturation:Gt(this,ts,"f").createParameter(e.saturation,F.unipolar(),S.percent(),"saturation")}};var ho=(()=>{let t=[1,2,3,4],o=["12","24","36","48"],i=[Oe.sine,Oe.triangle,Oe.saw,Oe.square],n=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:F.exponential(20,2e4),CUTOFF_STRING_MAPPING:S.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:o,FILTER_ORDER_VALUE_MAPPING:F.values(t),FILTER_ORDER_STRING_MAPPING:S.values("db",t,o),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:n,LFO_WAVEFORM_VALUE_MAPPING:F.values(i),LFO_WAVEFORM_STRING_MAPPING:S.values("",i,n)}})();var px=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)},fx,zd,Mi,Re,pP,dc=class{constructor(e,t){fx.add(this),this.type="instrument",this.accepts="midi",zd.set(this,void 0),Mi.set(this,void 0),Re.set(this,void 0),px(this,zd,e,"f"),px(this,Mi,t,"f"),px(this,Re,new pe(_e(this,zd,"f")),"f"),this.namedParameter=_e(this,fx,"m",pP).call(this,t)}get box(){return _e(this,Mi,"f")}get uuid(){return _e(this,Mi,"f").address.uuid}get address(){return _e(this,Mi,"f").address}get labelField(){return _e(this,Mi,"f").label}get iconField(){return _e(this,Mi,"f").icon}get defaultTrackType(){return ee.Notes}get enabledField(){return _e(this,Mi,"f").enabled}get minimizedField(){return _e(this,Mi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return _e(this,zd,"f").boxAdapters.adapterFor(_e(this,Mi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){_e(this,Re,"f").terminate()}};zd=new WeakMap,Mi=new WeakMap,Re=new WeakMap,fx=new WeakSet,pP=function(e){let t=[Gi.Monophonic,Gi.Polyphonic];return{oscillators:e.oscillators.fields().map(o=>({waveform:_e(this,Re,"f").createParameter(o.waveform,F.linearInteger(0,3),S.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:_e(this,Re,"f").createParameter(o.volume,F.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:_e(this,Re,"f").createParameter(o.octave,F.linearInteger(-3,3),S.numeric({unit:"oct"}),"Octave",.5),tune:_e(this,Re,"f").createParameter(o.tune,F.linear(-1200,1200),S.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:_e(this,Re,"f").createParameter(e.noise.volume,F.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:_e(this,Re,"f").createParameter(e.noise.attack,F.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:_e(this,Re,"f").createParameter(e.noise.hold,F.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Hold"),release:_e(this,Re,"f").createParameter(e.noise.release,F.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:_e(this,Re,"f").createParameter(e.filterOrder,ho.FILTER_ORDER_VALUE_MAPPING,ho.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:_e(this,Re,"f").createParameter(e.cutoff,ho.CUTOFF_VALUE_MAPPING,ho.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:_e(this,Re,"f").createParameter(e.resonance,F.exponential(.01,10),S.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:_e(this,Re,"f").createParameter(e.attack,F.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:_e(this,Re,"f").createParameter(e.decay,F.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:_e(this,Re,"f").createParameter(e.sustain,F.unipolar(),S.percent({fractionDigits:1}),"Sustain"),release:_e(this,Re,"f").createParameter(e.release,F.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:_e(this,Re,"f").createParameter(e.filterEnvelope,F.bipolar(),S.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:_e(this,Re,"f").createParameter(e.filterKeyboard,F.bipolar(),S.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:_e(this,Re,"f").createParameter(e.voicingMode,F.values(t),S.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:_e(this,Re,"f").createParameter(e.glideTime,F.unipolar(),S.percent({fractionDigits:1}),"Glide time",0),unisonCount:_e(this,Re,"f").createParameter(e.unisonCount,F.values([1,3,5]),S.values("#",[1,3,5],[1,3,5].map(o=>String(o))),"Unisono",0),unisonDetune:_e(this,Re,"f").createParameter(e.unisonDetune,F.exponential(1,1200),S.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:_e(this,Re,"f").createParameter(e.unisonStereo,F.unipolar(),S.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:_e(this,Re,"f").createParameter(e.lfo.waveform,ho.LFO_WAVEFORM_VALUE_MAPPING,ho.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:_e(this,Re,"f").createParameter(e.lfo.rate,F.exponential(1e-4,30),S.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:_e(this,Re,"f").createParameter(e.lfo.targetTune,F.bipolar(),S.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:_e(this,Re,"f").createParameter(e.lfo.targetVolume,F.bipolar(),S.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:_e(this,Re,"f").createParameter(e.lfo.targetCutoff,F.bipolar(),S.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var mx=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},Bt=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)},gx,Nm,Ud,si,po,fP,Ci=class{constructor(e,t){gx.add(this),this.type="midi-effect",this.accepts="midi",Ud.set(this,void 0),si.set(this,void 0),po.set(this,void 0),mx(this,Ud,e,"f"),mx(this,si,t,"f"),mx(this,po,new pe(Bt(this,Ud,"f")),"f"),this.namedParameter=Bt(this,gx,"m",fP).call(this,t)}get box(){return Bt(this,si,"f")}get uuid(){return Bt(this,si,"f").address.uuid}get address(){return Bt(this,si,"f").address}get indexField(){return Bt(this,si,"f").index}get labelField(){return Bt(this,si,"f").label}get enabledField(){return Bt(this,si,"f").enabled}get minimizedField(){return Bt(this,si,"f").minimized}get host(){return Bt(this,si,"f").host}deviceHost(){return Bt(this,Ud,"f").boxAdapters.adapterFor(Bt(this,si,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Bt(this,po,"f").terminate()}};Nm=Ci,Ud=new WeakMap,si=new WeakMap,po=new WeakMap,gx=new WeakSet,fP=function(e){return{modeIndex:Bt(this,po,"f").createParameter(e.modeIndex,F.linearInteger(0,2),S.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:Bt(this,po,"f").createParameter(e.numOctaves,F.linearInteger(1,5),S.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Bt(this,po,"f").createParameter(e.rateIndex,F.linearInteger(0,Nm.RateFractions.length-1),Nm.RateStringMapping,"Rate"),gate:Bt(this,po,"f").createParameter(e.gate,F.linear(0,2),S.percent({fractionDigits:0}),"Gate"),repeat:Bt(this,po,"f").createParameter(e.repeat,F.linearInteger(1,16),S.numeric({fractionDigits:0}),"Repeat"),velocity:Bt(this,po,"f").createParameter(e.velocity,F.bipolar(),S.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Ci.RateFractions=Xt.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();Ci.RateStringMapping=S.indices("",Nm.RateFractions.map(([r,e])=>`${r}/${e}`));var vx=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},qt=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)},yx,jd,ai,_a,mP,hc=class{constructor(e,t){yx.add(this),this.type="midi-effect",this.accepts="midi",jd.set(this,void 0),ai.set(this,void 0),_a.set(this,void 0),vx(this,jd,e,"f"),vx(this,ai,t,"f"),vx(this,_a,new pe(qt(this,jd,"f")),"f"),this.namedParameter=qt(this,yx,"m",mP).call(this,t)}get box(){return qt(this,ai,"f")}get uuid(){return qt(this,ai,"f").address.uuid}get address(){return qt(this,ai,"f").address}get indexField(){return qt(this,ai,"f").index}get labelField(){return qt(this,ai,"f").label}get enabledField(){return qt(this,ai,"f").enabled}get minimizedField(){return qt(this,ai,"f").minimized}get host(){return qt(this,ai,"f").host}deviceHost(){return qt(this,jd,"f").boxAdapters.adapterFor(qt(this,ai,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){qt(this,_a,"f").terminate()}};jd=new WeakMap,ai=new WeakMap,_a=new WeakMap,yx=new WeakSet,mP=function(e){return{octaves:qt(this,_a,"f").createParameter(e.octaves,F.linearInteger(-7,7),S.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:qt(this,_a,"f").createParameter(e.semiTones,F.linearInteger(-36,36),S.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:qt(this,_a,"f").createParameter(e.cents,F.linear(-50,50),S.numeric({unit:"cents",fractionDigits:1}),"cents")}};var xx=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},fr=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)},wx,Ld,Di,pc,gP,fc=class{constructor(e,t){wx.add(this),this.type="instrument",this.accepts="midi",Ld.set(this,void 0),Di.set(this,void 0),pc.set(this,void 0),xx(this,Ld,e,"f"),xx(this,Di,t,"f"),xx(this,pc,new pe(fr(this,Ld,"f")),"f"),this.namedParameter=fr(this,wx,"m",gP).call(this,t)}get box(){return fr(this,Di,"f")}get uuid(){return fr(this,Di,"f").address.uuid}get address(){return fr(this,Di,"f").address}get labelField(){return fr(this,Di,"f").label}get iconField(){return fr(this,Di,"f").icon}get defaultTrackType(){return ee.Notes}get enabledField(){return fr(this,Di,"f").enabled}get minimizedField(){return fr(this,Di,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return fr(this,Ld,"f").boxAdapters.adapterFor(fr(this,Di,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){fr(this,pc,"f").terminate()}};Ld=new WeakMap,Di=new WeakMap,pc=new WeakMap,wx=new WeakSet,gP=function(e){return{volume:fr(this,pc,"f").createParameter(e.volume,F.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"volume"),release:fr(this,pc,"f").createParameter(e.release,F.exponential(.001,8),S.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)},bx,Pa,rs,me,Fm,Bm,Tr,gc,vP,vc=class{constructor(e,t){bx.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",Pa.set(this,new j),rs.set(this,void 0),me.set(this,void 0),Fm.set(this,void 0),Bm.set(this,void 0),Tr.set(this,void 0),gc.set(this,m.None),mc(this,rs,e,"f"),mc(this,me,t,"f"),mc(this,Fm,q(this,Pa,"f").own(Ot.create(q(this,me,"f").midiEffects,o=>q(this,rs,"f").boxAdapters.adapterFor(o,re.isMidiEffect),u.MidiEffectHost)),"f"),mc(this,Bm,q(this,Pa,"f").own(Ot.create(q(this,me,"f").audioEffects,o=>q(this,rs,"f").boxAdapters.adapterFor(o,re.isAudioEffect),u.AudioEffectHost)),"f"),mc(this,Tr,q(this,Pa,"f").own(new pe(q(this,rs,"f"))),"f"),this.namedParameter=q(this,bx,"m",vP).call(this,t),q(this,Pa,"f").own(q(this,me,"f").file.catchupAndSubscribe(o=>{mc(this,gc,o.targetVertex.map(({box:i})=>q(this,rs,"f").boxAdapters.adapterFor(i,Ji)),"f"),q(this,gc,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return q(this,me,"f")}get uuid(){return q(this,me,"f").address.uuid}get address(){return q(this,me,"f").address}get peakAddress(){return q(this,me,"f").address.append(1001)}get indexField(){return q(this,me,"f").index}get gate(){return q(this,me,"f").gate.getValue()}get exclude(){return q(this,me,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${q(this,gc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return q(this,me,"f").icon}get defaultTrackType(){return ee.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return q(this,me,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return q(this,me,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return q(this,gc,"f")}fileUUID(){return q(this,me,"f").file.targetAddress.unwrap().uuid}resetParameters(){q(this,me,"f").mute.reset(),q(this,me,"f").solo.reset(),q(this,me,"f").exclude.reset(),q(this,me,"f").polyphone.reset(),q(this,me,"f").pitch.reset(),q(this,me,"f").attack.reset(),q(this,me,"f").release.reset(),q(this,me,"f").sampleStart.reset(),q(this,me,"f").sampleEnd.reset(),q(this,me,"f").gate.reset()}copyToIndex(e){_n.create(q(this,me,"f").graph,b.generate(),t=>{t.file.refer(q(this,me,"f").file.targetVertex.unwrap()),t.device.refer(q(this,me,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(q(this,me,"f").mute.getValue()),t.solo.setValue(q(this,me,"f").solo.getValue()),t.sampleStart.setValue(q(this,me,"f").sampleStart.getValue()),t.sampleEnd.setValue(q(this,me,"f").sampleEnd.getValue()),t.attack.setValue(q(this,me,"f").attack.getValue()),t.release.setValue(q(this,me,"f").release.getValue()),t.pitch.setValue(q(this,me,"f").pitch.getValue()),t.exclude.setValue(q(this,me,"f").exclude.getValue()),t.gate.setValue(q(this,me,"f").gate.getValue())})}get midiEffects(){return q(this,Fm,"f")}get inputAdapter(){return m.wrap(this)}get audioEffects(){return q(this,Bm,"f")}get labelField(){return q(this,me,"f").label}get enabledField(){return q(this,me,"f").enabled}get minimizedField(){return q(this,me,"f").minimized}device(){return q(this,rs,"f").boxAdapters.adapterFor(q(this,me,"f").device.targetVertex.unwrap().box,is)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){q(this,Pa,"f").terminate()}};Pa=new WeakMap,rs=new WeakMap,me=new WeakMap,Fm=new WeakMap,Bm=new WeakMap,Tr=new WeakMap,gc=new WeakMap,bx=new WeakSet,vP=function(e){return{gate:q(this,Tr,"f").createParameter(e.gate,F.linearInteger(0,2),S.indices("",["Off","On","Loop"]),"Gate"),mute:q(this,Tr,"f").createParameter(e.mute,F.bool,S.bool,"Mute"),solo:q(this,Tr,"f").createParameter(e.solo,F.bool,S.bool,"Solo"),polyphone:q(this,Tr,"f").createParameter(e.polyphone,F.bool,S.bool,"Polyphone"),exclude:q(this,Tr,"f").createParameter(e.exclude,F.bool,S.bool,"Exclude"),pitch:q(this,Tr,"f").createParameter(e.pitch,F.linear(-1200,1200),S.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:q(this,Tr,"f").createParameter(e.sampleStart,F.unipolar(),S.percent(),"Start",0),sampleEnd:q(this,Tr,"f").createParameter(e.sampleEnd,F.unipolar(),S.percent(),"End",1),attack:q(this,Tr,"f").createParameter(e.attack,F.exponential(.001,5),S.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:q(this,Tr,"f").createParameter(e.release,F.exponential(.001,5),S.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var $m=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},mr=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)},yc,Ri,Kd,km,is=class{constructor(e,t){this.type="instrument",this.accepts="midi",yc.set(this,void 0),Ri.set(this,void 0),Kd.set(this,void 0),km.set(this,void 0),$m(this,yc,e,"f"),$m(this,Ri,t,"f"),$m(this,Kd,Ot.create(t.samples,o=>e.boxAdapters.adapterFor(o,vc),u.Sample),"f"),$m(this,km,new pe(mr(this,yc,"f")),"f")}reset(){mr(this,Kd,"f").adapters().forEach(e=>e.box.delete())}get box(){return mr(this,Ri,"f")}get uuid(){return mr(this,Ri,"f").address.uuid}get address(){return mr(this,Ri,"f").address}get labelField(){return mr(this,Ri,"f").label}get iconField(){return mr(this,Ri,"f").icon}get defaultTrackType(){return ee.Notes}get enabledField(){return mr(this,Ri,"f").enabled}get minimizedField(){return mr(this,Ri,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return mr(this,Kd,"f")}get context(){return mr(this,yc,"f")}deviceHost(){return mr(this,yc,"f").boxAdapters.adapterFor(mr(this,Ri,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){mr(this,km,"f").terminate()}};yc=new WeakMap,Ri=new WeakMap,Kd=new WeakMap,km=new WeakMap;var Ax=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},$t=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)},_x,Wd,li,fo,yP,xc=class{constructor(e,t){_x.add(this),this.type="audio-effect",this.accepts="audio",Wd.set(this,void 0),li.set(this,void 0),fo.set(this,void 0),Ax(this,Wd,e,"f"),Ax(this,li,t,"f"),Ax(this,fo,new pe($t(this,Wd,"f")),"f"),this.namedParameter=$t(this,_x,"m",yP).call(this,t)}get box(){return $t(this,li,"f")}get uuid(){return $t(this,li,"f").address.uuid}get address(){return $t(this,li,"f").address}get indexField(){return $t(this,li,"f").index}get labelField(){return $t(this,li,"f").label}get enabledField(){return $t(this,li,"f").enabled}get minimizedField(){return $t(this,li,"f").minimized}get host(){return $t(this,li,"f").host}deviceHost(){return $t(this,Wd,"f").boxAdapters.adapterFor($t(this,li,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){$t(this,fo,"f").terminate()}};Wd=new WeakMap,li=new WeakMap,fo=new WeakMap,_x=new WeakSet,yP=function(e){return{volume:$t(this,fo,"f").createParameter(e.volume,F.decibel(-72,0,12),S.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:$t(this,fo,"f").createParameter(e.panning,F.bipolar(),S.panning,"Panning",.5),stereo:$t(this,fo,"f").createParameter(e.stereo,F.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:$t(this,fo,"f").createParameter(e.invertL,F.bool,S.bool,"Invert Left"),invertR:$t(this,fo,"f").createParameter(e.invertR,F.bool,S.bool,"Invert Right"),swap:$t(this,fo,"f").createParameter(e.swap,F.bool,S.bool,"Swap")}};var Ea;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(Ea||(Ea={}));var xP=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)},wc,vr,bc=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",wc.set(this,void 0),vr.set(this,void 0),xP(this,wc,e,"f"),xP(this,vr,t,"f"),this.groove()}get box(){return gr(this,vr,"f")}get uuid(){return gr(this,vr,"f").address.uuid}get address(){return gr(this,vr,"f").address}get indexField(){return gr(this,vr,"f").index}get labelField(){return gr(this,vr,"f").label}get enabledField(){return gr(this,vr,"f").enabled}get minimizedField(){return gr(this,vr,"f").minimized}get host(){return gr(this,vr,"f").host}deviceHost(){return gr(this,wc,"f").boxAdapters.adapterFor(gr(this,vr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}groove(){return gr(this,wc,"f").boxAdapters.adapterFor(gr(this,vr,"f").groove.targetVertex.unwrap("no groove").box,Ea.checkType)}catchupAndSubscribeGroove(e){return gr(this,vr,"f").groove.catchupAndSubscribe(t=>e(gr(this,wc,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,Ea.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};wc=new WeakMap,vr=new WeakMap;var wP=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},Oi=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)},Im,Mr,Ac=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",Im.set(this,void 0),Mr.set(this,void 0),wP(this,Im,e,"f"),wP(this,Mr,t,"f")}get box(){return Oi(this,Mr,"f")}get uuid(){return Oi(this,Mr,"f").address.uuid}get address(){return Oi(this,Mr,"f").address}get indexField(){return Oi(this,Mr,"f").index}get labelField(){return Oi(this,Mr,"f").label}get enabledField(){return Oi(this,Mr,"f").enabled}get minimizedField(){return Oi(this,Mr,"f").minimized}get host(){return Oi(this,Mr,"f").host}get commentField(){return Oi(this,Mr,"f").comment}deviceHost(){return Oi(this,Im,"f").boxAdapters.adapterFor(Oi(this,Mr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Im=new WeakMap,Mr=new WeakMap;var bP=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},Vi=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)},Tm,Cr,_c=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",Tm.set(this,void 0),Cr.set(this,void 0),bP(this,Tm,e,"f"),bP(this,Cr,t,"f")}get box(){return Vi(this,Cr,"f")}get uuid(){return Vi(this,Cr,"f").address.uuid}get address(){return Vi(this,Cr,"f").address}get indexField(){return Vi(this,Cr,"f").index}get labelField(){return Vi(this,Cr,"f").label}get enabledField(){return Vi(this,Cr,"f").enabled}get minimizedField(){return Vi(this,Cr,"f").minimized}get host(){return Vi(this,Cr,"f").host}get commentField(){return Vi(this,Cr,"f").comment}deviceHost(){return Vi(this,Tm,"f").boxAdapters.adapterFor(Vi(this,Cr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Tm=new WeakMap,Cr=new WeakMap;var os=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)},Px,Ex,Zd,yr,Mm,Pc,zi,ci,Ec,AP,Sx,Sc=class{constructor(e,t){Px.add(this),this.type="instrument",this.accepts="midi",Ex.set(this,new j),Zd.set(this,void 0),yr.set(this,void 0),Mm.set(this,void 0),Pc.set(this,void 0),zi.set(this,void 0),ci.set(this,void 0),Ec.set(this,W.Empty),Sx.set(this,o=>o.match({none:()=>{Pe(this,ci,"f").clear(),Pe(this,zi,"f").clear()},some:i=>i.soundfont.match({none:()=>{Pe(this,ci,"f").clear(),Pe(this,zi,"f").clear(),Pe(this,Ec,"f").terminate(),os(this,Ec,i.subscribe(n=>{if(n.type==="loaded"){let s=i.soundfont.unwrap();Pe(this,ci,"f").wrap(s.presets[this.presetIndex]??s.presets[0]),Pe(this,zi,"f").wrap(s)}else n.type==="error"?(Pe(this,ci,"f").clear(),Pe(this,zi,"f").clear()):n.type==="idle"&&(Pe(this,ci,"f").clear(),Pe(this,zi,"f").clear())}),"f")},some:n=>{Pe(this,zi,"f").wrap(n),Pe(this,ci,"f").wrap(n.presets[this.presetIndex]??n.presets[0])}})})),os(this,Zd,e,"f"),os(this,yr,t,"f"),os(this,Mm,new pe(Pe(this,Zd,"f")),"f"),this.namedParameter=Pe(this,Px,"m",AP).call(this,t),os(this,Pc,new an,"f"),os(this,zi,new an,"f"),os(this,ci,new an,"f"),Pe(this,Ex,"f").ownAll(Pe(this,Pc,"f").subscribe(Pe(this,Sx,"f")),Pe(this,yr,"f").file.catchupAndSubscribe(({targetVertex:o})=>Pe(this,Pc,"f").wrapOption(o.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Pe(this,yr,"f").presetIndex.catchupAndSubscribe(o=>Pe(this,zi,"f").match({none:()=>Pe(this,ci,"f").clear(),some:i=>Pe(this,ci,"f").wrap(i.presets[o.getValue()]??i.presets[0])})))}get loader(){return Pe(this,Pc,"f")}get soundfont(){return Pe(this,zi,"f")}get preset(){return Pe(this,ci,"f")}get presetIndex(){return Pe(this,yr,"f").presetIndex.getValue()}get box(){return Pe(this,yr,"f")}get uuid(){return Pe(this,yr,"f").address.uuid}get address(){return Pe(this,yr,"f").address}get labelField(){return Pe(this,yr,"f").label}get iconField(){return Pe(this,yr,"f").icon}get defaultTrackType(){return ee.Notes}get enabledField(){return Pe(this,yr,"f").enabled}get minimizedField(){return Pe(this,yr,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Pe(this,Zd,"f").boxAdapters.adapterFor(Pe(this,yr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pe(this,Ec,"f").terminate(),os(this,Ec,W.Empty,"f"),Pe(this,Mm,"f").terminate()}};Ex=new WeakMap,Zd=new WeakMap,yr=new WeakMap,Mm=new WeakMap,Pc=new WeakMap,zi=new WeakMap,ci=new WeakMap,Ec=new WeakMap,Sx=new WeakMap,Px=new WeakSet,AP=function(e){return{}};var _P=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},Gd=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)},Cm,Sa,Dm=class{constructor(e,t){Cm.set(this,void 0),Sa.set(this,void 0),_P(this,Cm,e,"f"),_P(this,Sa,t,"f")}get box(){return Gd(this,Sa,"f")}get uuid(){return Gd(this,Sa,"f").address.uuid}get address(){return Gd(this,Sa,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Gd(this,Cm,"f").soundfontManager.getOrCreate(Gd(this,Sa,"f").address.uuid)}terminate(){}};Cm=new WeakMap,Sa=new WeakMap;var Nx=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},tt=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)},Fx,qd,ui,Ht,PP,Nc=class{constructor(e,t){Fx.add(this),this.type="audio-effect",this.accepts="audio",qd.set(this,void 0),ui.set(this,void 0),Ht.set(this,void 0),Nx(this,qd,e,"f"),Nx(this,ui,t,"f"),Nx(this,Ht,new pe(tt(this,qd,"f")),"f"),this.namedParameter=tt(this,Fx,"m",PP).call(this,t)}get box(){return tt(this,ui,"f")}get uuid(){return tt(this,ui,"f").address.uuid}get address(){return tt(this,ui,"f").address}get indexField(){return tt(this,ui,"f").index}get labelField(){return tt(this,ui,"f").label}get enabledField(){return tt(this,ui,"f").enabled}get minimizedField(){return tt(this,ui,"f").minimized}get host(){return tt(this,ui,"f").host}deviceHost(){return tt(this,qd,"f").boxAdapters.adapterFor(tt(this,ui,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){tt(this,Ht,"f").terminate()}};qd=new WeakMap,ui=new WeakMap,Ht=new WeakMap,Fx=new WeakSet,PP=function(e){return{lookahead:tt(this,Ht,"f").createParameter(e.lookahead,F.bool,S.bool,"Lookahead"),automakeup:tt(this,Ht,"f").createParameter(e.automakeup,F.bool,S.bool,"Auto Makeup"),autoattack:tt(this,Ht,"f").createParameter(e.autoattack,F.bool,S.bool,"Auto Attack"),autorelease:tt(this,Ht,"f").createParameter(e.autorelease,F.bool,S.bool,"Auto Release"),inputgain:tt(this,Ht,"f").createParameter(e.inputgain,F.linear(-30,30),S.decible,"Input Gain"),threshold:tt(this,Ht,"f").createParameter(e.threshold,F.linear(-60,0),S.decible,"Threshold"),ratio:tt(this,Ht,"f").createParameter(e.ratio,F.exponential(1,24),S.numeric({fractionDigits:1}),"Ratio"),knee:tt(this,Ht,"f").createParameter(e.knee,F.linear(0,24),S.decible,"Knee"),attack:tt(this,Ht,"f").createParameter(e.attack,F.linear(0,100),S.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:tt(this,Ht,"f").createParameter(e.release,F.linear(5,1500),S.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:tt(this,Ht,"f").createParameter(e.makeup,F.linear(-40,40),S.decible,"Makeup Gain"),mix:tt(this,Ht,"f").createParameter(e.mix,F.unipolar(),S.percent(),"Dry/Wet")}};var Bx=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)},$x,Hd,di,ns,EP,Fc=class{constructor(e,t){$x.add(this),this.type="audio-effect",this.accepts="audio",Hd.set(this,void 0),di.set(this,void 0),ns.set(this,void 0),Bx(this,Hd,e,"f"),Bx(this,di,t,"f"),Bx(this,ns,new pe(jt(this,Hd,"f")),"f"),this.namedParameter=jt(this,$x,"m",EP).call(this,t)}get box(){return jt(this,di,"f")}get uuid(){return jt(this,di,"f").address.uuid}get address(){return jt(this,di,"f").address}get indexField(){return jt(this,di,"f").index}get labelField(){return jt(this,di,"f").label}get enabledField(){return jt(this,di,"f").enabled}get minimizedField(){return jt(this,di,"f").minimized}get host(){return jt(this,di,"f").host}deviceHost(){return jt(this,Hd,"f").boxAdapters.adapterFor(jt(this,di,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){jt(this,ns,"f").terminate()}};Hd=new WeakMap,di=new WeakMap,ns=new WeakMap,$x=new WeakSet,EP=function(e){return{crush:jt(this,ns,"f").createParameter(e.crush,F.unipolar(),S.percent(),"Crush"),bits:jt(this,ns,"f").createParameter(e.bits,F.linearInteger(1,16),S.numeric(),"Bits"),boost:jt(this,ns,"f").createParameter(e.boost,F.linear(0,24),S.decible,"Boost"),mix:jt(this,ns,"f").createParameter(e.mix,F.exponential(.001,1),S.percent(),"Mix")}};var kx=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)},Ix,Jd,hi,Bc,SP,$c=class{constructor(e,t){Ix.add(this),this.type="audio-effect",this.accepts="audio",Jd.set(this,void 0),hi.set(this,void 0),Bc.set(this,void 0),kx(this,Jd,e,"f"),kx(this,hi,t,"f"),kx(this,Bc,new pe(sr(this,Jd,"f")),"f"),this.namedParameter=sr(this,Ix,"m",SP).call(this,t)}get box(){return sr(this,hi,"f")}get uuid(){return sr(this,hi,"f").address.uuid}get address(){return sr(this,hi,"f").address}get indexField(){return sr(this,hi,"f").index}get labelField(){return sr(this,hi,"f").label}get enabledField(){return sr(this,hi,"f").enabled}get minimizedField(){return sr(this,hi,"f").minimized}get host(){return sr(this,hi,"f").host}deviceHost(){return sr(this,Jd,"f").boxAdapters.adapterFor(sr(this,hi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){sr(this,Bc,"f").terminate()}};Jd=new WeakMap,hi=new WeakMap,Bc=new WeakMap,Ix=new WeakSet,SP=function(e){return{drive:sr(this,Bc,"f").createParameter(e.drive,F.linear(0,30),S.decible,"Drive"),volume:sr(this,Bc,"f").createParameter(e.volume,F.linear(-18,0),S.decible,"Volume")}};var Rm=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},bt=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)},Qd,Yd,pi,kc,Ic,Tc=class{constructor(e,t){Qd.set(this,new j),this.type="instrument",this.accepts="midi",Yd.set(this,void 0),pi.set(this,void 0),kc.set(this,void 0),Ic.set(this,void 0),Rm(this,Yd,e,"f"),Rm(this,pi,t,"f"),Rm(this,kc,new an,"f"),Rm(this,Ic,bt(this,Qd,"f").own(new pe(bt(this,Yd,"f"))),"f"),bt(this,Qd,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:o})=>bt(this,Ic,"f").createParameter(Ee(o,Si).value,F.unipolar(),S.percent({fractionDigits:1}),"",0)),onRemoved:(({box:o})=>bt(this,Ic,"f").removeParameter(Ee(o,Si).value.address))}),bt(this,pi,"f").device.catchupAndSubscribe(({targetVertex:o})=>o.match({none:()=>bt(this,kc,"f").clear(),some:({box:i})=>bt(this,kc,"f").wrap(Ee(i,Ei))})))}get box(){return bt(this,pi,"f")}get uuid(){return bt(this,pi,"f").address.uuid}get address(){return bt(this,pi,"f").address}get labelField(){return bt(this,pi,"f").label}get iconField(){return bt(this,pi,"f").icon}get defaultTrackType(){return ee.Notes}get enabledField(){return bt(this,pi,"f").enabled}get minimizedField(){return bt(this,pi,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return bt(this,Ic,"f")}get midiDevice(){return bt(this,kc,"f")}deviceHost(){return bt(this,Yd,"f").boxAdapters.adapterFor(bt(this,pi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){bt(this,Qd,"f").terminate()}};Qd=new WeakMap,Yd=new WeakMap,pi=new WeakMap,kc=new WeakMap,Ic=new WeakMap;var Om=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},ft=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)},Tx,Xd,fi,mo,eh,NP,Mc=class{constructor(e,t){Tx.add(this),this.type="midi-effect",this.accepts="midi",Xd.set(this,void 0),fi.set(this,void 0),mo.set(this,void 0),eh.set(this,void 0),Om(this,Xd,e,"f"),Om(this,fi,t,"f"),Om(this,mo,new pe(ft(this,Xd,"f")),"f"),Om(this,eh,La.create(),"f"),this.namedParameter=ft(this,Tx,"m",NP).call(this,t)}computeVelocity(e,t){let{magnetPosition:o,magnetStrength:i,randomSeed:n,randomAmount:s,offset:a,mix:l}=this.namedParameter;ft(this,eh,"f").setSeed(n.valueAt(e)+e);let c=t+(o.valueAt(e)-t)*i.valueAt(e),d=(ft(this,eh,"f").uniform()*2-1)*s.valueAt(e),h=a.valueAt(e),f=l.valueAt(e);return t*(1-f)+zr(c+d+h)*f}get box(){return ft(this,fi,"f")}get uuid(){return ft(this,fi,"f").address.uuid}get address(){return ft(this,fi,"f").address}get indexField(){return ft(this,fi,"f").index}get labelField(){return ft(this,fi,"f").label}get enabledField(){return ft(this,fi,"f").enabled}get minimizedField(){return ft(this,fi,"f").minimized}get host(){return ft(this,fi,"f").host}deviceHost(){return ft(this,Xd,"f").boxAdapters.adapterFor(ft(this,fi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){ft(this,mo,"f").terminate()}};Xd=new WeakMap,fi=new WeakMap,mo=new WeakMap,eh=new WeakMap,Tx=new WeakSet,NP=function(e){return{magnetPosition:ft(this,mo,"f").createParameter(e.magnetPosition,F.unipolar(),S.percent(),"Position"),magnetStrength:ft(this,mo,"f").createParameter(e.magnetStrength,F.unipolar(),S.percent(),"Strength"),randomSeed:ft(this,mo,"f").createParameter(e.randomSeed,F.linearInteger(0,65535),S.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:ft(this,mo,"f").createParameter(e.randomAmount,F.unipolar(),S.percent(),"Amount"),offset:ft(this,mo,"f").createParameter(e.offset,F.bipolar(),S.percent(),"Offset"),mix:ft(this,mo,"f").createParameter(e.mix,F.unipolar(),S.percent(),"Mix")}};var Mx=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)},Cx,Dx,th,mi,go,FP,Ui=class{constructor(e,t){Cx.add(this),this.type="audio-effect",this.accepts="audio",th.set(this,void 0),mi.set(this,void 0),go.set(this,void 0),Mx(this,th,e,"f"),Mx(this,mi,t,"f"),Mx(this,go,new pe(kt(this,th,"f")),"f"),this.namedParameter=kt(this,Cx,"m",FP).call(this,t)}get box(){return kt(this,mi,"f")}get uuid(){return kt(this,mi,"f").address.uuid}get address(){return kt(this,mi,"f").address}get indexField(){return kt(this,mi,"f").index}get labelField(){return kt(this,mi,"f").label}get enabledField(){return kt(this,mi,"f").enabled}get minimizedField(){return kt(this,mi,"f").minimized}get host(){return kt(this,mi,"f").host}deviceHost(){return kt(this,th,"f").boxAdapters.adapterFor(kt(this,mi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){kt(this,go,"f").terminate()}};Dx=Ui,th=new WeakMap,mi=new WeakMap,go=new WeakMap,Cx=new WeakSet,FP=function(e){let{RateFractions:t,RateStringMapping:o}=Dx;return{slope:kt(this,go,"f").createParameter(e.slope,F.bipolar(),S.percent({fractionDigits:1}),"Slope",.5),symmetry:kt(this,go,"f").createParameter(e.symmetry,F.unipolar(),S.percent({fractionDigits:1}),"Symmetry",.5),rate:kt(this,go,"f").createParameter(e.rate,F.values(t.map((i,n)=>n)),o,"Rate",0),depth:kt(this,go,"f").createParameter(e.depth,F.unipolar(),S.percent({fractionDigits:1}),"Depth",0),offset:kt(this,go,"f").createParameter(e.offset,F.linear(-180,180),S.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:kt(this,go,"f").createParameter(e.channelOffset,F.linear(-180,180),S.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Ui.RateFractions=Xt.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();Ui.RateStringMapping=S.indices("",Dx.RateFractions.map(([r,e])=>`${r}/${e}`));var Vm=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},Y=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)},Rx,oe,Ho,rh,zm,BP,Um=class{constructor(e){Rx.add(this),oe.set(this,void 0),Ho.set(this,void 0),rh.set(this,void 0),zm.set(this,void 0),Vm(this,oe,e,"f"),Vm(this,Ho,b.newSet(t=>t.uuid),"f"),Vm(this,rh,new Set,"f"),Vm(this,zm,Y(this,oe,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let o=Y(this,Ho,"f").getOrNull(t.uuid);R(o)&&(Y(this,rh,"f").add(o.box),Y(this,Ho,"f").removeByValue(o).terminate())}}}),"f")}terminate(){Y(this,Ho,"f").values().forEach(e=>e.terminate()),Y(this,Ho,"f").clear(),Y(this,zm,"f").terminate()}adapterFor(e,t){if(Y(this,rh,"f").has(e))return P(`Cannot resolve adapter for already deleted box: ${e}`);let o=Y(this,Ho,"f").getOrNull(e.address.uuid);if(o===null){o=Y(this,Rx,"m",BP).call(this,e);let i=Y(this,Ho,"f").add(o);B(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?o instanceof t?o:P(`${o} is not instance of ${t}`):t(o)?o:P(`${o} did not pass custom type guard`):P("Unknown checkType method")}};oe=new WeakMap,Ho=new WeakMap,rh=new WeakMap,zm=new WeakMap,Rx=new WeakSet,BP=function(e){return G(e.accept({visitArpeggioDeviceBox:t=>new Ci(Y(this,oe,"f"),t),visitAudioBusBox:t=>new ir(Y(this,oe,"f"),t),visitAudioClipBox:t=>new $n(Y(this,oe,"f"),t),visitAudioFileBox:t=>new Ji(Y(this,oe,"f"),t),visitAudioRegionBox:t=>new On(Y(this,oe,"f"),t),visitAudioUnitBox:t=>new Yr(Y(this,oe,"f"),t),visitAuxSendBox:t=>new Ol(Y(this,oe,"f"),t),visitCompressorDeviceBox:t=>new Nc(Y(this,oe,"f"),t),visitCrusherDeviceBox:t=>new Fc(Y(this,oe,"f"),t),visitDelayDeviceBox:t=>new ei(Y(this,oe,"f"),t),visitDeviceInterfaceKnobBox:t=>new Xl(Y(this,oe,"f"),t),visitTidalDeviceBox:t=>new Ui(Y(this,oe,"f"),t),visitFoldDeviceBox:t=>new $c(Y(this,oe,"f"),t),visitGrooveShuffleBox:t=>new lo(Y(this,oe,"f"),t),visitMarkerBox:t=>new Zn(Y(this,oe,"f"),t),visitMIDIOutputDeviceBox:t=>new Tc(Y(this,oe,"f"),t),visitModularAudioInputBox:t=>new Ql(Y(this,oe,"f"),t),visitModularAudioOutputBox:t=>new ql(Y(this,oe,"f"),t),visitModularBox:t=>new Hn(Y(this,oe,"f"),t),visitModularDeviceBox:t=>new Qn(Y(this,oe,"f"),t),visitModuleConnectionBox:t=>new qn(Y(this,oe,"f"),t),visitModuleDelayBox:t=>new Gl(Y(this,oe,"f"),t),visitModuleGainBox:t=>new Hl(Y(this,oe,"f"),t),visitModuleMultiplierBox:t=>new Jl(Y(this,oe,"f"),t),visitNanoDeviceBox:t=>new fc(Y(this,oe,"f"),t),visitNoteClipBox:t=>new Pl(Y(this,oe,"f"),t),visitNoteEventBox:t=>new Zs(Y(this,oe,"f"),t),visitNoteEventCollectionBox:t=>new Gr(Y(this,oe,"f"),t),visitNoteRegionBox:t=>new Vn(Y(this,oe,"f"),t),visitPitchDeviceBox:t=>new hc(Y(this,oe,"f"),t),visitPlayfieldDeviceBox:t=>new is(Y(this,oe,"f"),t),visitPlayfieldSampleBox:t=>new vc(Y(this,oe,"f"),t),visitRevampDeviceBox:t=>new Wl(Y(this,oe,"f"),t),visitReverbDeviceBox:t=>new Kl(Y(this,oe,"f"),t),visitRootBox:t=>new cc(Y(this,oe,"f"),t),visitSoundfontDeviceBox:t=>new Sc(Y(this,oe,"f"),t),visitSoundfontFileBox:t=>new Dm(Y(this,oe,"f"),t),visitStereoToolDeviceBox:t=>new xc(Y(this,oe,"f"),t),visitTapeDeviceBox:t=>new uc(Y(this,oe,"f"),t),visitTimelineBox:t=>new ao(Y(this,oe,"f"),t),visitTrackBox:t=>new ut(Y(this,oe,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new Ac(Y(this,oe,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new _c(Y(this,oe,"f"),t),visitValueClipBox:t=>new Bn(Y(this,oe,"f"),t),visitValueEventBox:t=>new To(Y(this,oe,"f"),t),visitValueEventCollectionBox:t=>new Wr(Y(this,oe,"f"),t),visitValueRegionBox:t=>new jo(Y(this,oe,"f"),t),visitVaporisateurDeviceBox:t=>new dc(Y(this,oe,"f"),t),visitVelocityDeviceBox:t=>new Mc(Y(this,oe,"f"),t),visitZeitgeistDeviceBox:t=>new bc(Y(this,oe,"f"),t)}),`Could not find factory for ${e}`)};var $P;(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))})}})($P||($P={}));var kP=lr.createBuilder({position:lr.float,playbackTimestamp:lr.float,countInBeatsRemaining:lr.float,isPlaying:lr.bool,isCountingIn:lr.bool,isRecording:lr.bool});var Ox=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},ss=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)},jm,Lm,Km,Na,gi=class{constructor(e,t){jm.set(this,new j),Lm.set(this,void 0),Km.set(this,void 0),Na.set(this,void 0),Ox(this,Lm,e,"f"),Ox(this,Km,t,"f"),Ox(this,Na,new ot(128),"f"),ss(this,jm,"f").own(ss(this,Lm,"f").broadcastIntegers(ss(this,Km,"f"),new Int32Array(ss(this,Na,"f").buffer),Vr))}noteOn(e){e>=0&&e<128&&ss(this,Na,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&ss(this,Na,"f").setBit(e,!1)}reset(){}clear(){ss(this,Na,"f").clear()}terminate(){ss(this,jm,"f").terminate()}toString(){return`{${this.constructor.name}}`}};jm=new WeakMap,Lm=new WeakMap,Km=new WeakMap,Na=new WeakMap;var Jo;(function(r){r[r.MTHD=1297377380]="MTHD",r[r.MTRK=1297379947]="MTRK"})(Jo||(Jo={}));var Lt;(function(r){r[r.NOTE_ON=144]="NOTE_ON",r[r.NOTE_OFF=128]="NOTE_OFF",r[r.NOTE_AFTER_TOUCH=160]="NOTE_AFTER_TOUCH",r[r.CONTROLLER=176]="CONTROLLER",r[r.PROGRAM_CHANGE=192]="PROGRAM_CHANGE",r[r.CHANNEL_AFTER_TOUCH=208]="CHANNEL_AFTER_TOUCH",r[r.PITCH_BEND=224]="PITCH_BEND"})(Lt||(Lt={}));var Wm=class r{ticks;type;param0;param1;static Comparator=(e,t)=>e.ticks-t.ticks;constructor(e,t,o,i){this.ticks=e,this.type=t,this.param0=o,this.param1=i}static decode(e,t,o){switch(t){case Lt.NOTE_ON:case Lt.NOTE_OFF:case Lt.CONTROLLER:case Lt.PITCH_BEND:case Lt.NOTE_AFTER_TOUCH:return new r(o,t,e.readByte(),e.readByte());case Lt.PROGRAM_CHANGE:case Lt.CHANNEL_AFTER_TOUCH:return new r(o,t,e.readByte(),0)}{let i;do i=e.readByte()&255;while(i<128);e.skip(-1)}return null}accept(e){switch(this.type){case Lt.NOTE_ON:{this.param1===0?A(e.noteOff,this.param0):A(e.noteOn,this.param0,this.param1/127);break}case Lt.NOTE_OFF:{A(e.noteOff,this.param0);break}case Lt.PITCH_BEND:{let t=this.param0&127,o=this.param1&127,i=t|o<<7;A(e.pitchBend,8192>=i?i/8192-1:(i-8191)/8192);break}case Lt.CONTROLLER:{A(e.controller,this.param0,this.param1/127);break}default:break}}toString(){return`ControlEvent{ticks: ${this.ticks}, type: ${this.type}, param0: ${this.param0}, param1: ${this.param1}}`}};var At;(function(r){r[r.SEQUENCE_NUMBER=0]="SEQUENCE_NUMBER",r[r.TEXT_EVENT=1]="TEXT_EVENT",r[r.COPYRIGHT_NOTICE=2]="COPYRIGHT_NOTICE",r[r.SEQUENCE_TRACK_NAME=3]="SEQUENCE_TRACK_NAME",r[r.INSTRUMENT_NAME=4]="INSTRUMENT_NAME",r[r.LYRICS=5]="LYRICS",r[r.MARKER=6]="MARKER",r[r.CUE_POINT=7]="CUE_POINT",r[r.CHANNEL_PREFIX=32]="CHANNEL_PREFIX",r[r.SET_TEMPO=81]="SET_TEMPO",r[r.SMPTE_OFFSET=84]="SMPTE_OFFSET",r[r.TIME_SIGNATURE=88]="TIME_SIGNATURE",r[r.KEY_SIGNATURE=89]="KEY_SIGNATURE",r[r.SEQUENCER_SPECIFIC=127]="SEQUENCER_SPECIFIC",r[r.PREFIX_PORT=33]="PREFIX_PORT",r[r.END_OF_TRACK=47]="END_OF_TRACK"})(At||(At={}));var Zm=class r{ticks;type;value;constructor(e,t,o){this.ticks=e,this.type=t,this.value=o}static decode(e,t){let o=e.readByte()&255,i=e.readVarLen();switch(o){case At.SET_TEMPO:return new r(t,o,e.readTempo());case At.TIME_SIGNATURE:return new r(t,o,e.readSignature());case At.END_OF_TRACK:return new r(t,o,null);case At.TEXT_EVENT:case At.COPYRIGHT_NOTICE:case At.SEQUENCE_TRACK_NAME:case At.INSTRUMENT_NAME:case At.LYRICS:case At.MARKER:case At.CUE_POINT:case At.SEQUENCE_NUMBER:case At.CHANNEL_PREFIX:case At.KEY_SIGNATURE:case At.SEQUENCER_SPECIFIC:case At.PREFIX_PORT:case At.SMPTE_OFFSET:default:e.skip(i)}return null}toString(){return`MetaEvent{ticks: ${this.ticks}, type: ${this.type}, value: ${this.value}}`}};var rt;(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)=>{_s(t)||(r.isNoteOn(t)?A(o.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?A(o.noteOff,r.readPitch(t)):r.isPitchWheel(t)?A(o.pitchBend,r.asPitchBend(t)):r.isController(t)?A(o.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?A(o.clock):r.isStart(t)?A(o.start):r.isContinue(t)?A(o.continue):r.isStop(t)?A(o.stop):r.isPosition(t)&&A(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"})(rt||(rt={}));var Gm=class{tracks;formatType;timeDivision;constructor(e,t,o){this.tracks=e,this.formatType=t,this.timeDivision=o}};var qm=class r{controlEvents;metaEvents;static decode(e){let t=new Ns,o=[],i=0,n=0,s=0;for(;;){let a=e.readVarLen(),l=e.readByte()&255;if(l<240){i+=a,l<128?e.skip(-1):(n=l&240,s=l&15);let c=Wm.decode(e,n,i);R(c)&&t.add(s,c)}else if(l<248)e.skipSysEx(l);else{i+=a;let c=Zm.decode(e,i);if(c!==null&&(o.push(c),c.type===At.END_OF_TRACK))break}}return new r(t,o)}static createEmpty(){return new r(new Ns,[])}constructor(e,t){this.controlEvents=e,this.metaEvents=t}encode(){let e=We.create(),t=o=>{if(o<=127)e.writeByte(o);else{let i=o,n=[];for(n.push(i&127),i>>=7;i;){let s=i&127|128;n.push(s),i>>=7}n.reverse().forEach(s=>e.writeByte(s))}};return this.controlEvents.forEach((o,i)=>{let n=0,s=-1;i.forEach(a=>{let l=a.ticks-n;if(t(l),a.type===Lt.NOTE_ON){let c=144|o;c!==s&&e.writeByte(c),e.writeByte(a.param0),e.writeByte(a.param1)}else if(a.type===Lt.NOTE_OFF){let c=144|o;c!==s&&e.writeByte(c),e.writeByte(a.param0),e.writeByte(a.param1)}else console.warn("Unknown ControlType");n=a.ticks})}),e.toArrayBuffer()}};var Hm=class{input;#e=!1;#t=!1;constructor(e){this.input=e}decode(){this.input.littleEndian=!1;let e=this.input.readInt();if(e===Jo.MTHD){if(this.input.readInt()!==6)throw new Error("2nd int in header must be 6")}else throw console.warn(`Unsupported midi format ${e} !== ${Jo.MTHD}`),new Error("Unsupported midi format");let t=this.input.readShort(),o=this.input.readShort(),i=this.input.readShort(),n=[];for(let s=0;s<o;s++){let a=this.input.readInt(),l=this.input.readInt(),c=this.input.position;a===Jo.MTRK&&(n[s]=qm.decode(this)),this.input.position=c+l}return 0<this.input.remaining()&&console.warn(`${this.input.remaining()} bytes remaining.`),new Gm(n,t,i)}readVarLen(){let e=this.input.readByte()&255,t;if(0<(e&128)){e&=127;do t=this.input.readByte()&255,e=(e<<7)+(t&127);while(0<(t&128))}return e}readSignature(){let e=this.input.readByte()&255,t=this.input.readByte()&255,o=this.input.readByte()&255,i=this.input.readByte()&255;return this.#e,[e,1<<t]}readTempo(){let e=this.input.readByte()&255,t=this.input.readByte()&255,o=this.input.readByte()&255;return 6e7/(e<<16|t<<8|o)}skipSysEx(e){if(e===240){if(this.#t)throw new Error("System message already in progress");this.input.skip(this.readVarLen()-1),this.#t=!0}else e===247&&(this.#t?this.#t=!1:(this.input.skip(this.readVarLen()-1),this.#t=!0))}skip(e){this.input.skip(e)}readByte(){return this.input.readByte()}};var IP;(function(r){r.decoder=t=>new Hm(new Ze(t)),r.encoder=()=>new e;class e{static writeVarLen(o,i){let n=[];for(;i>127;)n.push(i&127|128),i>>=7;n.push(i&127);for(let s=n.length-1;s>=0;s--)o.writeByte(n[s])}#e=[];addTrack(o){return this.#e.push(o),this}encode(){let o=We.create();return o.littleEndian=!1,o.writeInt(Jo.MTHD),o.writeInt(6),o.writeShort(0),o.writeShort(this.#e.length),o.writeShort(96),this.#e.forEach(i=>{o.writeInt(Jo.MTRK);let n=i.encode();o.writeInt(n.byteLength),o.writeBytes(new Int8Array(n))}),o}}})(IP||(IP={}));var Jm=Symbol.for("@openDAW/lib-midi");globalThis[Jm]?console.debug(`%c${Jm.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Jm]=!0,console.debug(`%c${Jm.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var as;(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.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.fromEvent=(e,t)=>{let o=e.data;if(rt.isNoteOn(o)){let i=rt.readPitch(o),n=rt.readVelocity(o);return{type:"note-on",uuid:t,pitch:i,velocity:n}}else if(rt.isNoteOff(o)){let i=rt.readPitch(o);return{type:"note-off",uuid:t,pitch:i}}return P("Unknown MIDI event")}})(as||(as={}));var TP;(function(r){r.start=(e,t,o,i=1)=>{let n=!0;return e(as.on(t,o,i)),{terminate:()=>{n&&(e(as.off(t,o)),n=!1)}}}})(TP||(TP={}));var RS,OS,VS,zS,US;RS=new WeakMap,OS=new WeakMap,VS=new WeakMap,zS=new WeakMap,US=new WeakMap;var jS=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},Qm=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,Ym=class{constructor(){Fa.set(this,void 0),jS(this,Fa,he.newSet(e=>e.field.address),"f")}register(e){return Qm(this,Fa,"f").add(e),{terminate:()=>Qm(this,Fa,"f").removeByValue(e)}}get(e){return Qm(this,Fa,"f").get(e)}opt(e){return Qm(this,Fa,"f").opt(e)}};Fa=new WeakMap;var ls={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})??P("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var Xm;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?Po.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||(t&t-1)!==0?Po.err("Denominator must be a power of two between 1 and 32"):Po.ok([e,t]),r.MIN_BPM=30,r.MAX_BPM=1e3,r.clampBpm=e=>Number.isFinite(e)?X(e,r.MIN_BPM,r.MAX_BPM):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:o=>{for(let[i,n]of I.iterateAdjacent(o.regions.pointerHub.incoming().map(({box:s})=>ls.asRegionBox(s)).sort(({position:s},{position:a})=>s.getValue()-a.getValue()))){if(i instanceof wn&&i.timeBase.getValue()===Dt.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>n.position.getValue())return!0}return!1}})??!1)})(Xm||(Xm={}));var MP;(function(r){r.parseTimeSignature=e=>{let[t,o]=e.split("/"),i=parseInt(t,10),n=parseInt(o,10);return Xm.isTimeSignatureValid(i,n)}})(MP||(MP={}));var eg;(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),c=new Float32Array(o*i),d=typeof document>"u",h=()=>{if(!s)return;let f=Atomics.load(a,1),v=Atomics.load(a,0);if(f===v){if(d)Atomics.wait(a,0,v);else{setTimeout(h,1);return}v=Atomics.load(a,0)}for(;f!==v;){let g=f*o*i;c.set(l.subarray(g,g+o*i));let y=[];for(let x=0;x<o;x++){let _=x*i,D=_+i;y.push(c.slice(_,D))}if(f=(f+1)%t,Atomics.store(a,1,f),!s)return;n(y)}h()};return h(),{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 P("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(n,0),c=l*o*i;a.forEach((d,h)=>s.set(d,c+h*i)),Atomics.store(n,0,(l+1)%t),Atomics.notify(n,0)}})}})(eg||(eg={}));var Vx={isRegion:r=>ls.isRegionBox(r.box),isLoopableRegion:r=>ls.isLoopableRegionBox(r.box)};var vo;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(vo||(vo={}));var LS,KS,WS,ZS;LS=new WeakMap,KS=new WeakMap,WS=new WeakMap,ZS=new WeakMap;var GS,qS,HS,JS;GS=new WeakMap,qS=new WeakMap,HS=new WeakMap,JS=new WeakMap;var Cc={[yt.Instrument]:0,[yt.Aux]:1,[yt.Bus]:2,[yt.Output]:3};var tg;(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}`),Xe.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(c=>l.capture.refer(c))})},r.orderAndGetIndex=(e,t)=>{let o=el.collectIndexedBoxes(e.audioUnits,Xe),i=Cc[t],n=0;for(;n<o.length&&!(Cc[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 ee.Audio:return m.wrap(bn.create(e,b.generate()));case ee.Notes:return m.wrap(An.create(e,b.generate()));default:return m.None}}})(tg||(tg={}));var CP;(function(r){r.create=(e,t,o,i,n)=>{console.debug(`createAudioBus '${t}', type: ${i}, color: ${n}`);let{boxGraph:s,mandatoryBoxes:{rootBox:a}}=e;B(a.isAttached(),"rootBox not attached");let l=b.generate(),c=Pi.create(s,l,h=>{h.collection.refer(a.audioBusses),h.label.setValue(t),h.icon.setValue($e.toName(o)),h.color.setValue(n)}),d=tg.create(e,i,m.None);return rr.create(s,b.generate(),h=>{h.tracks.refer(d.tracks),h.target.refer(d),h.index.setValue(0),h.type.setValue(ee.Undefined)}),c.output.refer(d.input),c}})(CP||(CP={}));var vi=(()=>{if(typeof document>"u")return e=>Ao;let r=getComputedStyle(document.documentElement);return e=>r.getPropertyValue(e)})(),Dc={blue:vi("--color-blue"),green:vi("--color-green"),yellow:vi("--color-yellow"),cream:vi("--color-cream"),orange:vi("--color-orange"),red:vi("--color-red"),purple:vi("--color-purple"),bright:vi("--color-bright"),gray:vi("--color-gray"),dark:vi("--color-dark"),shadow:vi("--color-shadow"),black:vi("--color-black")};var DP;(function(r){r.forAudioType=e=>{switch(e){case yt.Output:return Dc.blue;case yt.Aux:return Dc.purple;case yt.Bus:return Dc.orange;case yt.Instrument:return Dc.green;default:return Dc.dark}},r.forTrackType=e=>{switch(e){case ee.Audio:return 200;case ee.Notes:return 45;case ee.Value:return 156;default:return 0}}})(DP||(DP={}));var RP;(function(r){r.Tape={defaultName:"Tape",defaultIcon:$e.Tape,description:"Plays audio regions & clips",trackType:ee.Audio,create:(o,i,n,s,a)=>pl.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:ee.Notes,create:(o,i,n,s,a)=>{let l;if(R(a))l=a;else{let c=b.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),d=5.34;l=o.findBox(c).unwrapOrElse(()=>Sr.create(o,c,h=>{h.fileName.setValue("Rhode"),h.endInSeconds.setValue(d)}))}return dl.create(o,b.generate(),c=>{c.label.setValue(n),c.icon.setValue($e.toName(s)),c.file.refer(l),c.host.refer(i)})}},r.Playfield={defaultName:"Playfield",defaultIcon:$e.Playfield,description:"Drum computer",trackType:ee.Notes,create:(o,i,n,s,a)=>{let l=hl.create(o,b.generate(),c=>{c.label.setValue(n),c.icon.setValue($e.toName(s)),c.host.refer(i)});return R(a)&&a.filter(({note:c,uuid:d,name:h,durationInSeconds:f,exclude:v})=>{let g=e(o,d,h,f);_n.create(o,b.generate(),y=>{y.device.refer(l.samples),y.file.refer(g),y.index.setValue(c),y.exclude.setValue(v)})}),l}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:$e.Piano,description:"Classic subtractive synthesizer",trackType:ee.Notes,create:(o,i,n,s,a)=>ll.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(Gi.Polyphonic),l.lfo.rate.setInitValue(1),l.oscillators.fields()[0].waveform.setInitValue(Oe.saw),l.oscillators.fields()[0].volume.setInitValue(-6),l.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),l.oscillators.fields()[1].waveform.setInitValue(Oe.square),l.host.refer(i),l.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:$e.Midi,description:"MIDI Output",trackType:ee.Notes,create:(o,i,n,s,a)=>cl.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:ee.Notes,create:(o,i,n,s,a)=>{a??(a={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let l=a.uuid,c=b.parse(l),d=t(o,c,a.name);return ul.create(o,b.generate(),h=>{h.label.setValue(n),h.icon.setValue($e.toName(s)),h.host.refer(i),h.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(()=>Sr.create(o,i,a=>{a.fileName.setValue(n),a.endInSeconds.setValue(s)})),t=(o,i,n)=>o.findBox(i).unwrapOrElse(()=>Lr.create(o,i,s=>s.fileName.setValue(n)))})(RP||(RP={}));var cs;(function(r){r.empty=o=>{let i=new Is(m.wrap(Ts.create)),n=new Date().toISOString();console.debug(`New Project created on ${n}`),i.beginTransaction();let s=sl.create(i,b.generate(),f=>{f.label.setValue("Groove Shuffle")}),a=tl.create(i,b.generate(),f=>{f.groove.refer(s),f.created.setValue(n)}),l=Pi.create(i,b.generate(),f=>{f.collection.refer(a.audioBusses),f.label.setValue("Output"),f.icon.setValue($e.toName($e.SpeakerHeadphone)),f.color.setValue("hsl(189, 100%, 65%)")}),c=Xe.create(i,b.generate(),f=>{f.type.setValue(yt.Output),f.collection.refer(a.audioUnits),f.output.refer(a.outputDevice),f.index.setValue(0)});o.createOutputCompressor&&al.create(i,b.generate(),f=>{f.label.setValue("Compressor"),f.index.setValue(0),f.host.refer(c.audioEffects),f.threshold.setValue(0),f.ratio.setValue(24)});let d=Cs.create(i,b.generate());a.timeline.refer(d.root),l.output.refer(c.input);let h=[];if(o.createDefaultUser){let f=Ms.create(i,b.generate());f.root.refer(a.users),h.push(f)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:a,primaryAudioBus:l,primaryAudioOutputUnit:c,timelineBox:d,userInterfaceBoxes:h}}},r.encode=o=>{let i=We.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 Ze(o);B(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),B(i.readInt()===2,"Deprecated Format");let n=i.readInt(),s=new Int8Array(n);i.readBytes(s);let a=new Is(m.wrap(Ts.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(R(i)){let n=Ee(i.outputDevice.pointerHub.incoming().at(0)?.box,Xe),s=Ee(n.input.pointerHub.incoming().at(0)?.box,Pi),a=Ee(i.timeline.targetVertex.unwrap("TimelineBox not found").box,Cs),l=i.users.pointerHub.incoming().map(({box:c})=>Ee(c,Ms));return{rootBox:i,primaryAudioBus:s,primaryAudioOutputUnit:n,timelineBox:a,userInterfaceBoxes:l}}return P("Could not find mandatory boxes")}})(cs||(cs={}));var Rc;(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:c,rootBox:d}},h={})=>{B(I.satisfy(a,e),"AudioUnits must share the same BoxGraph"),B(!h.includeAux&&!h.includeBus,"Options are not yet implemented");let f=h?.excludeTimeline===!0?o:ln.alwaysFalse,v=a.flatMap(y=>Array.from(y.graph.dependenciesOf(y,{alwaysFollowMandatory:!0,excludeBox:f}).boxes)).filter(y=>y.name!==qi.ClassName&&y.name!==Os.ClassName),g=i(a,v,d.audioUnits.address.uuid,c.address.uuid);return n(g,l,a,v),s(g,a,d),console.debug("inTransaction",l.inTransaction()),a.map(y=>Ee(d.graph.findBox(g.get(y.address.uuid).target).unwrap("Target Track has not been copied"),Xe))},r.extractRegions=(a,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:c,rootBox:d}},h=0)=>{B(I.satisfy(a,e),"Region smust be from the same BoxGraph");let f=new Set(a),v=new Set,g=new ja;a.forEach(H=>{let be=Ee(H.regions.targetVertex.unwrap().box,rr);v.add(be);let Te=Ee(be.tracks.targetVertex.unwrap().box,Xe);g.add(Te,be)}),console.debug(`Found ${g.keyCount()} audioUnits`),console.debug(`Found ${v.size} tracks`);let y=[...g.keys()],x=H=>Le(H,rr)&&!v.has(H)||ls.isRegionBox(H)&&!f.has(H),_=y.flatMap(H=>Array.from(H.graph.dependenciesOf(H,{excludeBox:x,alwaysFollowMandatory:!0}).boxes)).filter(H=>H.name!==qi.ClassName&&H.name!==Os.ClassName),D=i(y,_,d.audioUnits.address.uuid,c.address.uuid);n(D,l,y,_),s(D,y,d),g.forEach((H,be)=>[...be].sort(t).forEach((Te,ne)=>{let Me=l.findBox(D.get(Te.address.uuid).target).unwrap("Target Track has not been copied");Ee(Me,rr).index.setValue(ne)}));let V=a.reduce((H,be)=>Math.min(H,be.position.getValue()),Number.MAX_VALUE),K=h-V;a.forEach(H=>{let be=l.findBox(D.get(H.address.uuid).target).unwrap("Target Track has not been copied"),Te=ls.asRegionBox(be).position;Te.setValue(Te.getValue()+K)})};let i=(a,l,c,d)=>{let h=b.newSet(({source:f})=>f);return h.addMany([...a.filter(({output:{targetAddress:f}})=>f.nonEmpty()).map(f=>({source:f.output.targetAddress.unwrap().uuid,target:d})),...a.map(f=>({source:f.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:c})),...a.map(f=>({source:f.address.uuid,target:b.generate()})),...l.map(({address:{uuid:f},name:v})=>({source:f,target:v===Sr.ClassName||v===Lr.ClassName?f:b.generate()}))]),h},n=(a,l,c,d)=>{k.decodeWith({map:(h,f)=>f.map(v=>a.opt(v.uuid).match({none:()=>v,some:({target:g})=>v.moveTo(g)}))},()=>{c.forEach(h=>{let f=new Ze(h.toArrayBuffer()),v=h.name,g=a.get(h.address.uuid).target;l.createBox(v,g,y=>y.read(f))}),d.forEach(h=>{let f=new Ze(h.toArrayBuffer()),v=h.name,g=a.get(h.address.uuid).target;if((h instanceof Sr||h instanceof Lr)&&l.findBox(h.address.uuid).nonEmpty()){h.read(f);return}l.createBox(v,g,y=>y.read(f))})})},s=(a,l,c)=>l.toSorted(t).map(d=>Ee(c.graph.findBox(a.get(d.address.uuid).target).unwrap("Target Track has not been copied"),Xe)).forEach(d=>el.collectIndexedBoxes(c.audioUnits,Xe).toSorted((h,f)=>{let v=Cc[h.type.getValue()],g=Cc[f.type.getValue()],y=v-g;return y===0?f===d?-1:1:y}).forEach((h,f)=>h.index.setValue(f)))})(Rc||(Rc={}));var us;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(us||(us={}));var OP;(function(r){r.decode=(e,t)=>{let o=new Ze(e.slice(0,8));if(o.readInt()!==us.MAGIC_HEADER_OPEN){Wa.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(o.readInt()!==us.FORMAT_VERSION){Wa.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let i=new Is(m.wrap(Ts.create));try{i.fromArrayBuffer(e.slice(8))}catch(s){Wa.info({headline:"Could Not Import Preset",message:String(s)}).then();return}let n=i.boxes().filter(s=>Le(s,Xe)).filter(s=>s.type.getValue()!==yt.Output);Rc.extractAudioUnits(n,t,{excludeTimeline:!0}).filter(s=>s.type.getValue()!==yt.Output).forEach(s=>{let a=s.input.pointerHub.incoming().at(0)?.box;R(a)&&s.capture.targetVertex.ifSome(({box:l})=>{l instanceof An?rr.create(t.boxGraph,b.generate(),c=>{c.index.setValue(0),c.type.setValue(ee.Notes),c.target.refer(s),c.tracks.refer(s.tracks)}):l instanceof bn&&rr.create(t.boxGraph,b.generate(),c=>{c.index.setValue(0),c.type.setValue(ee.Audio),c.target.refer(s),c.tracks.refer(s.tracks)})})})},r.replaceAudioUnit=(e,t,o)=>{console.debug("ReplaceAudioUnit with preset...");let i=cs.empty({createDefaultUser:!1,createOutputCompressor:!1}),n=i.boxGraph,s=t.graph;n.beginTransaction(),r.decode(e,i),n.endTransaction();let a=G(i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:y})=>Ee(y,Xe)).find(y=>y.type.getValue()!==yt.Output),"Source has no audioUnitBox"),l=a.capture.targetVertex.mapOr(({box:y})=>y.name,""),c=t.capture.targetVertex.mapOr(({box:y})=>y.name,"");if(l!==c)return Po.err("Cannot replace incompatible instruments");let d=o?.keepMIDIEffects!==!0,h=o?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",d),console.debug("replaceAudioEffects",h),G(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),d?t.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(n.beginTransaction(),a.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),n.endTransaction()),h?t.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(n.beginTransaction(),a.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),n.endTransaction());let f=y=>y.accept({visitTrackBox:x=>!0,visitCaptureMidiBox:x=>!0,visitCaptureAudioBox:x=>!0})===!0,v=b.newSet(({source:y})=>y),g=Array.from(n.dependenciesOf(a,{excludeBox:f,alwaysFollowMandatory:!1}).boxes);return v.addMany([{source:a.address.uuid,target:t.address.uuid},...g.map(({address:{uuid:y},name:x})=>({source:y,target:x===Sr.ClassName||x===Lr.ClassName?y:b.generate()}))]),k.decodeWith({map:(y,x)=>x.map(_=>v.opt(_.uuid).match({none:()=>_,some:({target:D})=>_.moveTo(D)}))},()=>{g.forEach(y=>{let x=new Ze(y.toArrayBuffer()),_=y.name,D=v.get(y.address.uuid).target;if((y instanceof Sr||y instanceof Lr)&&s.findBox(y.address.uuid).nonEmpty()){y.read(x);return}s.createBox(_,D,V=>V.read(x))})}),Po.Ok}})(OP||(OP={}));var VP;(function(r){r.encode=e=>{let t=We.create();t.writeInt(us.MAGIC_HEADER_OPEN),t.writeInt(us.FORMAT_VERSION);let o=cs.empty({createOutputCompressor:!1,createDefaultUser:!1});return o.boxGraph.beginTransaction(),Rc.extractAudioUnits([e],o,{excludeTimeline:!0}),o.boxGraph.endTransaction(),console.debug("SAVING..."),o.boxGraph.debugBoxes(),I.concatArrayBuffers(t.toArrayBuffer(),o.boxGraph.toArrayBuffer())}})(VP||(VP={}));var zP;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let o=G(Ee(t,Xe).input.pointerHub.incoming().at(0)).box;return"label"in o&&o.label instanceof C?o.label.getValue():"N/A"})})(zP||(zP={}));var _t={};As(_t,{$brand:()=>rg,$input:()=>i0,$output:()=>r0,NEVER:()=>zx,TimePrecision:()=>s0,ZodAny:()=>gE,ZodArray:()=>wE,ZodBase64:()=>_A,ZodBase64URL:()=>PA,ZodBigInt:()=>Uh,ZodBigIntFormat:()=>NA,ZodBoolean:()=>zh,ZodCIDRv4:()=>bA,ZodCIDRv6:()=>AA,ZodCUID:()=>fA,ZodCUID2:()=>mA,ZodCatch:()=>VE,ZodCodec:()=>RA,ZodCustom:()=>uv,ZodCustomStringFormat:()=>Oh,ZodDate:()=>av,ZodDefault:()=>TE,ZodDiscriminatedUnion:()=>bE,ZodE164:()=>EA,ZodEmail:()=>dA,ZodEmoji:()=>hA,ZodEnum:()=>Dh,ZodError:()=>EB,ZodFile:()=>$E,ZodFirstPartyTypeKind:()=>OA,ZodFunction:()=>qE,ZodGUID:()=>rv,ZodIPv4:()=>xA,ZodIPv6:()=>wA,ZodISODate:()=>Yg,ZodISODateTime:()=>Qg,ZodISODuration:()=>ev,ZodISOTime:()=>Xg,ZodIntersection:()=>AE,ZodIssueCode:()=>D$,ZodJWT:()=>SA,ZodKSUID:()=>yA,ZodLazy:()=>WE,ZodLiteral:()=>BE,ZodMap:()=>NE,ZodNaN:()=>UE,ZodNanoID:()=>pA,ZodNever:()=>yE,ZodNonOptional:()=>CA,ZodNull:()=>fE,ZodNullable:()=>IE,ZodNumber:()=>Vh,ZodNumberFormat:()=>Yc,ZodObject:()=>cv,ZodOptional:()=>MA,ZodPipe:()=>DA,ZodPrefault:()=>CE,ZodPromise:()=>GE,ZodReadonly:()=>jE,ZodRealError:()=>br,ZodRecord:()=>kA,ZodSet:()=>FE,ZodString:()=>Rh,ZodStringFormat:()=>Ye,ZodSuccess:()=>OE,ZodSymbol:()=>hE,ZodTemplateLiteral:()=>KE,ZodTransform:()=>kE,ZodTuple:()=>PE,ZodType:()=>we,ZodULID:()=>gA,ZodURL:()=>sv,ZodUUID:()=>tn,ZodUndefined:()=>pE,ZodUnion:()=>BA,ZodUnknown:()=>vE,ZodVoid:()=>xE,ZodXID:()=>vA,_ZodString:()=>uA,_default:()=>ME,_function:()=>B$,any:()=>c$,array:()=>lv,base64:()=>ZB,base64url:()=>GB,bigint:()=>o$,boolean:()=>dE,catch:()=>zE,check:()=>$$,cidrv4:()=>KB,cidrv6:()=>WB,clone:()=>ar,codec:()=>S$,coerce:()=>VA,config:()=>mt,core:()=>en,cuid:()=>RB,cuid2:()=>OB,custom:()=>k$,date:()=>d$,decode:()=>tA,decodeAsync:()=>iA,discriminatedUnion:()=>g$,e164:()=>qB,email:()=>NB,emoji:()=>CB,encode:()=>eA,encodeAsync:()=>rA,endsWith:()=>Bh,enum:()=>IA,file:()=>A$,flattenError:()=>dh,float32:()=>e$,float64:()=>t$,formatError:()=>hh,function:()=>B$,getErrorMap:()=>O$,globalRegistry:()=>xo,gt:()=>Yo,gte:()=>wr,guid:()=>FB,hash:()=>XB,hex:()=>YB,hostname:()=>QB,httpUrl:()=>MB,includes:()=>Nh,instanceof:()=>I$,int:()=>cA,int32:()=>r$,int64:()=>n$,intersection:()=>_E,ipv4:()=>jB,ipv6:()=>LB,iso:()=>tv,json:()=>M$,jwt:()=>HB,keyof:()=>h$,ksuid:()=>UB,lazy:()=>ZE,length:()=>Hc,literal:()=>b$,locales:()=>wh,looseObject:()=>m$,lowercase:()=>Eh,lt:()=>Qo,lte:()=>xi,map:()=>y$,maxLength:()=>qc,maxSize:()=>Gc,mime:()=>$h,minLength:()=>vs,minSize:()=>Ta,multipleOf:()=>Ia,nan:()=>E$,nanoid:()=>DB,nativeEnum:()=>w$,negative:()=>C0,never:()=>FA,nonnegative:()=>R0,nonoptional:()=>RE,nonpositive:()=>D0,normalize:()=>kh,null:()=>mE,nullable:()=>ov,nullish:()=>_$,number:()=>uE,object:()=>p$,optional:()=>iv,overwrite:()=>Xo,parse:()=>J0,parseAsync:()=>Q0,partialRecord:()=>v$,pipe:()=>nv,positive:()=>M0,prefault:()=>DE,preprocess:()=>C$,prettifyError:()=>Qx,promise:()=>F$,property:()=>O0,readonly:()=>LE,record:()=>SE,refine:()=>HE,regex:()=>Ph,regexes:()=>yi,registry:()=>$g,safeDecode:()=>nA,safeDecodeAsync:()=>aA,safeEncode:()=>oA,safeEncodeAsync:()=>sA,safeParse:()=>Y0,safeParseAsync:()=>X0,set:()=>x$,setErrorMap:()=>R$,size:()=>_h,startsWith:()=>Fh,strictObject:()=>f$,string:()=>lA,stringFormat:()=>JB,stringbool:()=>T$,success:()=>P$,superRefine:()=>JE,symbol:()=>a$,templateLiteral:()=>N$,toJSONSchema:()=>W0,toLowerCase:()=>Th,toUpperCase:()=>Mh,transform:()=>TA,treeifyError:()=>Jx,trim:()=>Ih,tuple:()=>EE,uint32:()=>i$,uint64:()=>s$,ulid:()=>VB,undefined:()=>l$,union:()=>$A,unknown:()=>Qc,uppercase:()=>Sh,url:()=>TB,util:()=>U,uuid:()=>BB,uuidv4:()=>$B,uuidv6:()=>kB,uuidv7:()=>IB,void:()=>u$,xid:()=>zB});var en={};As(en,{$ZodAny:()=>Eb,$ZodArray:()=>$b,$ZodAsyncError:()=>ji,$ZodBase64:()=>mb,$ZodBase64URL:()=>gb,$ZodBigInt:()=>Pg,$ZodBigIntFormat:()=>bb,$ZodBoolean:()=>gh,$ZodCIDRv4:()=>hb,$ZodCIDRv6:()=>pb,$ZodCUID:()=>tb,$ZodCUID2:()=>rb,$ZodCatch:()=>Gb,$ZodCheck:()=>it,$ZodCheckBigIntFormat:()=>kw,$ZodCheckEndsWith:()=>Lw,$ZodCheckGreaterThan:()=>vg,$ZodCheckIncludes:()=>Uw,$ZodCheckLengthEquals:()=>Rw,$ZodCheckLessThan:()=>gg,$ZodCheckLowerCase:()=>Vw,$ZodCheckMaxLength:()=>Cw,$ZodCheckMaxSize:()=>Iw,$ZodCheckMimeType:()=>Ww,$ZodCheckMinLength:()=>Dw,$ZodCheckMinSize:()=>Tw,$ZodCheckMultipleOf:()=>Bw,$ZodCheckNumberFormat:()=>$w,$ZodCheckOverwrite:()=>Zw,$ZodCheckProperty:()=>Kw,$ZodCheckRegex:()=>Ow,$ZodCheckSizeEquals:()=>Mw,$ZodCheckStartsWith:()=>jw,$ZodCheckStringFormat:()=>Wc,$ZodCheckUpperCase:()=>zw,$ZodCodec:()=>vh,$ZodCustom:()=>t0,$ZodCustomStringFormat:()=>xb,$ZodDate:()=>Bb,$ZodDefault:()=>Lb,$ZodDiscriminatedUnion:()=>Ib,$ZodE164:()=>vb,$ZodEmail:()=>Qw,$ZodEmoji:()=>Xw,$ZodEncodeError:()=>ds,$ZodEnum:()=>Rb,$ZodError:()=>uh,$ZodFile:()=>Vb,$ZodFunction:()=>Yb,$ZodGUID:()=>Hw,$ZodIPv4:()=>ub,$ZodIPv6:()=>db,$ZodISODate:()=>ab,$ZodISODateTime:()=>sb,$ZodISODuration:()=>cb,$ZodISOTime:()=>lb,$ZodIntersection:()=>Tb,$ZodJWT:()=>yb,$ZodKSUID:()=>nb,$ZodLazy:()=>e0,$ZodLiteral:()=>Ob,$ZodMap:()=>Cb,$ZodNaN:()=>qb,$ZodNanoID:()=>eb,$ZodNever:()=>Nb,$ZodNonOptional:()=>Wb,$ZodNull:()=>Pb,$ZodNullable:()=>jb,$ZodNumber:()=>_g,$ZodNumberFormat:()=>wb,$ZodObject:()=>h1,$ZodObjectJIT:()=>kb,$ZodOptional:()=>Ub,$ZodPipe:()=>Hb,$ZodPrefault:()=>Kb,$ZodPromise:()=>Xb,$ZodReadonly:()=>Jb,$ZodRealError:()=>xr,$ZodRecord:()=>Mb,$ZodRegistry:()=>Zc,$ZodSet:()=>Db,$ZodString:()=>ka,$ZodStringFormat:()=>qe,$ZodSuccess:()=>Zb,$ZodSymbol:()=>Ab,$ZodTemplateLiteral:()=>Qb,$ZodTransform:()=>zb,$ZodTuple:()=>Sg,$ZodType:()=>de,$ZodULID:()=>ib,$ZodURL:()=>Yw,$ZodUUID:()=>Jw,$ZodUndefined:()=>_b,$ZodUnion:()=>Eg,$ZodUnknown:()=>Sb,$ZodVoid:()=>Fb,$ZodXID:()=>ob,$brand:()=>rg,$constructor:()=>w,$input:()=>i0,$output:()=>r0,Doc:()=>mh,JSONSchema:()=>aE,JSONSchemaGenerator:()=>Ch,NEVER:()=>zx,TimePrecision:()=>s0,_any:()=>N0,_array:()=>V0,_base64:()=>Gg,_base64url:()=>qg,_bigint:()=>w0,_boolean:()=>y0,_catch:()=>yB,_check:()=>sE,_cidrv4:()=>Wg,_cidrv6:()=>Zg,_coercedBigint:()=>b0,_coercedBoolean:()=>x0,_coercedDate:()=>I0,_coercedNumber:()=>h0,_coercedString:()=>n0,_cuid:()=>Og,_cuid2:()=>Vg,_custom:()=>U0,_date:()=>k0,_decode:()=>lg,_decodeAsync:()=>ug,_default:()=>mB,_discriminatedUnion:()=>iB,_e164:()=>Hg,_email:()=>kg,_emoji:()=>Dg,_encode:()=>ag,_encodeAsync:()=>cg,_endsWith:()=>Bh,_enum:()=>cB,_file:()=>z0,_float32:()=>f0,_float64:()=>m0,_gt:()=>Yo,_gte:()=>wr,_guid:()=>bh,_includes:()=>Nh,_int:()=>p0,_int32:()=>g0,_int64:()=>A0,_intersection:()=>oB,_ipv4:()=>Lg,_ipv6:()=>Kg,_isoDate:()=>l0,_isoDateTime:()=>a0,_isoDuration:()=>u0,_isoTime:()=>c0,_jwt:()=>Jg,_ksuid:()=>jg,_lazy:()=>AB,_length:()=>Hc,_literal:()=>dB,_lowercase:()=>Eh,_lt:()=>Qo,_lte:()=>xi,_map:()=>aB,_max:()=>xi,_maxLength:()=>qc,_maxSize:()=>Gc,_mime:()=>$h,_min:()=>wr,_minLength:()=>vs,_minSize:()=>Ta,_multipleOf:()=>Ia,_nan:()=>T0,_nanoid:()=>Rg,_nativeEnum:()=>uB,_negative:()=>C0,_never:()=>B0,_nonnegative:()=>R0,_nonoptional:()=>gB,_nonpositive:()=>D0,_normalize:()=>kh,_null:()=>S0,_nullable:()=>fB,_number:()=>d0,_optional:()=>pB,_overwrite:()=>Xo,_parse:()=>Uc,_parseAsync:()=>jc,_pipe:()=>xB,_positive:()=>M0,_promise:()=>_B,_property:()=>O0,_readonly:()=>wB,_record:()=>sB,_refine:()=>j0,_regex:()=>Ph,_safeDecode:()=>hg,_safeDecodeAsync:()=>fg,_safeEncode:()=>dg,_safeEncodeAsync:()=>pg,_safeParse:()=>Lc,_safeParseAsync:()=>Kc,_set:()=>lB,_size:()=>_h,_startsWith:()=>Fh,_string:()=>o0,_stringFormat:()=>Jc,_stringbool:()=>K0,_success:()=>vB,_superRefine:()=>L0,_symbol:()=>P0,_templateLiteral:()=>bB,_toLowerCase:()=>Th,_toUpperCase:()=>Mh,_transform:()=>hB,_trim:()=>Ih,_tuple:()=>nB,_uint32:()=>v0,_uint64:()=>_0,_ulid:()=>zg,_undefined:()=>E0,_union:()=>rB,_unknown:()=>F0,_uppercase:()=>Sh,_url:()=>Ah,_uuid:()=>Ig,_uuidv4:()=>Tg,_uuidv6:()=>Mg,_uuidv7:()=>Cg,_void:()=>$0,_xid:()=>Ug,clone:()=>ar,config:()=>mt,decode:()=>PN,decodeAsync:()=>SN,encode:()=>_N,encodeAsync:()=>EN,flattenError:()=>dh,formatError:()=>hh,globalConfig:()=>ih,globalRegistry:()=>xo,isValidBase64:()=>fb,isValidBase64URL:()=>l1,isValidJWT:()=>c1,locales:()=>wh,parse:()=>ng,parseAsync:()=>sg,prettifyError:()=>Qx,regexes:()=>yi,registry:()=>$g,safeDecode:()=>FN,safeDecodeAsync:()=>$N,safeEncode:()=>NN,safeEncodeAsync:()=>BN,safeParse:()=>Yx,safeParseAsync:()=>Xx,toDotPath:()=>WP,toJSONSchema:()=>W0,treeifyError:()=>Jx,util:()=>U,version:()=>Gw});var zx=Object.freeze({status:"aborted"});function w(r,e,t){function o(a,l){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(r),e(a,l);for(let d in s.prototype)d in a||Object.defineProperty(a,d,{value:s.prototype[d].bind(a)});a._zod.constr=s,a._zod.def=l}let i=t?.Parent??Object;class n extends i{}Object.defineProperty(n,"name",{value:r});function s(a){var l;let c=t?.Parent?new n:this;o(c,a),(l=c._zod).deferred??(l.deferred=[]);for(let d of c._zod.deferred)d();return c}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 rg=Symbol("zod_brand"),ji=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ds=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},ih={};function mt(r){return r&&Object.assign(ih,r),ih}var U={};As(U,{BIGINT_FORMAT_RANGES:()=>Hx,Class:()=>jx,NUMBER_FORMAT_RANGES:()=>qx,aborted:()=>gs,allowsEval:()=>Kx,assert:()=>tN,assertEqual:()=>QS,assertIs:()=>XS,assertNever:()=>eN,assertNotEqual:()=>YS,assignProp:()=>ps,base64ToUint8Array:()=>jP,base64urlToUint8Array:()=>yN,cached:()=>Vc,captureStackTrace:()=>og,cleanEnum:()=>vN,cleanRegex:()=>sh,clone:()=>ar,cloneDef:()=>iN,createTransparentProxy:()=>cN,defineLazy:()=>Fe,esc:()=>ig,escapeRegex:()=>yo,extend:()=>hN,finalizeIssue:()=>Rr,floatSafeRemainder:()=>Lx,getElementAtPath:()=>oN,getEnumValues:()=>nh,getLengthableOrigin:()=>ch,getParsedType:()=>lN,getSizableOrigin:()=>lh,hexToUint8Array:()=>wN,isObject:()=>Ba,isPlainObject:()=>ms,issue:()=>zc,joinValues:()=>$,jsonStringifyReplacer:()=>Oc,merge:()=>fN,mergeDefs:()=>fs,normalizeParams:()=>z,nullish:()=>hs,numKeys:()=>aN,objectClone:()=>rN,omit:()=>dN,optionalKeys:()=>Gx,partial:()=>mN,pick:()=>uN,prefixIssues:()=>Dr,primitiveTypes:()=>Zx,promiseAllObject:()=>nN,propertyKeyTypes:()=>ah,randomString:()=>sN,required:()=>gN,safeExtend:()=>pN,shallowClone:()=>Wx,stringifyPrimitive:()=>O,uint8ArrayToBase64:()=>LP,uint8ArrayToBase64url:()=>xN,uint8ArrayToHex:()=>bN,unwrapMessage:()=>oh});function QS(r){return r}function YS(r){return r}function XS(r){}function eN(r){throw new Error}function tN(r){}function nh(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 $(r,e="|"){return r.map(t=>O(t)).join(e)}function Oc(r,e){return typeof e=="bigint"?e.toString():e}function Vc(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function hs(r){return r==null}function sh(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function Lx(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 UP=Symbol("evaluating");function Fe(r,e,t){let o;Object.defineProperty(r,e,{get(){if(o!==UP)return o===void 0&&(o=UP,o=t()),o},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function rN(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function ps(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function fs(...r){let e={};for(let t of r){let o=Object.getOwnPropertyDescriptors(t);Object.assign(e,o)}return Object.defineProperties({},e)}function iN(r){return fs(r._zod.def)}function oN(r,e){return e?e.reduce((t,o)=>t?.[o],r):r}function nN(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 sN(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let o=0;o<r;o++)t+=e[Math.floor(Math.random()*e.length)];return t}function ig(r){return JSON.stringify(r)}var og="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Ba(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Kx=Vc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function ms(r){if(Ba(r)===!1)return!1;let e=r.constructor;if(e===void 0)return!0;let t=e.prototype;return!(Ba(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Wx(r){return ms(r)?{...r}:Array.isArray(r)?[...r]:r}function aN(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var lN=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}`)}},ah=new Set(["string","number","symbol"]),Zx=new Set(["string","number","bigint","boolean","symbol","undefined"]);function yo(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 z(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 cN(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 O(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function Gx(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var qx={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]},Hx={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function uN(r,e){let t=r._zod.def,o=fs(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 ps(this,"shape",i),i},checks:[]});return ar(r,o)}function dN(r,e){let t=r._zod.def,o=fs(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 ps(this,"shape",i),i},checks:[]});return ar(r,o)}function hN(r,e){if(!ms(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=fs(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e};return ps(this,"shape",n),n},checks:[]});return ar(r,i)}function pN(r,e){if(!ms(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 ps(this,"shape",o),o},checks:r._zod.def.checks};return ar(r,t)}function fN(r,e){let t=fs(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e._zod.def.shape};return ps(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:[]});return ar(r,t)}function mN(r,e,t){let o=fs(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 ps(this,"shape",n),n},checks:[]});return ar(e,o)}function gN(r,e,t){let o=fs(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 ps(this,"shape",n),n},checks:[]});return ar(e,o)}function gs(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 Dr(r,e){return e.map(t=>{var o;return(o=t).path??(o.path=[]),t.path.unshift(r),t})}function oh(r){return typeof r=="string"?r:r?.message}function Rr(r,e,t){let o={...r,path:r.path??[]};if(!r.message){let i=oh(r.inst?._zod.def?.error?.(r))??oh(e?.error?.(r))??oh(t.customError?.(r))??oh(t.localeError?.(r))??"Invalid input";o.message=i}return delete o.inst,delete o.continue,e?.reportInput||delete o.input,o}function lh(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function ch(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function zc(...r){let[e,t,o]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:o}:{...e}}function vN(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function jP(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 LP(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function yN(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return jP(e+t)}function xN(r){return LP(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wN(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 bN(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var jx=class{constructor(...e){}};var KP=(r,e)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:e,enumerable:!1}),r.message=JSON.stringify(e,Oc,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},uh=w("$ZodError",KP),xr=w("$ZodError",KP,{Parent:Error});function dh(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 hh(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 Jx(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(c=>o({issues:c},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 c=[...n,...l.path];if(c.length===0){t.errors.push(e(l));continue}let d=t,h=0;for(;h<c.length;){let f=c[h],v=h===c.length-1;typeof f=="string"?(d.properties??(d.properties={}),(s=d.properties)[f]??(s[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(a=d.items)[f]??(a[f]={errors:[]}),d=d.items[f]),v&&d.errors.push(e(l)),h++}}};return o(r),t}function WP(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 Qx(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 ${WP(o.path)}`);return e.join(`
|
|
6
|
-
`)}var Uc=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 ji;if(s.issues.length){let a=new(i?.Err??r)(s.issues.map(l=>Rr(l,n,mt())));throw og(a,i?.callee),a}return s.value},ng=Uc(xr),jc=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=>Rr(l,n,mt())));throw og(a,i?.callee),a}return s.value},sg=jc(xr),Lc=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 ji;return n.issues.length?{success:!1,error:new(r??uh)(n.issues.map(s=>Rr(s,i,mt())))}:{success:!0,data:n.value}},Yx=Lc(xr),Kc=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=>Rr(s,i,mt())))}:{success:!0,data:n.value}},Xx=Kc(xr),ag=r=>(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Uc(r)(e,t,i)},_N=ag(xr),lg=r=>(e,t,o)=>Uc(r)(e,t,o),PN=lg(xr),cg=r=>async(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return jc(r)(e,t,i)},EN=cg(xr),ug=r=>async(e,t,o)=>jc(r)(e,t,o),SN=ug(xr),dg=r=>(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Lc(r)(e,t,i)},NN=dg(xr),hg=r=>(e,t,o)=>Lc(r)(e,t,o),FN=hg(xr),pg=r=>async(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Kc(r)(e,t,i)},BN=pg(xr),fg=r=>async(e,t,o)=>Kc(r)(e,t,o),$N=fg(xr);var yi={};As(yi,{base64:()=>fw,base64url:()=>mg,bigint:()=>bw,boolean:()=>Pw,browserEmail:()=>ON,cidrv4:()=>hw,cidrv6:()=>pw,cuid:()=>ew,cuid2:()=>tw,date:()=>vw,datetime:()=>xw,domain:()=>zN,duration:()=>sw,e164:()=>gw,email:()=>lw,emoji:()=>cw,extendedDuration:()=>kN,guid:()=>aw,hex:()=>UN,hostname:()=>mw,html5Email:()=>CN,idnEmail:()=>RN,integer:()=>Aw,ipv4:()=>uw,ipv6:()=>dw,ksuid:()=>ow,lowercase:()=>Nw,md5_base64:()=>LN,md5_base64url:()=>KN,md5_hex:()=>jN,nanoid:()=>nw,null:()=>Ew,number:()=>_w,rfc5322Email:()=>DN,sha1_base64:()=>ZN,sha1_base64url:()=>GN,sha1_hex:()=>WN,sha256_base64:()=>HN,sha256_base64url:()=>JN,sha256_hex:()=>qN,sha384_base64:()=>YN,sha384_base64url:()=>XN,sha384_hex:()=>QN,sha512_base64:()=>tF,sha512_base64url:()=>rF,sha512_hex:()=>eF,string:()=>ww,time:()=>yw,ulid:()=>rw,undefined:()=>Sw,unicodeEmail:()=>ZP,uppercase:()=>Fw,uuid:()=>$a,uuid4:()=>IN,uuid6:()=>TN,uuid7:()=>MN,xid:()=>iw});var ew=/^[cC][^\s-]{8,}$/,tw=/^[0-9a-z]+$/,rw=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,iw=/^[0-9a-vA-V]{20}$/,ow=/^[A-Za-z0-9]{27}$/,nw=/^[a-zA-Z0-9_-]{21}$/,sw=/^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)?)??$/,aw=/^([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})$/,$a=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)$/,IN=$a(4),TN=$a(6),MN=$a(7),lw=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,CN=/^[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])?)*$/,DN=/^(([^<>()\[\]\\.,;:\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,}))$/,ZP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,RN=ZP,ON=/^[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])?)*$/,VN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function cw(){return new RegExp(VN,"u")}var uw=/^(?:(?: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])$/,dw=/^(([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}|:))$/,hw=/^((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])$/,pw=/^(([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])$/,fw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mg=/^[A-Za-z0-9_-]*$/,mw=/^(?=.{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])?)*\.?$/,zN=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,gw=/^\+(?:[0-9]){6,14}[0-9]$/,GP="(?:(?:\\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])))",vw=new RegExp(`^${GP}$`);function qP(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 yw(r){return new RegExp(`^${qP(r)}$`)}function xw(r){let e=qP({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(`^${GP}T(?:${o})$`)}var ww=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},bw=/^-?\d+n?$/,Aw=/^-?\d+$/,_w=/^-?\d+(?:\.\d+)?/,Pw=/^(?:true|false)$/i,Ew=/^null$/i;var Sw=/^undefined$/i;var Nw=/^[^A-Z]*$/,Fw=/^[^a-z]*$/,UN=/^[0-9a-fA-F]*$/;function ph(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function fh(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var jN=/^[0-9a-fA-F]{32}$/,LN=ph(22,"=="),KN=fh(22),WN=/^[0-9a-fA-F]{40}$/,ZN=ph(27,"="),GN=fh(27),qN=/^[0-9a-fA-F]{64}$/,HN=ph(43,"="),JN=fh(43),QN=/^[0-9a-fA-F]{96}$/,YN=ph(64,""),XN=fh(64),eF=/^[0-9a-fA-F]{128}$/,tF=ph(86,"=="),rF=fh(86);var it=w("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),JP={number:"number",bigint:"bigint",object:"date"},gg=w("$ZodCheckLessThan",(r,e)=>{it.init(r,e);let t=JP[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})}}),vg=w("$ZodCheckGreaterThan",(r,e)=>{it.init(r,e);let t=JP[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})}}),Bw=w("$ZodCheckMultipleOf",(r,e)=>{it.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):Lx(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})}}),$w=w("$ZodCheckNumberFormat",(r,e)=>{it.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),o=t?"int":"number",[i,n]=qx[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=Aw)}),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})}}),kw=w("$ZodCheckBigIntFormat",(r,e)=>{it.init(r,e);let[t,o]=Hx[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})}}),Iw=w("$ZodCheckMaxSize",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!hs(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:lh(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),Tw=w("$ZodCheckMinSize",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!hs(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:lh(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),Mw=w("$ZodCheckSizeEquals",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!hs(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:lh(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})}}),Cw=w("$ZodCheckMaxLength",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!hs(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=ch(i);o.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),Dw=w("$ZodCheckMinLength",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!hs(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=ch(i);o.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),Rw=w("$ZodCheckLengthEquals",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!hs(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=ch(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})}}),Wc=w("$ZodCheckStringFormat",(r,e)=>{var t,o;it.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=()=>{})}),Ow=w("$ZodCheckRegex",(r,e)=>{Wc.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})}}),Vw=w("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=Nw),Wc.init(r,e)}),zw=w("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=Fw),Wc.init(r,e)}),Uw=w("$ZodCheckIncludes",(r,e)=>{it.init(r,e);let t=yo(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})}}),jw=w("$ZodCheckStartsWith",(r,e)=>{it.init(r,e);let t=new RegExp(`^${yo(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})}}),Lw=w("$ZodCheckEndsWith",(r,e)=>{it.init(r,e);let t=new RegExp(`.*${yo(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 HP(r,e,t){r.issues.length&&e.issues.push(...Dr(t,r.issues))}var Kw=w("$ZodCheckProperty",(r,e)=>{it.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=>HP(i,t,e.property));HP(o,t,e.property)}}),Ww=w("$ZodCheckMimeType",(r,e)=>{it.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})}}),Zw=w("$ZodCheckOverwrite",(r,e)=>{it.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var mh=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(`
|
|
7
|
-
|
|
8
|
-
`))}};var Gw={major:4,minor:1,patch:12};var de=w("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=Gw;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 c=gs(s),d;for(let h of a){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(c)continue;let f=s.issues.length,v=h._zod.check(s);if(v instanceof Promise&&l?.async===!1)throw new ji;if(d||v instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await v,s.issues.length!==f&&(c||(c=gs(s,f)))});else{if(s.issues.length===f)continue;c||(c=gs(s,f))}}return d?d.then(()=>s):s},n=(s,a,l)=>{if(gs(s))return s.aborted=!0,s;let c=i(a,o,l);if(c instanceof Promise){if(l.async===!1)throw new ji;return c.then(d=>r._zod.parse(d,l))}return r._zod.parse(c,l)};r._zod.run=(s,a)=>{if(a.skipChecks)return r._zod.parse(s,a);if(a.direction==="backward"){let c=r._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>n(d,s,a)):n(c,s,a)}let l=r._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new ji;return l.then(c=>i(c,o,a))}return i(l,o,a)}}r["~standard"]={validate:i=>{try{let n=Yx(r,i);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Xx(r,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),ka=w("$ZodString",(r,e)=>{de.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??ww(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}}),qe=w("$ZodStringFormat",(r,e)=>{Wc.init(r,e),ka.init(r,e)}),Hw=w("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=aw),qe.init(r,e)}),Jw=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=$a(o))}else e.pattern??(e.pattern=$a());qe.init(r,e)}),Qw=w("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=lw),qe.init(r,e)}),Yw=w("$ZodURL",(r,e)=>{qe.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:mw.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})}}}),Xw=w("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=cw()),qe.init(r,e)}),eb=w("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=nw),qe.init(r,e)}),tb=w("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=ew),qe.init(r,e)}),rb=w("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=tw),qe.init(r,e)}),ib=w("$ZodULID",(r,e)=>{e.pattern??(e.pattern=rw),qe.init(r,e)}),ob=w("$ZodXID",(r,e)=>{e.pattern??(e.pattern=iw),qe.init(r,e)}),nb=w("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=ow),qe.init(r,e)}),sb=w("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=xw(e)),qe.init(r,e)}),ab=w("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=vw),qe.init(r,e)}),lb=w("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=yw(e)),qe.init(r,e)}),cb=w("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=sw),qe.init(r,e)}),ub=w("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=uw),qe.init(r,e),r._zod.onattach.push(t=>{let o=t._zod.bag;o.format="ipv4"})}),db=w("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=dw),qe.init(r,e),r._zod.onattach.push(t=>{let o=t._zod.bag;o.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})}}}),hb=w("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=hw),qe.init(r,e)}),pb=w("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=pw),qe.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 fb(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var mb=w("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=fw),qe.init(r,e),r._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64"}),r._zod.check=t=>{fb(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function l1(r){if(!mg.test(r))return!1;let e=r.replace(/[-_]/g,o=>o==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return fb(t)}var gb=w("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=mg),qe.init(r,e),r._zod.onattach.push(t=>{t._zod.bag.contentEncoding="base64url"}),r._zod.check=t=>{l1(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),vb=w("$ZodE164",(r,e)=>{e.pattern??(e.pattern=gw),qe.init(r,e)});function c1(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 yb=w("$ZodJWT",(r,e)=>{qe.init(r,e),r._zod.check=t=>{c1(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),xb=w("$ZodCustomStringFormat",(r,e)=>{qe.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})}}),_g=w("$ZodNumber",(r,e)=>{de.init(r,e),r._zod.pattern=r._zod.bag.pattern??_w,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}}),wb=w("$ZodNumber",(r,e)=>{$w.init(r,e),_g.init(r,e)}),gh=w("$ZodBoolean",(r,e)=>{de.init(r,e),r._zod.pattern=Pw,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}}),Pg=w("$ZodBigInt",(r,e)=>{de.init(r,e),r._zod.pattern=bw,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}}),bb=w("$ZodBigInt",(r,e)=>{kw.init(r,e),Pg.init(r,e)}),Ab=w("$ZodSymbol",(r,e)=>{de.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}}),_b=w("$ZodUndefined",(r,e)=>{de.init(r,e),r._zod.pattern=Sw,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}}),Pb=w("$ZodNull",(r,e)=>{de.init(r,e),r._zod.pattern=Ew,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}}),Eb=w("$ZodAny",(r,e)=>{de.init(r,e),r._zod.parse=t=>t}),Sb=w("$ZodUnknown",(r,e)=>{de.init(r,e),r._zod.parse=t=>t}),Nb=w("$ZodNever",(r,e)=>{de.init(r,e),r._zod.parse=(t,o)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),Fb=w("$ZodVoid",(r,e)=>{de.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}}),Bb=w("$ZodDate",(r,e)=>{de.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 YP(r,e,t){r.issues.length&&e.issues.push(...Dr(t,r.issues)),e.value[t]=r.value}var $b=w("$ZodArray",(r,e)=>{de.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(c=>YP(c,t,s))):YP(l,t,s)}return n.length?Promise.all(n).then(()=>t):t}});function Ag(r,e,t,o){r.issues.length&&e.issues.push(...Dr(t,r.issues)),r.value===void 0?t in o&&(e.value[t]=void 0):e.value[t]=r.value}function u1(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=Gx(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function d1(r,e,t,o,i,n){let s=[],a=i.keySet,l=i.catchall._zod,c=l.def.type;for(let d of Object.keys(e)){if(a.has(d))continue;if(c==="never"){s.push(d);continue}let h=l.run({value:e[d],issues:[]},o);h instanceof Promise?r.push(h.then(f=>Ag(f,t,d,e))):Ag(h,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 h1=w("$ZodObject",(r,e)=>{if(de.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=Vc(()=>u1(e));Fe(r._zod,"propValues",()=>{let a=e.shape,l={};for(let c in a){let d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(let h of d.values)l[c].add(h)}}return l});let i=Ba,n=e.catchall,s;r._zod.parse=(a,l)=>{s??(s=o.value);let c=a.value;if(!i(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:r}),a;a.value={};let d=[],h=s.shape;for(let f of s.keys){let g=h[f]._zod.run({value:c[f],issues:[]},l);g instanceof Promise?d.push(g.then(y=>Ag(y,a,f,c))):Ag(g,a,f,c)}return n?d1(d,c,a,l,o.value,r):d.length?Promise.all(d).then(()=>a):a}}),kb=w("$ZodObjectJIT",(r,e)=>{h1.init(r,e);let t=r._zod.parse,o=Vc(()=>u1(e)),i=f=>{let v=new mh(["shape","payload","ctx"]),g=o.value,y=V=>{let K=ig(V);return`shape[${K}]._zod.run({ value: input[${K}], issues: [] }, ctx)`};v.write("const input = payload.value;");let x=Object.create(null),_=0;for(let V of g.keys)x[V]=`key_${_++}`;v.write("const newResult = {};");for(let V of g.keys){let K=x[V],H=ig(V);v.write(`const ${K} = ${y(V)};`),v.write(`
|
|
9
|
-
if (${K}.issues.length) {
|
|
10
|
-
payload.issues = payload.issues.concat(${K}.issues.map(iss => ({
|
|
1
|
+
var tB=Object.defineProperty;var Aa=(r,e)=>{for(var t in e)tB(r,t,{get:e[t],enumerable:!0})};var Ls=class r{static DEFAULT_SIZE=512;static DECAY=.9;#e;#t;#r;#i;#n;#o;#a;#l;#s=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e<<1,this.#r=new Ih(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#o=Pc.create(Pc.Type.Blackman,this.#e),this.#t=e,this.#a=new Float32Array(e),this.#l=new Float32Array(e)}clear(){this.#a.fill(0),this.#i.fill(0),this.#l.fill(0),this.#s=0}numBins(){return this.#t}bins(){return this.#a}waveform(){return this.#l}process(e,t,i,n){for(let o=i;o<n;++o)this.#i[this.#s]=e[o]+t[o],++this.#s===this.#e&&this.#u()}#u(){for(let t=0;t<this.#t;++t)this.#l[t]=this.#i[t<<1];for(let t=0;t<this.#e;++t)this.#i[t]*=this.#o[t];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let t=0;t<this.#t;++t){let i=this.#i[t],n=this.#n[t],o=Math.sqrt(i*i+n*n)*e;this.#a[t]<o?this.#a[t]=o:this.decay&&(this.#a[t]*=r.DECAY)}this.#s=0,this.#n.fill(0),this.decay=!1}};var Sc=r=>r,Z=r=>r!=null,Tn=r=>r===null;var Ks=r=>r===void 0,Dh=r=>r!==void 0,nP=r=>r==null,vx=(r,e)=>r!=null?e(r):void 0,X=(r,e="asDefined failed")=>r??N(_a(e)),De=(r,e)=>r instanceof e,Be=(r,e)=>r instanceof e?r:N(`${r} is not instance of ${e}`),yx=(r,e)=>{r instanceof e||N(`${r} is not instance of ${e}`)};var _a=r=>r instanceof Function?r():r;var _=(r,...e)=>r?.apply(null,e),Ch=r=>Z(r)&&typeof r=="object";var Th=r=>{throw new Error(`Unhandled ${r}`)},N=r=>{throw typeof r=="string"?new Error(r):r},I=(r,e)=>r?void 0:N(_a(e));var Pa=r=>new Proxy({},{get(){return N(r)}});var mx=class{value;status="success";constructor(e){this.value=e}error=Pa("Cannot access error when succeeded")},gx=class{error;status="failure";constructor(e){this.error=e}value=Pa("Cannot access value when failed")},Sa=r=>{try{return new mx(r())}catch(e){return new gx(e)}};var qr=(r,e)=>Object.keys(e).length===0?N("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(n=>isNaN(Number(n))).map(n=>e[n]).includes(r)?r:N(`Invalid enum value: ${String(r)}`),Ni=()=>{};var xx;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(xx||(xx={}));var O=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,t)=>{e.length=0,e.push(...t)};static consume=(e,t)=>{for(let i=0;i<e.length;)t(e[i])?e.splice(i,1):i++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>X(e.at(0),t);static getLast=(e,t)=>X(e.at(-1),t);static getPrev=(e,t)=>{let i=e.indexOf(t);return i===-1?N(`${t} not found in ${e}`):X(e.at((i-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let i=e.indexOf(t);return i===-1?N(`${t} not found in ${e}`):X(e.at((i+1)%e.length),"Internal Error")};static removeLast=(e,t)=>X(e.pop(),t);static create=(e,t)=>{let i=new Array(t);for(let n=0;n<t;n++)i[n]=e(n);return i};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++)if(!t(i,e[n]))return!1;return!0};static remove=(e,t)=>{let i=e.indexOf(t);if(i===-1)return N(`${t} not found in ${e}`);e.splice(i,1)};static removeIf=(e,t)=>{for(let i=e.length-1;i>=0;i--)t(e[i])&&e.splice(i,1)};static removeOpt=(e,t)=>{let i=e.indexOf(t);return i===-1?!1:(e.splice(i,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,i=new Set;for(let n of e)i.has(n)||(i.add(n),e[t++]=n);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let i=0,n=new Set;for(let o of e){let a=o[t];n.has(a)||(n.add(a),e[i++]=o)}return e.length=i,e};static subtract(e,t,i){return e.filter(n=>!t.some(o=>i(n,o)))}static intersect(e,t,i){return e.filter(n=>t.some(o=>i(n,o)))}static merge(e,t,i){return[...e.filter(n=>!t.some(o=>i(n,o))),...t]}static*iterate(e){for(let t=0;t<e.length;t++)yield e[t]}static*iterateReverse(e){for(let t=e.length-1;t>=0;t--)yield e[t]}static*iterateStateFull(e){let t=e.length-1;for(let i=0;i<=t;i++)yield{value:e[i],isFirst:i===0,isLast:i===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,i=e[0];t<e.length;t++){let n=e[t];yield[i,n],i=n}}static isSorted(e,t=xx.Ascending){if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++){let o=e[n];if(Math.sign(i-o)===t)return!1;i=o}return!0}static toRecord(e,t){return e.reduce((i,n)=>(i[t(n)]=n,i),{})}static concatArrayBuffers(e,t){let i=new ArrayBuffer(e.byteLength+t.byteLength),n=new Uint8Array(i);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),i}};var g;(function(r){r.wrap=t=>Z(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryFrom=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...i)=>r.wrap(t?.apply(null,i)),r.async=t=>t.then(i=>r.wrap(i),()=>r.None);class e{#e;constructor(i){this.#e=X(i)}unwrap(){return this.#e}unwrapOrElse(i){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(i){return i===this.#e}match(i){return i.some(this.#e)}ifSome(i){return i(this.#e)}ifAbsent(i){}isEmpty(){return!1}nonEmpty(){return!0}map(i){return r.wrap(i(this.#e))}mapOr(i,n){return i(this.#e)}flatMap(i){return i(this.#e)}equals(i){return this.unwrapOrNull()===i.unwrapOrNull()}assert(i){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>N(Z(t)?_a(t):"unwrap failed");unwrapOrElse=t=>_a(t);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=t=>!1;match=t=>t.none();ifSome=t=>{};ifAbsent=t=>t(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=t=>r.None;mapOr=(t,i)=>_a(i);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>N(_a(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(g||(g={}));var Rn;(function(r){r.async=e=>e.then(t=>r.ok(t),t=>r.err(t)),r.tryGet=e=>{try{return r.ok(e())}catch(t){return r.err(t)}},r.ok=e=>new class{value;constructor(t){this.value=t}asOption=()=>g.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=t=>{try{return r.ok(t(this.value))}catch(i){return r.err(i)}};flatMap=t=>t(this.value);match=t=>t.ok(this.value);toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),r.Ok=new class{constructor(){}asOption=()=>g.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>r.ok(e());flatMap=e=>e();match=e=>e.ok();toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},r.err=e=>new class{reason;constructor(t){this.reason=t}asOption=()=>g.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>N(`'${this.reason}'`);map=()=>this;flatMap=()=>this;match=t=>t.err(this.reason);toVoid=()=>r.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Rn||(Rn={}));var He;(function(r){r.exact=(e,t,i)=>{let n=0,o=e.length-1;for(;n<=o;){let a=n+o>>>1,s=i(e[a],t);if(s===0)return a;s<0?n=a+1:o=a-1}return-1},r.exactMapped=(e,t,i,n)=>{let o=0,a=e.length-1;for(;o<=a;){let s=o+a>>>1,l=i(n(e[s]),t);if(l===0)return s;l<0?o=s+1:a=s-1}return-1},r.leftMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}return n},r.rightMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<=0?n=a+1:o=a}return o-1},r.stableInsert=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}for(;n<e.length&&i(e[n],t)===0;)n++;return n},r.leftMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<0?o=s+1:a=s}return o},r.rightMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<=0?o=s+1:a=s}return a-1},r.rangeMapped=(e,t,i,n)=>[r.leftMostMapped(e,t,i,n),r.rightMostMapped(e,t,i,n)]})(He||(He={}));var nt=class{static every=(e,t)=>(e&t)===t;static some=(e,t)=>(e&t)>0;#e;#t;constructor(e=32){this.#e=e,this.#t=new Int32Array((e-1>>>5)+1)}getBit(e){let t=e>>>5,i=1<<e-(t<<5);return(this.#t[t]&i)!==0}setBit(e,t){let i=e>>>5,n=1<<e-(i<<5),o=this.#t[i],a=t?o|n:o&~n;return a===o?!1:(this.#t[i]=a,!0)}isEmpty(){return this.#t.every(e=>e===0)}nonEmpty(){return this.#t.some(e=>e>0)}set buffer(e){this.#t.set(new Int32Array(e))}get buffer(){return this.#t.buffer}replace(e){let t=new Int32Array(e),i=!1;for(let n=0;n<t.length;n++)this.#t[n]!==t[n]&&(this.#t[n]=t[n],i=!0);return i}toString(){let e="";for(let t of O.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var Rh=class{#e;#t=null;constructor(e){this.#e=e}invalidate=()=>this.#t=null;get(){return this.#t===null&&(this.#t=this.#e()),this.#t}terminate(){this.invalidate()}};var xt=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(Z(t)&&t.every(i=>!isNaN(i))){if(t.length===3)return[t[0]/255,t[1]/255,t[2]/255,1];if(t.length===4)return[t[0]/255,t[1]/255,t[2]/255,t[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,t,i){let n=l=>(l+e/30)%12,o=t*Math.min(i,1-i),a=l=>i-o*Math.max(-1,Math.min(n(l)-3,Math.min(9-n(l),1))),s=l=>Math.round(l*255).toString(16).padStart(2,"0");return`#${s(a(0))}${s(a(8))}${s(a(4))}`}static hexToHsl(e){let t=e.startsWith("#")?e.slice(1):e,i=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,a=Math.max(i,n,o),s=Math.min(i,n,o),l=(a+s)/2,u=0,p=0;if(a!==s){let d=a-s;switch(p=l>.5?d/(2-a-s):d/(a+s),a){case i:u=((n-o)/d+(n<o?6:0))*60;break;case n:u=((o-i)/d+2)*60;break;case o:u=((i-n)/d+4)*60;break}}return{h:u,s:p,l}}static hslStringToHex(e){let[t,i,n]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,i/100,n/100)}#e;#t;#r;#i;constructor(e,t,i,n=1){this.#e=e,this.#t=t,this.#r=i,this.#i=n}opacity(e){return new r(this.#e,this.#t,this.#r,e)}brightness(e){let t=Math.max(0,Math.min(100,this.#r+e));return new r(this.#e,this.#t,t,this.#i)}saturate(e){return new r(this.#e,this.#t*e,this.#r,this.#i)}fade(e){let t=this.#t*(1-Math.sqrt(e)),i=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,i,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Ec=(r,e)=>r-e;var ki=Math.PI*2,sM=Math.PI/2,wx=Math.PI/4,lM=1/Math.sqrt(2),ce=(r,e,t)=>Math.max(e,Math.min(r,t)),Hr=r=>Math.max(0,Math.min(r,1)),oP=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),On=(r,e)=>Math.floor(r/e)*e;var Oh=(r,e,t)=>r+(e-r)*t,aP=(r,e,t)=>r*Math.pow(e/r,t);var Bc=(r,e)=>rB(r/e)*e,rB=r=>r-Math.floor(r),fo=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var bx=(r,e)=>r*e/((2*e-1)*(r-1)+e);var Jr;(function(r){r.valueAt=({slope:n,steps:o,y0:a,y1:s},l)=>r.normalizedAt(l/o,n)*(s-a)+a,r.normalizedAt=(n,o)=>{if(o>.499999&&o<.500001)return n;{let a=ce(o,1e-15,.999999999999999);return a*a/(1-a*2)*(Math.pow((1-a)/a,2*n)-1)}},r.inverseAt=(n,o)=>{let a=ce(o,1e-15,.999999999999999);return Math.log(n*(1-2*a)/(a*a)+1)/(2*Math.log((1-a)/a))},r.coefficients=n=>{let o=r.valueAt(n,1),s=(r.valueAt(n,2)-o)/(o-n.y0),l=o-s*n.y0;return{m:s,q:l}};function*t(n,o,a,s){let{m:l,q:u}=r.coefficients({slope:n,steps:o,y0:a,y1:s});for(let p=0,d=a;p<o;p++)yield d=l*d+u}r.walk=t;function*i(n,o){let a=1/o,s=r.normalizedAt(a,n),u=(r.normalizedAt(2*a,n)-s)/s;for(let p=0,d=0;p<o;p++)yield d=u*d+s}r.walkNormalized=i,r.byHalf=(n,o,a,s)=>({slope:r.slopeByHalf(o,a,s),steps:n,y0:o,y1:s}),r.slopeByHalf=(n,o,a)=>Math.abs(a-n)<1e-6?.5:(o-n)/(a-n)})(Jr||(Jr={}));var en=new DataView(new ArrayBuffer(8)),Xt;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(en.setInt8(0,e),en.getInt8(0)),r.toShort=e=>(en.setInt16(0,e),en.getInt16(0)),r.toInt=e=>(en.setInt32(0,e),en.getInt32(0))})(Xt||(Xt={}));var Vn;(function(r){let i=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),n=new Float32Array(i),o=new Int32Array(i);r.floatToIntBits=a=>{let s=r.floatToRawIntBits(a);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},r.intBitsToFloat=a=>(o[0]=a,n[0]),r.floatToRawIntBits=a=>(n[0]=a,o[0]),r.toFloat32=a=>(en.setFloat32(0,a),en.getFloat32(0))})(Vn||(Vn={}));var sP;(function(r){r.floatToIntBits=e=>{let t=Vn.floatToIntBits(e),i=t>>>16&32768,n=(t&2147483647)+4096;return n>=1199570944?(t&2147483647)>=1199570944?n<2139095040?i|31744:i|31744|(t&8388607)>>>13:i|31743:n>=947912704?i|n-939524096>>>13:n<855638016?i:(n=(t&2147483647)>>>23,i|(t&8388607|8388608)+(8388608>>>n-102)>>>126-n)},r.intBitsToFloat=e=>{let t=e&1023,i=e&31744;if(i===31744)i=261120;else if(i!==0){if(i+=114688,t===0&&i>115712)return Vn.intBitsToFloat((e&32768)<<16|i<<13|1023)}else if(t!==0){i=115712;do t<<=1,i-=1024;while((t&1024)===0);t&=1023}return Vn.intBitsToFloat((e&32768)<<16|(i|t)<<13)}})(sP||(sP={}));var Vh;(function(r){let e=9218868437227405312n,t=4503599627370495n,i=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),n=new Float64Array(i),o=new BigInt64Array(i);r.float64ToLongBits=a=>{let s=r.float64ToRawLongBits(a);return(s&e)===e&&(s&t)!==0n?0x7ff8000000000000n:s},r.longBitsToFloat64=a=>(o[0]=a,n[0]),r.float64ToRawLongBits=a=>(n[0]=a,o[0]),r.clamp=a=>(en.setFloat64(0,a),en.getFloat64(0))})(Vh||(Vh={}));var Je=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let i of e)t++;return t}static some(e,t){for(let i of e)if(t(i))return!0;return!1}static every(e,t){for(let i of e)if(!t(i))return!1;return!0}static reduce(e,t,i){let n=i,o=0;for(let a of e)n=t(n,a,o++);return n}static includes(e,t){for(let i of e)if(i===t)return!0;return!1}static forEach(e,t){for(let i of e)t(i)}static*map(e,t){let i=0;for(let n of e)yield t(n,i++)}static*take(e,t){let i=0;for(let n of e){if(i++>=t)return;yield n}}static filter(e,t){let i=[];for(let n of e)t(n)&&i.push(n);return i}static filterMap(e,t){let i=[];for(let n of e){let o=t(n);Z(o)&&i.push(o)}return i}static reverse(e){let t=[];for(let i of e)t.push(i);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:i,value:n}=t.next(),o=n;if(i!==!0)for(;;){let{done:a,value:s}=t.next();if(a===!0){yield[o,null];return}yield[o,s],o=s}}};var Et=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?N(`position(${e}) cannot be negative.`):e>this.#e.byteLength?N(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#e.setInt8(this.#t++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#e.setInt16(this.#t,e,this.littleEndian),this.#t+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#e.setInt32(this.#t,e,this.littleEndian),this.#t+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#e.setBigInt64(this.#t,e,this.littleEndian),this.#t+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#e.setFloat32(this.#t,e,this.littleEndian),this.#t+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#e.setFloat64(this.#t,e,this.littleEndian),this.#t+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let t=0;t<e.length;++t)this.#e.setInt8(this.#t++,e[t])}writeString(e){let t=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+t*Int16Array.BYTES_PER_ELEMENT),this.writeInt(t);for(let i=0;i<t;i++)this.writeShort(e.charCodeAt(i))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let i=this.#e;this.#e=new DataView(new ArrayBuffer(fo(t+e)));for(let n=0;n<this.#t;n++)this.#e.setInt8(n,i.getInt8(n))}}},Ws=class{#e=0;writeByte(e){this.#e++}writeShort(e){this.#e+=2}writeInt(e){this.#e+=4}writeLong(e){this.#e+=8}writeFloat(e){this.#e+=4}writeDouble(e){this.#e+=8}writeBoolean(e){this.#e++}writeBytes(e){this.#e+=e.length}writeString(e){this.#e+=e.length+4}get count(){return this.#e}},zh=class{#e;#t=0;constructor(e=32){this.#e=new Int8Array(e)}result(){return this.#e}equals(e){return e===this?!0:this.#e.every((t,i)=>e.#e[i]===t)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#t>=this.#e.length&&(this.#t=0),this.#e[this.#t++]^=e}writeInt(e){this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBytes(e){e.forEach(t=>this.writeByte(t))}writeFloat(e){this.writeInt(Vn.floatToIntBits(e))}writeDouble(e){this.writeLong(Vh.float64ToLongBits(e))}writeLong(e){this.writeByte(Number(e)&255),this.writeByte(Number(e>>8n)&255),this.writeByte(Number(e>>16n)&255),this.writeByte(Number(e>>24n)&255),this.writeByte(Number(e>>32n)&255),this.writeByte(Number(e>>40n)&255),this.writeByte(Number(e>>48n)&255),this.writeByte(Number(e>>56n)&255)}writeString(e){for(let t=0;t<e.length;t++)this.writeShort(e.charCodeAt(t))}toHexString(){return Array.from(Je.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},ot=class{littleEndian=!1;#e;#t=0;constructor(e,t=0){this.#e=new DataView(e,t)}get position(){return this.#t}set position(e){e<0?N(`position(${e}) cannot be negative.`):e>this.#e.byteLength?N(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}readByte(){return this.#e.getInt8(this.#t++)}readShort(){let e=this.#e.getInt16(this.#t,this.littleEndian);return this.#t+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#e.getInt32(this.#t,this.littleEndian);return this.#t+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#e.getBigInt64(this.#t,this.littleEndian);return this.#t+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#e.getFloat32(this.#t,this.littleEndian);return this.#t+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#e.getFloat64(this.#t,this.littleEndian);return this.#t+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let t=0;t<e.length;t++)e[t]=this.readByte()}readString(){let e=this.readInt(),t="";for(let i=0;i<e;i++)t+=String.fromCharCode(this.readShort());return t}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var iB=r=>Z(r)?r.value!==void 0?"value":r.get!==void 0?"get":N(`Cannot resolve method key of ${r}`):N("Cannot resolve method key of undefined descriptor"),Zs=(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 N(`Cannot find getter for property '${e}'`);let l=s.get.apply(this);return Object.defineProperty(this,e,{value:l,configurable:!1,writable:!1,enumerable:!1}),l}};let i=iB(t),n=X(t[i]);return{[i]:function(...o){if(o.length>0)return N("lazy accessory must not have any construction parameters");let a=n.apply(this);return Object.defineProperty(this,e,{value:i==="get"?a:()=>a,configurable:!1,writable:!1,enumerable:!1}),a}}};var zn;(function(r){function*e(){}r.empty=e,r.next=i=>{let{value:n,done:o}=i.next();return o?null:n};function*t(...i){for(let n of i)for(let o of n)yield o}r.flatten=t})(zn||(zn={}));var Fc;(function(r){r.intersect1D=(e,t,i,n)=>Math.max(e,i)<=Math.min(t,n)})(Fc||(Fc={}));var Bt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...i)=>this.#e.forEach(n=>Object.getPrototypeOf(n)===Object.getPrototypeOf({})?_(n[t],...i):n[t]?.apply(n,i))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var lP=(r,...e)=>new Proxy([],{get(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0&&Number.isInteger(n))return new r(...e)}return i===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[i]},has(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0)return!0}return i in t}});var Ea=class{static createIfAbsent(e,t,i){let n=e.get(t);return n===void 0&&(n=i(t),e.set(t,n)),n}};var Nc=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var Uh=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=g.wrap(t),this.#t.ifSome(i=>Array.from(this.#e.values()).forEach(n=>n.sort(i)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return Je.some(this.#e.entries(),i=>e===i[0]&&i[1].includes(t))}containsKey(e){return Je.includes(this.#e.keys(),e)}containsValue(e){return Je.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??O.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let i=Ea.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())i.push(t);else{let n=He.stableInsert(i,t,this.#t.unwrap());i.splice(n,0,t)}}addAll(e,t){let i=Ea.createIfAbsent(this.#e,e,()=>[]);i.push(...t),this.#t.nonEmpty()&&i.sort(this.#t.unwrap())}remove(e,t){let i=this.#e.get(e);if(i===void 0)return!1;{let n=i.indexOf(t);return n===-1?!1:(i.splice(n,1),i.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let i=this.#e.get(e);if(i===void 0)return null;{let n=i.findIndex(t);if(n===-1)return null;{let o=i.splice(n,1)[0];return i.length===0&&this.#e.delete(e),o}}}removeValueIf(e){let t=[];for(let[i,n]of this.#e.entries())for(let o of n.filter(a=>e(a)))t.push([i,o]);for(let[i,n]of t)this.remove(i,n);return new Set(t.map(([,i])=>i))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??O.empty()}forEach(e){Je.forEach(this.#e.entries(),t=>e(t[0],t[1]))}keyCount(){return this.#e.size}keys(){return this.#e.keys()}sortKeys(e){let t=this.clone(),i=Array.from(this.keys()).sort(e);this.#e.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.#e.forEach((t,i)=>{e.#e.set(i,t.map(n=>n))}),e}},Gs=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let i=t[0],n=t[1];return[i,new Set(n)]}))}clear(){this.map.clear()}containsEntry(e,t){return Je.some(this.map.entries(),i=>e===i[0]&&i[1].has(t))}containsKey(e){return Je.includes(this.map.keys(),e)}containsValue(e){return Je.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??Nc.empty()}isEmpty(){return this.keyCount()===0}add(e,t){Ea.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let i=Ea.createIfAbsent(this.map,e,()=>new Set);for(let n of t)i.add(n)}remove(e,t){let i=this.map.get(e);return i===void 0?!1:i.delete(t)?(i.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[i,n]of this.map.entries()){for(let o of n)e(o)&&(n.delete(o),t.add(o));n.size===0&&this.map.delete(i)}return t}removeFromKeyIf(e,t){let i=this.map.get(e);if(i===void 0)return null;for(let n of i)if(t(n))return i.delete(n),i.size===0&&this.map.delete(e),n;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Nc.empty()}forEach(e){Je.forEach(this.map.entries(),t=>e(t[0],t[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let t=this.clone(),i=Array.from(this.keys()).sort(e);this.map.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.map.forEach((t,i)=>{e.map.set(i,new Set(Array.from(t)))}),e}};var L=Object.freeze({Empty:{terminate:Ni},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),z=class r{#e=[];isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}own(e){return this.#e.push(e),e}ownAll(...e){for(let t of e)this.#e.push(t)}spawn(){let e=new r;return e.own({terminate:()=>O.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var te=class{static subscribeMany(e,...t){return L.many(...t.map(i=>i.subscribe(()=>e(i))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(t=>t(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var Mr;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,i)=>{let n=new Set(Object.keys(t));for(let o of Object.keys(i))if(n.has(o))return N(`'${o}' is an overlapping key`);return{...t,...i}},r.include=(t,...i)=>{let n={};for(let o of i)n[o]=t[o];return n},r.exclude=(t,...i)=>{let n=new Set(i);return Object.entries(t).reduce((o,[a,s])=>(n.has(a)||(o[a]=s),o),{})},r.overwrite=(t,i)=>Object.assign(t,i)})(Mr||(Mr={}));var uP;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return L.Empty}catchupAndSubscribe(t){return t(this),L.Empty}}})(uP||(uP={}));var cP;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return L.Empty}catchupAndSubscribe(e){return e(this),L.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)}}})(cP||(cP={}));var Qr=class{#e;#t=g.None;constructor(e){this.#e=new te,this.wrap(e)}wrap(e){this.wrapOption(g.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(Z(e)&&e(this.#t.unwrap()),this.#t=g.None,this.#e.notify(this))}assert(e){return this.#t.assert(e),this}contains(e){return this.#t.contains(e)}equals(e){return this.#t.equals(e)}flatMap(e){return this.#t.flatMap(e)}ifSome(e){return this.#t.ifSome(e)}ifAbsent(e){return this.#t.ifAbsent(e)}isEmpty(){return this.#t.isEmpty()}map(e){return this.#t.map(e)}mapOr(e,t){return this.#t.mapOr(e,t)}match(e){return this.#t.match(e)}nonEmpty(){return this.#t.nonEmpty()}unwrap(e){return this.#t.unwrap(e)}unwrapOrElse(e){return this.#t.unwrapOrElse(e)}unwrapOrNull(){return this.#t.unwrapOrNull()}unwrapOrUndefined(){return this.#t.unwrapOrUndefined()}subscribe(e){return this.#e.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#e.subscribe(()=>e(this))}terminate(){this.#e.terminate()}};var Ir=class{#e;#t=g.None;#r;constructor(e,t){this.#e=new te,this.#r=t?.guard(e)??e,this.#t=g.wrap(t)}setValue(e){this.#t.nonEmpty()&&(e=this.#t.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#e.notify(this))}getValue(){return this.#r}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#e.subscribe(e)}terminate(){this.#e.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var Ax=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+ce(e,0,1)*this.#r}clamp(e){return ce(e,this.#e,this.#t)}floating(){return!0}},_x=class{#e;#t;#r;constructor(e,t){this.#e=ce(Math.round(e),Xt.MIN_VALUE,Xt.MAX_VALUE),this.#t=ce(Math.round(t),Xt.MIN_VALUE,Xt.MAX_VALUE),this.#r=this.#t-this.#e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+Math.round(ce(e,0,1)*this.#r)}clamp(e){return ce(Math.round(e),this.#e,this.#t)}floating(){return!1}},Px=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.log(t/e)}x(e){return Math.log(ce(e,this.#e,this.#t)/this.#e)/this.#r}y(e){return this.#e*Math.exp(ce(e,0,1)*this.#r)}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},Sx=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(i=>i===e);return t===-1?N(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(ce(e,0,1)*(this.#e.length-1));return t>-1?X(this.#e.at(t),`Could not find value for ${e}`):N(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},Ex=class{#e;#t;#r;#i;#n;constructor(e,t,i){this.#e=e,this.#t=i;let n=e*e,o=i*i,a=t*t,s=e+i-2*t,l=i-t;this.#r=((2*i-t)*e-t*i)/s,this.#i=(l*n+(a-o)*e+t*o-a*i)/(n+(2*i-4*t)*e+o-4*t*i+4*a),this.#n=-l/s}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#n)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},S;(function(r){r.linear=(o,a)=>new Ax(o,a),r.linearInteger=(o,a)=>new _x(o,a),r.exponential=(o,a)=>new Px(o,a),r.values=o=>new Sx(o),r.decibel=(o,a,s)=>new Ex(o,a,s);let e=new class{x(o){return o?1:0}y(o){return o>=.5}clamp(o){return o}floating(){return!1}},t=r.linear(0,1),i=r.linear(-1,1);r.bool=e;let n=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>i,r.DefaultDecibel=n})(S||(S={}));var P;(function(r){r.percent=({bipolar:o,fractionDigits:a}={})=>new e("%",a,!1,o),r.numeric=({unit:o,fractionDigits:a,unitPrefix:s,bipolar:l}={})=>new e(o,a,s,l),r.indices=(o,a)=>new class{x(s){return{unit:o,value:a[s]}}y(s){let l=a.indexOf(s);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:l}}},r.values=(o,a,s)=>new class{x(l){return{unit:o,value:s.at(a.indexOf(l))??"N/A"}}y(l){let 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?ce(l/200+.5,0,1):ce(l/100,0,1)};{s.endsWith(this.#e)&&this.#e.length>0&&(s=s.slice(0,-this.#e.length));let d=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(Z(d)){let f=t.indexOf(d);if(f>-1)return{type:"explicit",value:l*Math.pow(10,(f-4)*3)}}return{type:"explicit",value:l}}}x(a){if(Number.isNaN(a))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(a)){if(this.#e==="%")return this.#i?{value:(a*200-100).toFixed(this.#t),unit:this.#e}:{value:(a*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:l}=n(a);return{value:s.toFixed(this.#t),unit:`${l}${this.#e}`}}else return{value:a.toFixed(this.#t),unit:this.#e}}else return{value:a===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),i=o=>Math.log(o)/Math.log(9.999999999999998),n=o=>{let a=Math.floor(i(o)/3),s=t[a+4];return Z(s)?{value:o*Math.pow(10,a*-3),prefix:s}:{value:o,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(P||(P={}));var mo;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(mo||(mo={}));var qs;(function(r){r.create=(e=252854082)=>new Bx(e),r.monotoneAscending=(e,t=128,i=r.create())=>{let n=e.length;if(n<2)return N("Array must have at least 2 elements");let o=0;for(let s=1;s<n;s++){let l=Math.floor(i.uniform()*(1+t))+1;e[s]=l,o+=l}let a=0;e[0]=0;for(let s=1;s<n;s++)a+=e[s],e[s]=a/o;return e}})(qs||(qs={}));var Bx=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 fr;(function(r){class e{}r.createBuilder=i=>{let n=o=>{let a=o instanceof Array?[]:{};return Object.entries(o).forEach(([s,l])=>{l instanceof e?a[s]=l.initialValue():typeof l=="object"&&(a[s]=n(l))}),a};return()=>new t(i,Object.seal(n(i)))},r.bool=new class extends e{read(i){return i.readByte()===1}write(i,n){i.writeByte(n?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(i){return i.readByte()}write(i,n){i.writeByte(n)}initialValue(){return 0}},r.int16=new class extends e{read(i){return i.readShort()}write(i,n){i.writeShort(n)}initialValue(){return 0}},r.int32=new class extends e{read(i){return i.readInt()}write(i,n){i.writeInt(n)}initialValue(){return 0}},r.float=new class extends e{read(i){return i.readFloat()}write(i,n){i.writeFloat(n)}initialValue(){return 0}},r.double=new class extends e{read(i){return i.readDouble()}write(i,n){i.writeDouble(n)}initialValue(){return 0}},r.int64=new class extends e{read(i){return i.readLong()}write(i,n){i.writeLong(n)}initialValue(){return 0n}},r.floats=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readFloat();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeFloat(o[a])}initialValue(){return new Float32Array(i)}},r.doubles=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readDouble();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeDouble(o[a])}initialValue(){return new Float64Array(i)}};class t{#e;#t;#r;constructor(n,o){this.#e=n,this.#t=o,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(n){let o=(a,s)=>{Object.entries(a).forEach(([l,u])=>{let p=s;u instanceof e?p[l]=u.read(n,p[l]):typeof u=="object"&&o(u,p[l])})};o(this.#e,this.#t)}write(n){let o=(a,s)=>{Object.entries(a).forEach(([l,u])=>{let p=s;u instanceof e?u.write(n,p[l]):typeof u=="object"&&o(u,p[l])})};o(this.#e,this.#t)}#i(){let n=new Ws;return this.write(n),n.count}}})(fr||(fr={}));var Hs=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let i=this.#e(e),n=He.leftMostMapped(this.#r,i,this.#t,this.#e),o=this.#r[n];return Z(o)&&this.#t(this.#e(o),i)===0?t?(this.#r.splice(n,1,e),!0):!1:(this.#r.splice(n,0,e),!0)}getOrCreate(e,t){let i=He.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[i];if(Z(n)&&this.#t(this.#e(n),e)===0)return n;let o=t(e);return this.#r.splice(i,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,i)=>{let n=this.#t(this.#e(t),this.#e(i));if(n===0)throw"cancel";return n}),!0}catch(t){if(t==="cancel"){let i=new Map(this.entries());return this.#r.splice(0,this.#r.length,...i.values()),this.#r.sort((n,o)=>this.#t(this.#e(n),this.#e(o))),!1}return N(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=He.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):N(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=He.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,i=this.#r.length;for(;--i>=0;)e(this.#r[i])&&(this.#r.splice(i,1),t++);return t}get(e){return X(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let i=this.#i(e);if(Z(i))return i;throw t()}opt(e){return g.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return Z(this.#i(e))}hasValue(e){return Z(this.#i(this.#e(e)))}size(){return this.#r.length}isEmpty(){return this.#r.length===0}forEach(e){this.values().forEach(e)}values(){return this.#r}entries(){return this.#r.map(e=>[this.#e(e),e])}clear(){O.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=He.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?i:void 0}};var Js=(()=>{let r=g.None;return{info:e=>r.match({none:()=>Promise.resolve(),some:t=>t.info(e)}),approve:e=>r.match({none:()=>Promise.resolve(!0),some:t=>t.approve(e)}),progress:e=>r.match({none:()=>({message:"",terminate:Ni}),some:t=>t.progress(e)}),install:e=>{I(r.isEmpty(),"RuntimeNotification already installed"),r=g.wrap(e)}}})();var kc=class r{static POSITIVE_INFINITY=new r(Number.POSITIVE_INFINITY);static millis=e=>new r(e);static seconds=e=>new r(e*r.#e);static minutes=e=>new r(e*r.#t);static hours=e=>new r(e*r.#r);static days=e=>new r(e*r.#i);static#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/r.#e}absMinutes(){return Math.abs(this.#n)/r.#t}absHours(){return Math.abs(this.#n)/r.#r}absDays(){return Math.abs(this.#n)/r.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,t,i=Math.floor(Math.abs(this.#n)/1e3),n=Math.floor(i/60),o=Math.floor(n/60),a=Math.floor(o/24);return i<60?(e=i,t="second"):n<60?(e=n,t="minute"):o<24?(e=o,t="hour"):(e=a,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),t)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:t,m:i,s:n}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):t>0?[r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):i>0?[r.#o("m",i),r.#o("s",n)].join(", "):n>0?r.#o("s",n):"now"}static#o=(e,t)=>{switch(e){case"d":return`${t} ${t<2?"day":"days"}`;case"h":return`${t} ${t<2?"hour":"hours"}`;case"m":return`${t} ${t<2?"minute":"minutes"}`;case"s":return`${t} ${t<2?"second":"seconds"}`;default:return Th(e)}}};var Qs;(function(r){let e;(function(t){t[t.READING=0]="READING",t[t.READ=1]="READ",t[t.WRITING=2]="WRITING",t[t.WRITTEN=3]="WRITTEN"})(e||(e={})),r.writer=(t,i,n)=>{if(t.bytesTotal+1>i.byteLength)return N("Insufficient memory allocated.");let o=new Uint8Array(i),a=Et.use(i,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(n(t.object),a.position=0,t.write(a),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,i)=>{let n=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(n),a=new ot(n,1);return{buffer:n,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(a.position=0,t.read(a),i(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(Qs||(Qs={}));var A;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(t.slice(0)):t).then(n=>e(new Uint8Array(n.slice(0,r.length))))},r.validateBytes=t=>r.parse(r.toString(t)),r.validateString=t=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t),r.asString=t=>r.validateString(t)?t:N(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let i=new Uint8Array(r.length);return t.readBytes(new Int8Array(i.buffer)),i},r.toDataOutput=(t,i)=>t.writeBytes(new Int8Array(i.buffer)),r.toString=t=>{let i=O.create(n=>(n+256).toString(16).substring(1),256);return i[t[0]]+i[t[1]]+i[t[2]]+i[t[3]]+"-"+i[t[4]]+i[t[5]]+"-"+i[t[6]]+i[t[7]]+"-"+i[t[8]]+i[t[9]]+"-"+i[t[10]]+i[t[11]]+i[t[12]]+i[t[13]]+i[t[14]]+i[t[15]]},r.parse=t=>{let i=t.replace(/-/g,"").toLowerCase();if(i.length!==32)return N("Invalid UUID format");let n=new Uint8Array(r.length);for(let o=0,a=0;o<32;o+=2,a++)n[a]=parseInt(i.slice(o,o+2),16);return n},r.Comparator=(t,i)=>{if(t.length!==r.length||i.length!==r.length)return N("Unexpected array length for uuid(v4)");for(let n=0;n<r.length;n++){let o=t[n]-i[n];if(o!==0)return o}return 0},r.equals=(t,i)=>r.Comparator(t,i)===0,r.newSet=t=>new Hs(t,r.Comparator),r.Lowest=r.parse("00000000-0000-4000-8000-000000000000"),r.Highest=r.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),r.fromInt=t=>{let i=new Uint8Array(r.Lowest),n=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)i[o]=n[o];return i},r.zType=t=>t.string().refine(i=>r.validateString(i),{message:"Invalid UUID format"}).transform(i=>i);let e=t=>(I(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(A||(A={}));var ve=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=O.create(()=>new Float32Array(128),e)}clear(e,t){this.#e.forEach(i=>i.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){I(!this.#e.some(e=>e.some(t=>isNaN(t))),"AudioBuffer is invalid (NaN)")}channels(){return this.#e}replace(e){this.replaceInto(e.#e)}replaceInto(e){I(e.length===2,"mixLayout: target.length must be 2"),I(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2"),this.#e.length===1?(e[0].set(this.#e[0]),e[1].set(this.#e[0])):(e[0].set(this.#e[0]),e[1].set(this.#e[1]))}mixInto(e){I(e.length===2,"mixLayout: target.length must be 2"),I(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,i]=e;if(this.#e.length===1){let[n]=this.#e;for(let o=0;o<128;o++)t[o]+=n[o],i[o]+=n[o]}else{let[n,o]=this.#e;for(let a=0;a<128;a++)t[a]+=n[a],i[a]+=o[a]}}};var st;(function(r){r[r.Idle=0]="Idle",r[r.Attack=1]="Attack",r[r.Decay=2]="Decay",r[r.Sustain=3]="Sustain",r[r.Release=4]="Release"})(st||(st={}));var Ys=class{#e;#t=st.Idle;#r=0;#i=0;#n=0;#o=0;#a=0;#l=0;#s=0;#u=0;#c=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==st.Idle&&this.#t!==st.Release}get complete(){return this.#t===st.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,i,n){this.#n=e,this.#o=t,this.#a=i,this.#l=n,this.#d()}#d(){switch(this.#t){case st.Attack:{let e=1-this.#r;this.#s=e*this.#e/Math.max(this.#n,1e-6);break}case st.Decay:{let e=this.#r-this.#a;this.#u=e*this.#e/Math.max(this.#o,1e-6);break}case st.Release:{let e=this.#r;this.#c=e*this.#e/Math.max(this.#l,1e-6);break}case st.Sustain:case st.Idle:{this.#s=this.#e/Math.max(this.#n,1e-6),this.#u=(1-this.#a)*this.#e/Math.max(this.#o,1e-6),this.#c=this.#a*this.#e/Math.max(this.#l,1e-6);break}}}gateOn(){this.#t=st.Attack}gateOff(){this.#t!==st.Idle&&(this.#t=st.Release,this.#d())}forceStop(){this.#t=st.Idle,this.#r=0}process(e,t,i){for(let n=t;n<i;)switch(this.#t){case st.Attack:for(;n<i;){if(this.#r+=this.#s,this.#r>=1){this.#r=1,this.#i=1,e[n++]=this.#r,this.#t=st.Decay,this.#d();break}e[n++]=this.#i=this.#r}break;case st.Decay:for(;n<i;){if(this.#r-=this.#u,this.#r<=this.#a){this.#r=this.#a,this.#i=2,e[n++]=this.#r,this.#t=st.Sustain,this.#d();break}this.#i=1+(1-this.#r)/(1-this.#a),e[n++]=this.#r}break;case st.Sustain:e.fill(this.#a,n,i);return;case st.Release:for(;n<i;){if(this.#r-=this.#c,this.#r<=0){this.#r=0,this.#i=0,e[n++]=this.#r,this.#t=st.Idle,this.#d();break}this.#i=3+(1-this.#r/this.#a),e[n++]=this.#r}break;case st.Idle:e.fill(0,n,i);return}}};var tn=class{a1=0;a2=0;b0=0;b1=0;b2=0;constructor(){this.identity()}identity(){this.setNormalizedCoefficients(1,0,0,1,0,0)}setLowpassParams(e,t=Math.SQRT1_2){if(e=ce(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=ki*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1-o)/2,s=a,l=2*a,u=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,l,u,p,d,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=ce(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let i=ki*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1+o)/2,s=a,l=-2*a,u=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,l,u,p,d,f)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,i,n,o,a){let s=1/n;return this.b0=e*s,this.b1=t*s,this.b2=i*s,this.a1=o*s,this.a2=a*s,this}setLowShelfParams(e,t){e=ce(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(i*i,0,0,1,0,0);else if(e>0){let n=ki*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),l=2*Math.sqrt(i)*a,u=i+1,p=i-1,d=i*(u-p*s+l),f=2*i*(p-u*s),v=i*(u-p*s-l),m=u+p*s+l,y=-2*(p+u*s),x=u+p*s-l;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=ce(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=ki*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),l=2*Math.sqrt(i)*a,u=i+1,p=i-1,d=i*(u+p*s+l),f=-2*i*(p+u*s),v=i*(u+p*s-l),m=u-p*s+l,y=2*(p-u*s),x=u-p*s-l;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);return this}setPeakingParams(e,t,i){e=ce(e,0,1),t=Math.max(0,t);let n=Math.pow(10,i/40);if(e>0&&e<1)if(t>0){let o=ki*e,a=Math.sin(o)/(2*t),s=Math.cos(o),l=1+a*n,u=-2*s,p=1-a*n,d=1+a/n,f=-2*s,v=1-a/n;this.setNormalizedCoefficients(l,u,p,d,f,v)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,t){if(e=ce(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=ki*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1-n,s=-2*o,l=1+n,u=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,u,p,d)}else this.setNormalizedCoefficients(-1,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNotchParams(e,t){if(e=ce(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=ki*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1,s=-2*o,l=1,u=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,u,p,d)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,t){if(e=Math.max(0,e),t=Math.max(0,t),e>0&&e<1){let i=ki*e;if(t>0){let n=Math.sin(i)/(2*t),o=Math.cos(i),a=n,s=0,l=-n,u=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,u,p,d)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,i){I(e.length===t.length&&e.length===i.length,"Array lengths do not match");let n=this.b0,o=this.b1,a=this.b2,s=this.a1,l=this.a2;for(let u=0;u<e.length;++u){let p=-Math.PI*2*e[u],d=Math.cos(p),f=Math.sin(p),v=n+((o+a*d)*d-a*f*f),m=(o+a*d)*f+a*f*d,y=1+((s+l*d)*d-l*f*f),x=(s+l*d)*f+l*f*d,F=y*y+x*x,D=(v*y+m*x)/F,R=(m*y-v*x)/F;t[u]=Math.sqrt(D*D+R*R),i[u]=Math.atan2(R,D)}}};var wt=class{#e=0;#t=0;#r=0;#i=0;reset(){this.#e=0,this.#t=0,this.#r=0,this.#i=0}process({a1:e,a2:t,b0:i,b1:n,b2:o},a,s,l,u){let p=this.#e,d=this.#t,f=this.#r,v=this.#i;for(let m=l;m<u;m++){let y=a[m],x=s[m]=i*y+n*p+o*d-e*f-t*v+1e-18-1e-18;d=p,p=y,v=f,f=x}this.#e=p,this.#t=d,this.#r=f,this.#i=v}processFrame({a1:e,a2:t,b0:i,b1:n,b2:o},a){let s=i*a+n*this.#e+o*this.#t-e*this.#r-t*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=a,this.#i=this.#r,this.#r=s,s}},go=class{#e;#t;constructor(e){this.#e=O.create(()=>new wt,e),this.#t=this.#e.length}get order(){return this.#t}set order(e){this.#t!==e&&(this.#t=e,this.reset())}reset(){this.#e.forEach(e=>e.reset())}process(e,t,i,n,o){for(let a=0;a<this.#t;a++)this.#e[a].process(e,t,i,n,o),t=i}processFrame(e,t){for(let i=0;i<this.#t;i++)t=this.#e[i].processFrame(e,t);return t}},$c=512,jh=class{#e;#t=new tn;#r;#i=-1;constructor(e,t,i){this.#r=new go(4),this.#e=new Float32Array($c+1);let n=Math.log(t/e),o=1/i;for(let a=0;a<=$c;a++)this.#e[a]=e*Math.exp(a/$c*n)*o}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,i,n,o,a){let s=this.#e,l=this.#r,u=this.#t,p=n/l.order**1.25,d=o,f=this.#i;for(;d<a;){let v=Math.floor(Hr(i[d])*$c),m=d+1;for(;m<a&&Math.floor(Hr(i[m])*$c)===v;)++m;v!==f&&(f=v,u.setLowpassParams(s[v],p)),l.process(u,e,t,d,m),d=m}this.#i=f}};var dP=Math.log(10)/20,Mc=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Oe=r=>Math.exp(r*dP),Fx=r=>Math.log(r)/dP,Xs=r=>Oe(20*Math.log10(r));var nB=.02,pP=1e3,Lh=class{#e;#t;#r;#i;#n;#o;#a=NaN;#l=NaN;#s=0;#u=0;#c=0;#d=8;#p=0;#h=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*nB)|0,this.#r=new tn,this.#r.setLowpassParams(.5),this.#i=[new wt,new wt],this.#n=[new Float32Array(128),new Float32Array(128)],this.#o=new Float32Array(2)}process(e,t,i,n){let[o,a]=e,[s,l]=t,[u,p]=this.#n;this.#i[0].process(this.#r,o,u,i,n),this.#i[1].process(this.#r,a,p,i,n);let d=Oe(this.#p),f=Oe(-this.#p/2),v=this.#e/this.#a,m=Math.pow(2,this.#d)-1,y=1/m;for(let x=i;x<n;x++)this.#u>0&&(this.#a+=this.#s,--this.#u===0&&(this.#s=0,this.#a=this.#l),this.#r.setLowpassParams(Math.max(this.#a,pP)/this.#e)),this.#c+=1,this.#c>=v&&(this.#c-=v,this.#o[0]=ce(Math.round(u[x]*d*m)*y,-1,1),this.#o[1]=ce(Math.round(p[x]*d*m)*y,-1,1)),s[x]=(o[x]*(1-this.#h)+this.#o[0]*this.#h)*f,l[x]=(a[x]*(1-this.#h)+this.#o[1]*this.#h)*f;this.#f=!0}setCrush(e){let t=aP(20,this.#e*.5,e);this.#f&&isFinite(this.#a)?(this.#l=t,this.#s=(t-this.#a)/this.#t,this.#u=this.#t):(this.#a=t,this.#r.setLowpassParams(Math.max(this.#a,pP)/this.#e))}setBitDepth(e){this.#d=ce(e,1,16)}setBoost(e){this.#p=e}setMix(e){this.#h=Hr(e)}reset(){this.#f=!1,this.#l=NaN,this.#s=0,this.#u=0,this.#c=0,this.#o.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Kh=class r{static#e=10;#t=1;#r=0;#i=0;#n=0;#o=0;#a=0;set(e,t,i){this.#t=e,this.#r=t*r.#e,this.#i=Oh(1e-5,1-1e-5,i),this.#n=2**Math.abs(this.#r),this.#o=1/this.#i,this.#a=1/(1-this.#i)}compute(e){let t=e-Math.floor(e),i,n,o,a;return this.#r<0?(i=1-t,n=1-this.#i,o=this.#a,a=this.#o):(i=t,n=this.#i,o=this.#o,a=this.#a),i<=n?1-(1-i*o)**this.#n*this.#t:((1-i)*a)**this.#n*this.#t-this.#t+1}};var Ic;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Ic||(Ic={}));var Ba;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(Ba||(Ba={}));var Kt;(function(r){r.globalToLocal=(t,i)=>Bc(i-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:i,loopOffset:n,loopDuration:o},a,s)=>{let l=t-n,u=l+o;if(l>=s||u<=a)return g.None;let p=Math.max(l,a),d=Math.min(u,s);return g.wrap({index:0,rawStart:l,rawEnd:u,regionStart:Math.max(l,t),regionEnd:Math.min(u,i),resultStart:p,resultEnd:d,resultStartValue:l<p?(p-l)/o:0,resultEndValue:u>d?(d-l)/o:1})};function*e({position:t,complete:i,loopOffset:n,loopDuration:o},a,s){let l=t-n,u=Math.max(t,a),p=Math.min(i,s),d=Math.floor((u-l)/o),f=l+d*o;for(;f<p;){let v=f+o,m=Math.max(f,t),y=Math.min(v,i),x=Math.max(f,u),F=Math.min(v,p),D=f<x?(x-f)/o:0,R=v>F?(F-f)/o:1;yield{index:d++,rawStart:f,rawEnd:v,regionStart:m,regionEnd:y,resultStart:x,resultEnd:F,resultStartValue:D,resultEndValue:R},f=v}}r.locateLoops=e})(Kt||(Kt={}));var mr=class r{static DefaultComparator=(e,t)=>e.position-t.position;static create(e){return new r(e??r.DefaultComparator)}#e;constructor(e){this.#e=new Wh(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?zn.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,i){return this.#e.isEmpty()?zn.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,i)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},vo=class r{static Comparator=(e,t)=>e.position-t.position;static create(e){return new r(e)}#e;constructor(e=r.Comparator){this.#e=new Wh(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?zn.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return zn.empty();let i=Math.max(0,this.#e.floorLastIndex(e)),n=this.#e.optAt(i);if(n===null)return zn.empty();for(;n.position+n.duration<=e;)if(n=this.#e.optAt(++i),n===null||n.position>=t)return zn.empty();return this.#e.iterate(i,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},el=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=He.leftMost(this.#e,e,Ba.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let i=this.#e.filter(n=>n.position<=e&&e<n.position+n.duration);yield*Z(t)?i.sort(t):i}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let i=this.#e[t];if(Ba.complete(i)<e)this.#e.splice(t,1),yield i;else return}}*releaseAll(){if(this.#e.length!==0)for(let e=this.#e.length-1;e>=0;e--){let t=this.#e[e];Number.POSITIVE_INFINITY>t.duration&&(this.#e.splice(e,1),yield t)}}isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}clear(){O.clear(this.#e)}},Wh=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let t=this.#e.indexOf(e);return t===-1?!1:(this.#e.splice(t,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let i=e.position,n=He.leftMostMapped(this.#e,i,Ec,Ic.PositionExtractor);for(let o=n;o<this.#e.length;o++){let a=this.#e[o];if(a===e)return!0;if(a.position!==i)return!1}return!1}clear(){++this.modCount,O.clear(this.#e),this.#t=!1}optAt(e){return e<0||e>=this.#e.length?null:(this.#t&&this.#r(),this.#e[e])}asArray(){return this.#t&&this.#r(),this.#e}lowerEqual(e,t){if(t===void 0)return this.optAt(this.floorLastIndex(e));let i=this.floorLastIndex(e);for(;i>=0;){let n=this.#e[i--];if(t(n))return n}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let i=this.ceilFirstIndex(e);for(;i<this.#e.length;){let n=this.#e[i++];if(t(n))return n}return null}floorLastIndex(e){return this.#t&&this.#r(),He.rightMostMapped(this.#e,e,Ec,Ic.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),He.leftMostMapped(this.#e,e,Ec,Ic.PositionExtractor)}iterateFrom(e,t){let i=this.floorLastIndex(e),n=i;if(n<0)return this.iterate(0,Xt.MAX_VALUE,t);for(;n>=0;){let o=this.optAt(n);if(o!==null&&t!==void 0&&t(o))return this.iterate(n,Xt.MAX_VALUE,t);n--}return this.iterate(i,Xt.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,i=mo.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let n=this.#e[e++];if(n.position>=t)return;i(n)&&(yield n)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var Ih=class r{static reverse(e){return e=(e&1431655765)<<1|e>>>1&1431655765,e=(e&858993459)<<2|e>>>2&858993459,e=(e&252645135)<<4|e>>>4&252645135,e=e<<24|(e&65280)<<8|e>>>8&65280|e>>>24,e}#e;#t;#r;#i;constructor(e){this.#e=e;let t=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(t),this.#i=new Float32Array(t);for(let i=0;i<t;i++){let n=2*Math.PI*i/e;this.#r[i]=Math.cos(n),this.#i[i]=Math.sin(n)}}process(e,t){let i,n,o,a;for(let u=0;u<this.#e;++u)n=r.reverse(u)>>>this.#t,n>u&&(a=e[u],e[u]=e[n],e[n]=a,a=t[u],t[u]=t[n],t[n]=a);let s=this.#r,l=this.#i;for(let u=2;u<=this.#e;u<<=1){let p=u>>1,d=this.#e/u;for(i=0;i<this.#e;i+=u){let f=i+p;for(n=i,o=0;n<f;n++,o=o+d|0){let v=n+p|0,m=s[o],y=l[o],x=e[v],F=t[v],D=x*m+F*y,R=F*m-x*y,T=e[n],W=t[n];e[v]=T-D,t[v]=W-R,e[n]=T+D,t[n]=W+R}}if(u===this.#e)break}}};var Nx=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var kx=(r,e)=>Math.floor(3840/e)*r,hP=(r,e=4,t=4)=>{let i=kx(1,t),n=Math.floor(r/i),o=Math.floor(n/e),s=(Math.floor(r)-kx(o*e,t))%i,l=Math.floor(s/240),u=s%240;return{bars:o,beats:n-o*e,semiquavers:l,ticks:u}},fP=(r,e)=>r*e/60*960,mP=(r,e)=>r*60/960/e,oB=(r,e)=>e*60/960/r,aB=(r,e,t)=>fP(r/t,e),sB=(r,e,t)=>mP(r,e)*t,Y={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:kx,toParts:hP,secondsToPulses:fP,pulsesToSeconds:mP,secondsToBpm:oB,samplesToPulses:aB,pulsesToSamples:sB,toString:(r,e=4,t=4)=>{let{bars:i,beats:n,semiquavers:o,ticks:a}=hP(r|0,e,t);return`${i+1}.${n+1}.${o+1}:${a}`}};var er;(function(r){r.builder=()=>new e,r.toDouble=([t,i])=>t/i,r.toPPQN=([t,i])=>Y.fromSignature(t,i);class e{#e=[];add(i){return this.#e.push(i),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(i)-r.toDouble(n))}asDescendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(n)-r.toDouble(i))}}})(er||(er={}));var rn=class{static*iterate(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield o,o=++n*i}static*iterateWithIndex(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield{position:o,index:n},o=++n*i}};var tl=class{#e=0;#t=NaN;#r=NaN;#i=0;#n=0;constructor(){}reset(){this.#e=0,this.#t=NaN,this.#r=NaN,this.#i=0,this.#n=0}init(e){this.#e=e,isNaN(this.#t)&&(this.#t=this.#e)}currentFrequency(){return this.#t}glideTo(e,t){if(t===0){this.#e=e;return}this.#e=this.#t,this.#r=e,this.#i=0,this.#n=t}process(e,t,i,n){if(isNaN(this.#r)){for(let o=i;o<n;o++)e[o]*=this.#e;this.#t=this.#e}else{let o=Y.samplesToPulses(1,t,sampleRate);for(let a=i;a<n;a++){if(this.#i+=o/this.#n,this.#i>=1){this.#i=1,this.#e=this.#r,this.#r=NaN;for(let s=a;s<n;s++)e[s]*=this.#e;break}e[a]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,i){if(isNaN(this.#r))this.#t=this.#e;else{let n=Y.samplesToPulses(i-t,e,sampleRate);this.#i+=n/this.#n,this.#i>=1?(this.#i=1,this.#e=this.#t=this.#r,this.#r=NaN):this.#t=this.#e+(this.#r-this.#e)*this.#i}}};var Zh=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){I(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),I(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){O.remove(this.#e,e);let t=this.#t.delete(e);I(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??O.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){let i=X(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`);I(!i.includes(e),`${e} is already marked.`),i.push(e)}removeEdge([e,t]){let i=X(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);I(i.includes(e),`${e} is not marked.`),O.remove(i,e)}isEmpty(){return this.#e.length===0}},Gh=class{#e;#t;#r;#i;#n;constructor(e){this.#e=e,this.#t=[],this.#r=new Set,this.#i=new Set,this.#n=new Map}update(){this.#o(),this.#e.vertices().forEach(e=>this.#a(e))}sorted(){return this.#t}hasLoops(){return this.#i.size!==0}#o(){this.#l();let e=new Map;for(let i of this.#e.vertices())this.#n.set(i,new Set),e.set(i,new Set);for(let i of this.#e.vertices())for(let n of this.#e.getPredecessors(i))X(this.#n.get(n),`Could not find Successor for ${n}`).add(i);let t;do{t=!1;for(let i of this.#e.vertices()){X(e.get(i)).clear();for(let n of X(this.#n.get(i)))for(let o of X(this.#n.get(n)))this.#n.get(i)?.has(o)||(t=!0,X(e.get(i)).add(o))}for(let i of this.#e.vertices()){let n=X(this.#n.get(i));X(e.get(i)).forEach(o=>n.add(o))}}while(t)}#a(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(X(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#a(t)}this.#t.push(e)}}#l(){O.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var Dc;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(Dc||(Dc={}));var qh=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,t){let i=this.#e.duration(),n=On(t,i),o=(t-n)/i,a=e?this.#e.fx(o):this.#e.fy(o);return n+a*i}};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 Hh=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,i,n,o){let a=i/this.sampleRate;switch(t){case Ke.sine:{for(let s=n;s<o;s++)e[s]=Math.sin(this.#e*Math.PI*2),this.#e+=a,this.#e>=1&&(this.#e-=1);break}case Ke.triangle:{for(let s=n;s<o;s++){let l=this.#e%1;e[s]=4*Math.abs(l-.5)-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case Ke.saw:{for(let s=n;s<o;s++){let l=this.#e%1;e[s]=2*l-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case Ke.square:{for(let s=n;s<o;s++){let l=this.#e%1;e[s]=l<.5?1:-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}}}reset(){this.#e=0}};var nn;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(nn||(nn={}));var Jh;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,i)=>t|=1<<i,0),r.Names={English:["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],German:["C","Cis","D","Dis","E","F","Fis","G","Gis","A","Ais","H"],Solfege:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],French:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Spanish:["Do","Do#","Re","Re#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Japanese:["\u30C9","\u30C9\u266F","\u30EC","\u30EC\u266F","\u30DF","\u30D5\u30A1","\u30D5\u30A1\u266F","\u30BD","\u30BD\u266F","\u30E9","\u30E9\u266F","\u30B7"]},r.isBlackKey=t=>(r.BlackKeyBits&1<<t%12)!==0,r.toFullString=t=>`${r.Names.English[t%12]}${Math.floor(t/12)-2}`,r.keyboardTracking=(t,i)=>Hr((t-60)*i);class e{#e;#t;constructor(i,...n){this.#e=i,this.#t=n.reduce((o,a)=>o|=1<<a,0)}get name(){return this.#e}get bits(){return this.#t}has(i){return(this.#t&1<<i%12)!==0}equals(i){return this.#t===i.bits}}r.StockScales=[new e("Major",0,2,4,5,7,9,11),new e("Natural Minor",0,2,3,5,7,8,10),new e("Harmonic Minor",0,2,3,5,7,8,11),new e("Melodic Minor",0,2,3,5,7,9,11),new e("Dorian",0,2,3,5,7,9,10),new e("Phrygian",0,1,3,5,7,8,10),new e("Lydian",0,2,4,6,7,9,11),new e("Mixolydian",0,2,4,5,7,9,10),new e("Locrian",0,1,3,5,6,8,10),new e("Pentatonic Major",0,2,4,7,9),new e("Pentatonic Minor",0,3,5,7,10),new e("Blues",0,3,5,6,7,10),new e("Whole Tone",0,2,4,6,8,10),new e("Diminished",0,2,3,5,6,8,9,11),new e("Augmented",0,3,4,7,8,11)]})(Jh||(Jh={}));var tr;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let i=e.position-t.position;if(i!==0)return i;let n=e.pitch-t.pitch;return n!==0?n:0},r.curveFunc=(e,t)=>t<0?e**2**-t:1-(1-e)**2**t,r.inverseCurveFunc=(e,t)=>t<0?e**2**t:1-Math.max(0,1-e)**2**-t,r.CompleteComparator=(e,t)=>{let i=Ba.complete(e)-Ba.complete(t);return i!==0?i:e.pitch-t.pitch}})(tr||(tr={}));var Cc=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,i,n,o){let a=t*this.#e;switch(i){case Ke.sine:this.#i(e,a,n,o);break;case Ke.saw:this.#n(e,a,n,o);break;case Ke.square:this.#o(e,a,n,o);break;case Ke.triangle:this.#a(e,a,n,o);break}}generateFromFrequencies(e,t,i,n,o){switch(i){case Ke.sine:this.#l(e,t,n,o);break;case Ke.saw:this.#s(e,t,n,o);break;case Ke.square:this.#u(e,t,n,o);break;case Ke.triangle:this.#c(e,t,n,o);break}}#i(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++)e[a]=Math.sin(2*Math.PI*(o%1)),o+=t;this.#t=o}#n(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=2*s-1-on(s,t),o+=t}this.#t=o}#o(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=(s<.5?1:-1)+on(s,t)-on((s+.5)%1,t),o+=t}this.#t=o}#a(e,t,i,n){let o=this.#t,a=this.#r,s=4*t;for(let l=i;l<n;l++){let u=o%1,p=(u<.5?1:-1)+on(u,t)-on((u+.5)%1,t);a=a*.9995+p*s,e[l]=a,o+=t}this.#t=o,this.#r=a}#l(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++)e[s]=Math.sin(2*Math.PI*(a%1)),a+=t[s]*o;this.#t=a}#s(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let l=t[s]*o,u=a%1;e[s]=2*u-1-on(u,l),a+=l}this.#t=a}#u(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let l=t[s]*o,u=a%1;e[s]=(u<.5?1:-1)+on(u,l)-on((u+.5)%1,l),a+=l}this.#t=a}#c(e,t,i,n){let o=this.#e,a=this.#t,s=this.#r;for(let l=i;l<n;l++){let u=t[l]*o,p=a%1,d=(p<.5?1:-1)+on(p,u)-on((p+.5)%1,u);s=s*.9995+d*(4*u),e[l]=s,a+=u}this.#t=a,this.#r=s}},on=(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 Un;(function(r){r.zero=()=>({ll:0,lr:0,rl:0,rr:0}),r.identity=()=>({ll:1,lr:0,rl:0,rr:1}),r.update=(e,{gain:t,panning:i,invertL:n,invertR:o,stereo:a,swap:s},l=nn.EqualPower)=>{let[u,p]=r.panningToGains(i,l),d=u*t,f=p*t;n&&(d*=-1),o&&(f*=-1);let v=Math.max(0,-a),m=Math.max(0,a),y=1-m,x=1+m,F=v*.5,D=1-v,R=(y+x)*.5,T=(y-x)*.5,W=(y-x)*.5,ne=(y+x)*.5,se=d*(F+D)*R+f*F*T,J=d*(F+D)*W+f*F*ne,fe=d*F*R+f*(F+D)*T,Q=d*F*W+f*(F+D)*ne;s?(e.ll=J,e.rl=se,e.lr=Q,e.rr=fe):(e.ll=se,e.lr=fe,e.rl=J,e.rr=Q)},r.panningToGains=(e,t)=>{let i=ce(e,-1,1);switch(t){case nn.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case nn.EqualPower:return[Math.cos((i+1)*wx),Math.sin((i+1)*wx)]}},r.applyFrame=(e,t,i)=>[e.ll*t+e.rl*i,e.lr*t+e.rr*i],r.processFrames=(e,t,i,n,o)=>{let[a,s]=t,[l,u]=i;for(let p=n;p<o;p++){let d=a[p],f=s[p];l[p]=e.ll*d+e.rl*f,u[p]=e.lr*d+e.rr*f}},r.replaceFrames=(e,[t,i],n,o)=>{for(let a=n;a<o;a++){let s=t[a],l=i[a];t[a]=e.ll*s+e.rl*l,i[a]=e.lr*s+e.rr*l}}})(Un||(Un={}));var Wt;(function(r){r.linear=(i,n=.005)=>new e(Math.ceil(i*n)|0),r.stereoMatrix=(i,n=.005)=>new t(Math.ceil(i*n)|0);class e{#e;#t=0;#r=0;#i=0;#n=0;constructor(n){this.#e=n}set(n,o){this.#t!==n&&(o===!0?(this.#r=n,this.#i=(n-this.#t)/this.#e,this.#n=this.#e):(this.#t=this.#r=n,this.#i=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t+=this.#i,--this.#n===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(n){return this.#t===n&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#e;#t=Un.zero();#r=Un.zero();#i=Un.zero();#n=0;constructor(n){this.#e=n}update(n,o,a){Un.update(this.#r,n,o),a===!0?(this.#i.ll=(this.#r.ll-this.#t.ll)/this.#e,this.#i.lr=(this.#r.lr-this.#t.lr)/this.#e,this.#i.rl=(this.#r.rl-this.#t.rl)/this.#e,this.#i.rr=(this.#r.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0)}processFrames(n,o,a,s){let[l,u]=n,[p,d]=o;if(this.isInterpolating())for(let f=a;f<s;f++){let v=l[f],m=u[f],y=this.moveAndGet();p[f]=y.ll*v+y.rl*m,d[f]=y.lr*v+y.rr*m}else{let f=this.#r;for(let v=a;v<s;v++){let m=l[v],y=u[v];p[v]=f.ll*m+f.rl*y,d[v]=f.lr*m+f.rr*y}}}set(n,o){this.#o(n)||(o===!0?(this.#r.ll=n.ll,this.#r.lr=n.lr,this.#r.rl=n.rl,this.#r.rr=n.rr,this.#i.ll=(n.ll-this.#t.ll)/this.#e,this.#i.lr=(n.lr-this.#t.lr)/this.#e,this.#i.rl=(n.rl-this.#t.rl)/this.#e,this.#i.rr=(n.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll=n.ll,this.#t.lr=this.#r.lr=n.lr,this.#t.rl=this.#r.rl=n.rl,this.#t.rr=this.#r.rr=n.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t.ll+=this.#i.ll,this.#t.lr+=this.#i.lr,this.#t.rl+=this.#i.rl,this.#t.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr)),this.#t}isFixed(n){return this.#o(n)&&this.#n===0}isInterpolating(){return this.#n>0}#o(n){return this.#t.ll===n.ll&&this.#t.lr===n.lr&&this.#t.rl===n.rl&&this.#t.rr===n.rr}}r.StereoMatrixRamp=t})(Wt||(Wt={}));var Tc=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]),$x=new Float32Array(12),gP=new Float32Array(11);for(let r=0,e=0,t=0;r<Tc.length;r++)r%2===0?$x[e++]=Tc[r]:gP[t++]=Tc[r];var Mx=class{#e=new Float32Array($x.length);#t=new Float32Array(Tc.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,i,n){let o=this.#e,a=$x,s=gP;for(let l=i;l<n;l++){let u=e[l],p=(l-i)*2;o[this.#r]=u;let d=0;for(let v=0;v<a.length;v++){let m=(this.#r-v+o.length)%o.length;d+=o[m]*a[v]}t[p]=d*2;let f=0;for(let v=0;v<s.length;v++){let m=(this.#r-v+o.length-1)%o.length;f+=o[m]*s[v]}t[p+1]=f*2,this.#r=(this.#r+1)%o.length}}downsample(e,t,i,n){let o=this.#t,a=Tc;for(let s=i;s<n;s++){let l=(s-i)*2;o[this.#i]=e[l],this.#i=(this.#i+1)%o.length,o[this.#i]=e[l+1],this.#i=(this.#i+1)%o.length;let u=0;for(let p=0;p<a.length;p++){let d=(this.#i-1-p+o.length)%o.length;u+=o[d]*a[p]}t[s]=u}}},Qh=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=O.create(()=>new Mx,t),this.#r=O.create(i=>new Float32Array(128*(2<<i)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,i,n){let o=n-i,a=e,s=i,l=n;for(let u=0;u<this.#t.length;u++){let d=u===this.#t.length-1?t:this.#r[u];this.#t[u].upsample(a,d,s,l),a=d,s=0,l=o*(2<<u)}}downsample(e,t,i,n){let o=n-i,a=e,s=o*this.#e;for(let l=this.#t.length-1;l>=0;l--){let u=l===0,p=u?t:this.#r[l-1],d=u?i:0,f=u?n:s/2;this.#t[l].downsample(a,p,d,f),a=p,s=f}}},Yh=class{#e;#t;constructor(e){this.#e=new Qh(e),this.#t=new Qh(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,i,n){this.#e.upsample(e[0],t[0],i,n),this.#t.upsample(e[1],t[1],i,n)}downsample(e,t,i,n){this.#e.downsample(e[0],t[0],i,n),this.#t.downsample(e[1],t[1],i,n)}};var rl=class{#e;#t;#r;#i;constructor(e){this.#e=new Float32Array(e),this.#t=1/e,this.#r=0,this.#i=0}pushPop(e){let t=e*e;return this.#i-=this.#e[this.#r],this.#i+=t,this.#e[this.#r]=t,++this.#r===this.#e.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#t)}processBlock(e,t,i){let n=this.#e,o=n.length,a=this.#r,s=this.#i;for(let l=t;l<i;l++){let u=e[l]*e[l];s+=u-n[a],n[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 Xh=class r{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(r.#e*e)),this.#i=Math.pow(.01,1/(r.#t*e))}clear(){this.#n=0}replace(e,t,i){let n=this.#r,o=this.#i,[a,s]=e.channels(),l=this.#n;for(let u=t;u<i;++u){let p=a[u],d=s[u],f=Math.max(Math.abs(p),Math.abs(d));if(l=f>l?n*(l-f)+f:o*(l-f)+f,l>1){let v=1/l;a[u]=p*v,s[u]=d*v}}this.#n=l}};var $i=class{#e;value=0;constructor(e,t){this.#e=1-Math.exp(-1/(e*t))}process(e){return this.value+=this.#e*(e-this.value),this.value}};var ef=class{#e=new z;#t;#r;constructor(e){this.#t=this.#e.own(new te),this.#e.own(e.subscribe(t=>{this.#r=t.getValue(),this.#t.notify(this)})),this.#r=e.getValue()}subscribe(e){return this.#t.subscribe(e)}getTempoAt(e){return this.#r}ppqnToSeconds(e){return Y.pulsesToSeconds(e,this.#r)}secondsToPPQN(e){return Y.secondsToPulses(e,this.#r)}intervalToSeconds(e,t){return Y.pulsesToSeconds(t-e,this.#r)}intervalToPPQN(e,t){return Y.secondsToPulses(t-e,this.#r)}terminate(){this.#t.terminate()}};var rr;(function(r){r.Musical="musical",r.Seconds="seconds"})(rr||(rr={}));var yo;(function(r){function e(i,n,o){return new Dx(i,n,o)}r.musical=e;function t(i,n,o,a){return new Ix(i,n,o,a)}r.aware=t})(yo||(yo={}));var Ix=class{#e;#t;#r;#i;constructor(e,t,i,n){this.#i=n,this.#t=t,this.#r=i,this.#e=e}toPPQN(){let e=this.#i.getValue();if(this.getTimeBase()===rr.Musical)return e;let t=this.#r.getValue(),i=this.#e.ppqnToSeconds(t),n=i+e;return this.#e.intervalToPPQN(i,n)}fromPPQN(e){if(this.getTimeBase()===rr.Musical)this.#i.setValue(e);else{let t=this.#r.getValue(),i=this.#e.intervalToSeconds(t,t+e);this.#i.setValue(i)}}toSeconds(){let e=this.#i.getValue();if(this.getTimeBase()===rr.Seconds)return e;let t=this.#r.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#i.getValue()}getTimeBase(){return qr(this.#t.getValue(),rr)}},Dx=class{#e;#t;#r;constructor(e,t,i){this.#r=i,this.#t=t,this.#e=e}toPPQN(){return this.#r.getValue()}fromPPQN(e){this.#r.setValue(e)}toSeconds(){let e=this.#r.getValue(),t=this.#t.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#r.getValue()}getTimeBase(){return rr.Musical}};var tf=Y.fromSignature(1,384);var xo={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},rf;(function(r){r.Comparator=(n,o)=>{let a=n.position-o.position;if(a!==0)return a;let s=n.index-o.index;return s!==0?s:n===o?0:N(`${n} and ${o} are identical in terms of comparison`)};function*e(n,o,a){if(n.isEmpty())return Je.empty();for(let s of n.iterateFrom(o))if(yield s,s.position>=a)return}r.iterateWindow=e,r.nextEvent=(n,o)=>{let a=n.asArray(),s=He.rightMost(a,o,r.Comparator);return s===-1?null:a[s+1]??null},r.valueAt=(n,o,a)=>{if(n.isEmpty())return a;let s=n.iterateFrom(o),{done:l,value:u}=s.next();if(l)return a;if(u.position<=o){let{done:p,value:d}=s.next();if(p)return u.value;if(o<d.position)return i(u,d,o);if(u.interpolation===xo.None)return u.value}return u.value};function*t(n,o,a,s){if(n.isEmpty())return;let l=n.iterateFrom(o),{done:u,value:p}=l.next();if(u)return;let d=a/s,f=p;if(f.position>o){for(;o<f.position;)if(yield{position:o,value:f.value},o+=d,o>a)return;f.position<=a&&(yield f)}for(;o<=a;){let{done:v,value:m}=l.next();if(v)break;for(;o<m.position;){if(o>a)return;yield{position:o,value:i(f,m,o)},o+=d}m.position<a&&(f.interpolation===xo.None&&(yield{position:m.position,value:f.value}),yield m),f=m}for(;o<=a;)yield{position:o,value:f.value},o+=d}r.quantise=t;let i=({value:n,position:o,interpolation:a},s,l)=>a.type==="none"?n:a.type==="linear"?n+(l-o)/(s.position-o)*(s.value-n):a.type==="curve"?Jr.valueAt({slope:a.slope,steps:s.position-o,y0:n,y1:s.value},l-o):N("Unknown interpolation")})(rf||(rf={}));var Pc;(function(r){let e;(function(t){t[t.Bartlett=0]="Bartlett",t[t.Blackman=1]="Blackman",t[t.BlackmanHarris=2]="BlackmanHarris",t[t.Hamming=3]="Hamming",t[t.Hanning=4]="Hanning"})(e=r.Type||(r.Type={})),r.create=(t,i)=>{let n=new Float32Array(i),o=Math.PI/(i-1);switch(t){case e.Bartlett:{let a=(i>>1)-1,s=0;for(;s<=a;++s)n[s]=2*s/(i-1);for(;s<i;++s)n[s]=2-2*s/(i-1);return n}case e.Blackman:{let a=2*o,s=4*o;for(let l=0;l<i;++l)n[l]=.42323-.49755*Math.cos(a*l)+.07922*Math.cos(s*l);return n}case e.BlackmanHarris:{let a=2*o,s=4*o,l=6*o;for(let u=0;u<i;++u)n[u]=.35875-.48829*Math.cos(a*u)+.14128*Math.cos(s*u)-.01168*Math.cos(l*u);return n}case e.Hamming:{let a=2*o;for(let s=0;s<i;++s)n[s]=.54-.46*Math.cos(a*s);return n}case e.Hanning:{let a=2*o;for(let s=0;s<i;++s)n[s]=.5-.5*Math.cos(a*s);return n}}}})(Pc||(Pc={}));var nf=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:i,valueDecay:n}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=O.create(()=>new rl(sampleRate*i),t);let o=fr.createBuilder({peak:fr.floats(t),rms:fr.floats(t)})();this.#n=Qs.writer(o,e,a=>{let s=Math.exp(-(128*this.#o)/(sampleRate*n));for(let l=0;l<t;++l){let u=this.#t[l],p=this.#r[l];a.peak[l]=u,a.rms[l]=Math.sqrt(p),this.#t[l]=u*s,this.#r[l]=p*s}this.#o=0})}process([e]){for(let t=0;t<this.#e;++t){let i=e[t];if(i===void 0)this.#t[t]=0,this.#r[t]=0;else{let n=this.#i[t],o=this.#t[t],a=this.#r[t];for(let s=0;s<128;++s){let l=i[s];o=Math.max(o,Math.abs(l)),a=Math.max(a,n.pushPop(l*l))}this.#t[t]=o,this.#r[t]=a}}return this.#o++,this.#n.tryWrite(),!0}};var we=class r{static newSet(e){return new Hs(e,r.Comparator)}static compose=(e,...t)=>{let i=t.length===0?this.#e:new Int16Array(t);return I(i.every((n,o)=>n===t[o]),`fieldKeys (${i.join(",")}) only allows i16`),new r(e,i)};static decode(e){let t=e.split("/");return I(t.length>0,"Unable to parse Address"),r.compose(A.parse(t[0]),...t.slice(1).map(i=>parseInt(i)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,i){let n=e.values(),o=He.leftMostMapped(n,t,A.Comparator,i),a=n.length;if(o<0||o>=a)return null;for(let s=o;s<a;s++)if(A.Comparator(i(n[s]),t)!==0)return o<s?[o,s]:null;return[o,a]}static Comparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return 0};static LengthComparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);return i!==0?i:t.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,t){this.#t=e,this.#r=t}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return r.Comparator(this,e)===0}compareTo(e){return r.Comparator(this,e)}append(e){return new r(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return A.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,i)=>this.#r[i]===t)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(t=>e.writeShort(t))}moveTo(e){return new r(e,this.#r)}decompose(){return[this.#t,this.#r]}toJSON(){return{uuid:Array.from(this.#t.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(A.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,A.length),e.buffer}toString(){return[A.toString(this.#t),...this.#r].join("/")}static read(e){let t=A.fromDataInput(e),i=e.readByte();return r.compose(t,...O.create(()=>e.readShort(),i))}},Fa;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>we.Comparator(e,t),r.equals=(e,t)=>{let[i,n]=He.rangeMapped(t,e,we.Comparator,r.AddressReader);return t.slice(i,n+1)},r.startsWith=(e,t)=>{let[i,n]=He.rangeMapped(t,e,we.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let i=He.leftMostMapped(t,e,we.LengthComparator,r.AddressReader),n=He.rightMostMapped(t,e,we.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>e.startsWith(o.address))}})(Fa||(Fa={}));var an=class r{static validate(e,t){if(e.address.equals(t.address))return g.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(i=>i===e.pointerType)){let i=t.pointerRules.accepts.join(", ");return g.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${i}).`)}return g.None}#e;#t;constructor(e){this.#e=e,this.#t=new Bt}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let i=we.newSet(n=>n.address);return i.addMany(this.filter(...t)),i.forEach(n=>e.onAdded(n)),this.subscribe({onAdded:n=>{i.add(n)&&e.onAdded(n)},onRemoved:n=>{i.removeByKey(n.address),e.onRemoved(n)}},...t)}filter(...e){return e.length===0?this.incoming():Je.filter(this.incoming().values(),t=>e.some(i=>i===t.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(t=>e.address.equals(t.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let t=r.validate(e,this.#e);if(t.nonEmpty())return N(t.unwrap());this.#t.proxy.onAdded(e)}onRemoved(e){this.#t.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#e.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,t,i){return e.subscribe({onAdded:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onAdded(n)},onRemoved:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onRemoved(n)}})}};var Cx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},il=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},K=class r{static hook(e){return new r(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:t,fieldName:i,pointerRules:n,deprecated:o}){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#n=o,n.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return _(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new an(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 Mr.empty()}getField(e){return N()}optField(e){return g.None}read(e){}write(e){}toJSON(){}fromJSON(e){return N("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()}`}};Cx([Zs,il("design:type",an),il("design:paramtypes",[])],K.prototype,"pointerHub",null);Cx([Zs,il("design:type",we),il("design:paramtypes",[])],K.prototype,"address",null);Cx([Zs,il("design:type",String),il("design:paramtypes",[])],K.prototype,"debugPath",null);var h=Object.freeze({mandatory:!1,accepts:[]});var of=class r extends K{static create(e,t,i){return new r(e,t,i)}#e;constructor(e,t,i){super(e),this.#e=O.create(n=>t({parent:this,fieldKey:n,fieldName:String(n),pointerRules:h,deprecated:e.deprecated}),i)}accept(e){return _(e.visitArrayField,this)}fields(){return this.#e}record(){return O.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return X(this.#e[e])}optField(e){return g.wrap(this.#e[e])}read(e){this.#e.forEach(t=>t.read(e))}write(e){this.#e.filter(t=>!t.deprecated).forEach(t=>t.write(e))}size(){return this.#e.length}toJSON(){if(!this.deprecated)return Object.values(this.#e).map(e=>e.toJSON()??null)}fromJSON(e){if(!this.deprecated)if(Array.isArray(e))e.forEach((t,i)=>this.#e[i].fromJSON(t));else return N("Type mismatch")}};var wo;(function(r){r.writeFields=(t,i)=>{let n=Object.entries(i).filter(([o,a])=>!a.deprecated);t.writeInt(1179403347),t.writeShort(n.length),n.forEach(([o,a])=>{let s=Et.create();a.write(s);let l=new Int8Array(s.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(l.length),t.writeBytes(l)})},r.readFields=(t,i)=>{I(t.readInt()===1179403347,"Serializer header is corrupt");let n=t.readShort();for(let o=0;o<n;o++){let a=t.readShort();if(Ks(i[a]))continue;let s=t.readInt(),l=new Int8Array(s);t.readBytes(l);let{status:u,error:p}=Sa(()=>i[a]?.read(new ot(l.buffer)));u==="failure"&&console.warn(i,p)}}})(wo||(wo={}));var lB=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vP=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},$=class r{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#o=r.Index++;constructor({uuid:e,graph:t,name:i,pointerRules:n}){this.#e=we.compose(e),this.#t=t,this.#r=i,this.#i=n,this.#n=this.initializeFields(),n.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#n)}record(){return this.#n}getField(e){return X(this.#n[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return g.wrap(this.#n[e])}subscribe(e,t){return this.graph.subscribeVertexUpdates(e,this.address,t)}get box(){return this}get name(){return this.#r}get graph(){return this.#t}get parent(){return this}get address(){return this.#e}get pointerRules(){return this.#i}get creationIndex(){return this.#o}get pointerHub(){return new an(this)}estimateMemory(){let e=new Ws;return this.write(e),e.count}isBox(){return!0}asBox(e){return Be(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){wo.readFields(e,this.#n)}write(e){wo.writeFields(e,this.#n)}serialize(){let e=Et.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=Et.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#n).reduce((e,[t,i])=>{let n=i.toJSON();return Z(n)&&(e[t]=n),e},{})}fromJSON(e){if(Ch(e))Object.entries(e).forEach(([t,i])=>{let n=this.#n[parseInt(t)];Z(i)&&n.fromJSON(i)});else return N("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return O.empty();let i=this.getField(t[0]),n=[e(i)];for(let o=1;o<t.length;o++)i=i.getField(t[o]),n.push(e(i));return n}searchVertex(e){if(e.length===0)return g.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return g.None;for(let i=1;i<e.length;i++)if(t=t.unwrap().optField(e[i]),t.isEmpty())return g.None;return t}delete(){if(!this.isAttached())return;let{boxes:e,pointers:t}=this.graph.dependenciesOf(this);r.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...t].map(i=>i.toString()).join(`
|
|
2
|
+
`)),console.debug(" unstages",[...e].map(i=>i.toString()).join(`
|
|
3
|
+
`),this));for(let i of t)i.defer();for(let i of e)i.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=t=>t.every(i=>i.accept({visitPointerField:n=>!n.mandatory||n.nonEmpty(),visitArrayField:n=>e(n.fields()),visitObjectField:n=>e(n.fields()),visitPrimitiveField:n=>!0,visitField:n=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};lB([Zs,vP("design:type",an),vP("design:paramtypes",[])],$.prototype,"pointerHub",null);var Rc;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Rc||(Rc={}));var Fe;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(Fe||(Fe={}));var af;(function(r){r.create=()=>new Tx})(af||(af={}));var Tx=class{#e=new Oc(Fa.equals);#t=new Oc(Fa.startsWith);#r=new Oc(Fa.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,i){let n=new Rx(t,e,this.#n++,i);if(this.#o){let o=new Ox(n,e);return this.#i.push(o),o}else return this.subscribeMonitor(n,e)}dispatch(e){this.#o=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:i},{order:n})=>i-n).forEach(i=>i.procedure(e)),this.#o=!1,this.#i.forEach(i=>i.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case Fe.This:return this.#e.subscribe(e);case Fe.Parent:return this.#t.subscribe(e);case Fe.Children:return this.#r.subscribe(e);default:return Th(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Rx=class{address;propagation;order;procedure;constructor(e,t,i,n){this.address=e,this.propagation=t,this.order=i,this.procedure=n}toString(){return`{ Monitor address: ${this.address}, propagation: ${Fe[this.propagation]}, order: ${this.order} }`}},Oc=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(Fa.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Ox=class{monitor;propagation;#e=new z;#t=!1;constructor(e,t){this.monitor=e,this.propagation=t}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var dt;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(dt||(dt={}));var ka={[dt.Boolean]:{type:dt.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[dt.Float32]:{type:dt.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[dt.Int32]:{type:dt.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[dt.String]:{type:dt.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[dt.Bytes]:{type:dt.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},Na=class extends K{#e;#t;#r;constructor(e,t,i){super(e),this.#e=t,this.#t=i,this.#r=this.#t}accept(e){return _(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Fe.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#e}get initValue(){return this.#t}setInitValue(e){I(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let t=this.#r,i=this.clamp(e);this.equals(i)||(this.#r=i,this.graph.onPrimitiveValueUpdate(this,t,i))}writeValue(e,t){I(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,t)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?N("not implemented"):e}fromJSON(e){return N("Type mismatch")}reset(){this.setValue(this.#t)}},M=class r extends Na{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,dt.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return ka[dt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){I(!this.deprecated,"BooleanField.write: deprecated field"),e.writeBoolean(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString()))}},w=class r extends Na{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,dt.Float32,n),this.#e=t,this.#t=i}serialization(){return ka[dt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Rc.clampFloat32(this.#e,Vn.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){I(!this.deprecated,"FLoat32Field.write: deprecated field"),e.writeFloat(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString()))}},E=class r extends Na{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,dt.Int32,n),this.#e=t,this.#t=i}serialization(){return ka[dt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Rc.clampInt32(this.#e,Xt.toInt(e))}read(e){this.setValue(e.readInt())}write(e){I(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=Xt.MIN_VALUE&&e<=Xt.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends Na{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,dt.String,t)}serialization(){return ka[dt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){I(!this.deprecated,"StringField.write: deprecated field"),e.writeString(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString()))}},yP=class r extends Na{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,dt.Bytes,t)}serialization(){return ka[dt.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){I(!this.deprecated,"ByteArrayField.write: deprecated field");let t=this.getValue();e.writeInt(t.length),e.writeBytes(t)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(t=>typeof t=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var xP;(function(r){r.decode=e=>{let t=e.readInt();return O.create(()=>{switch(e.readString()){case"new":{let n=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new Vc(n,o,a.buffer)}case"pointer":{let n=we.read(e),o=e.readBoolean()?g.wrap(we.read(e)):g.None,a=e.readBoolean()?g.wrap(we.read(e)):g.None;return new Uc(n,o,a)}case"primitive":{let n=we.read(e),o=e.readString(),a=ka[o],s=a.decode(e),l=a.decode(e);return new zc(n,a,s,l)}case"delete":{let n=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new jc(n,o,a.buffer)}}},t)}})(xP||(xP={}));var Vc=class{type="new";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,t=>t.read(new ot(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},zc=class{type="primitive";#e;#t;#r;#i;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#r=i,this.#i=n}get address(){return this.#e}get oldValue(){return this.#r}get newValue(){return this.#i}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).setValue(this.#r)}forward(e){this.field(e).setValue(this.#i)}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PrimitiveField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),e.writeString(this.#t.type),this.#t.encode(e,this.#r),this.#t.encode(e,this.#i)}toString(){return`{PrimitiveUpdate oldValue: ${this.#r}, newValue: ${this.#i}`}},Uc=class{type="pointer";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}get address(){return this.#e}get oldAddress(){return this.#t}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#t}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PointerField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),this.#t.match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},jc=class{type="delete";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}inverse(e){e.createBox(this.#t,this.#e,t=>t.read(new ot(this.#r)))}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var CC=Symbol("Unreferenceable"),B=class r extends K{static create(e,t,i){return new r(e,t,i)}static encodeWith(e,t){I(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=g.wrap(e);let i=Sa(t);if(this.#e=g.None,i.status==="failure")throw i.error;return i.value}static decodeWith(e,t){I(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=g.wrap(e);let i=Sa(t);if(this.#t=g.None,i.status==="failure")throw i.error;return i.value}static#e=g.None;static#t=g.None;#r;#i;#n=g.None;#o=g.None;constructor(e,t,i){super(e),this.#r=t,this.#i=i,i&&this.graph.edges().watchVertex(this)}get pointerHub(){return N(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return _(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Fe.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=g.wrap(e)}defer(){this.targetVertex=g.None}get targetVertex(){return this.graph.inTransaction()?this.#o.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let t=an.validate(this,e.unwrap());t.nonEmpty()&&N(t.unwrap())}this.targetAddress=e.map(t=>t.address)}get targetAddress(){return this.#o}set targetAddress(e){let t=this.#o;t.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&t.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#o=e,this.graph.onPointerAddressUpdated(this,t,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap())}resolvedTo(e){this.#n=e}read(e){let t=e.readBoolean()?g.wrap(we.read(e)):g.None;this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}write(e){I(!this.deprecated,"PointerField.write: deprecated field"),r.#e.match({none:()=>this.#o,some:t=>t.map(this)}).match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toJSON(){if(!this.deprecated)return r.#e.match({none:()=>this.#o,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(Tn(e)||typeof e=="string"){let t=g.wrap(Tn(e)?null:we.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}else return N(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var sf=class{#e;#t;#r;#i;constructor(){this.#e=we.newSet(e=>e.address),this.#t=we.newSet(e=>e.address),this.#r=we.newSet(([e])=>e),this.#i=we.newSet(([e])=>e.address)}watchVertex(e){if(De(e,B)){if(!e.mandatory)return N("watchVertex called but has no edge requirement");this.#e.add(e)}else{if(!e.pointerRules.mandatory)return N("watchVertex called but has no edge requirement");this.#t.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:i}}})=>i;for(let{address:{uuid:i}}of e)this.#o(this.#e,i,t),this.#o(this.#t,i,t);for(let i of e){let n=this.outgoingEdgesOf(i);if(n.length>0)return N(`${i} has outgoing edges: ${n.map(([a,s])=>`[${a.toString()}, ${s.toString()}]`)}`);let o=this.incomingEdgesOf(i);if(o.length>0)return N(`${i} has incoming edges from: ${o.map(a=>a.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,i])=>i.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,i]=this.#r.get(t);O.remove(i,e),i.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,i])=>i.equals(t),!1)}outgoingEdgesOf(e){return this.#n(this.#i,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#n(this.#r,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,i])=>i):this.#r.opt(e.address).mapOr(([t,i])=>i,O.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?N(`Pointer ${e.toString()} requires an edge.`):N(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?N(`Target ${e.toString()} requires an edge.`):N(`Illegal state: ${e} has no edge requirements.`)})}#n(e,t,i){let n=we.boxRange(e,t,i);return Z(n)?e.values().slice(n[0],n[1]):O.empty()}#o(e,t,i){let n=we.boxRange(e,t,i);Z(n)&&e.removeRange(n[0],n[1])}};var $a=class{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c=!1;#d=!1;constructor(e=g.None){this.#e=e,this.#t=A.newSet(t=>t.address.uuid),this.#r=[],this.#a=af.create(),this.#i=new Bt,this.#n=new Bt,this.#o=new Bt,this.#l=new sf,this.#s=we.newSet(({pointer:t})=>t.address),this.#u=[]}beginTransaction(){I(!this.#c,"Transaction already in progress"),this.#c=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(I(this.#c,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#p(e,t)),this.#r.length=0),this.#s.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:i})=>{t.equals(i)||(t.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onRemoved(e)),i.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#s.clear(),this.#c=!1;this.#u.length>0;)this.#u.splice(0).forEach(e=>e()),this.#u.length>0&&console.debug(`${this.#u.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#d}createBox(e,t,i){return this.#e.unwrap("No box-factory installed")(e,this,t,i)}stageBox(e,t){this.#h(),I(!this.#d,"Cannot construct box while other box is constructing"),Z(t)&&(this.#d=!0,t(e),this.#d=!1);let i=this.#t.add(e);I(i,`${e} already staged`);let n=new Vc(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#n.subscribe(e)}subscribeVertexUpdates(e,t,i){return this.#a.subscribe(e,t,i)}subscribeEndTransaction(e){this.#u.push(e)}unstageBox(e){this.#h();let t=this.#t.removeByKey(e.address.uuid);I(t===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let i=new jc(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(t=>t.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#l}checksum(){let e=new zh;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,i){if(this.#h(),e.isAttached()&&!this.#d){let n=new zc(e.address,e.serialization(),t,i);this.#a.dispatch(n),this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}}onPointerAddressUpdated(e,t,i){this.#h(),t.nonEmpty()&&this.#l.disconnect(e),i.nonEmpty()&&this.#l.connect(e,i.unwrap());let n=new Uc(e.address,t,i);this.#d?this.#r.push({pointerField:e,update:n}):(this.#p(e,n),this.#n.proxy.onUpdate(n))}#p(e,t){let{oldAddress:i,newAddress:n}=t;e.resolvedTo(n.flatMap(a=>this.findVertex(a))),this.#s.opt(e.address).match({none:()=>this.#s.add({pointer:e,initial:i,final:n,index:this.#s.size()}),some:a=>a.final=n}),this.#a.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e,t={}){let i=Z(t.excludeBox)?t.excludeBox:mo.alwaysFalse,n=Z(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,o=new Set,a=new Set,s=l=>{o.has(l)||i(l)||(o.add(l),l.outgoingEdges().filter(([u])=>!a.has(u)).forEach(([u,p])=>{let d=this.findVertex(p).unwrap(`Could not find target of ${u.toString()}`);if(a.add(u),d.pointerRules.mandatory&&(n||d.pointerHub.incoming().every(f=>a.has(f))))return s(d.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.#l.validateRequirements();let e=0,t=i=>{for(let n of i.fields())n.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let a=o.targetVertex.nonEmpty(),s=this.findVertex(o.targetAddress.unwrap()).nonEmpty();I(a,`pointer ${o.address} is broken`),I(s,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#t.forEach(i=>t(i)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[A.toString(t.address.uuid)]={class:t.name,"incoming links":t.incomingEdges().length,"outgoing links":t.outgoingEdges().length,"est. memory (bytes)":t.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let t of this.dependenciesOf(e).boxes)console.debug(` ${t}`)})}addressToDebugPath(e){return e.flatMap(t=>t.isBox()?this.findBox(t.uuid).map(i=>i.name):this.findBox(t.uuid).flatMap(i=>i.searchVertex(t.fieldKeys).map(n=>n.isField()?n.debugPath:N("Unknown address"))))}toArrayBuffer(){let e=Et.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(i=>{let n=i.serialize();e.writeInt(n.byteLength),e.writeBytes(new Int8Array(n))}),e.toArrayBuffer()}fromArrayBuffer(e){I(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new ot(e),i=t.readInt();this.beginTransaction();let n=[];for(let o=0;o<i;o++){let a=t.readInt(),s=new Int8Array(a);t.readBytes(s);let l=new ot(s.buffer),u=l.readInt(),p=l.readString(),d=A.fromDataInput(l);n.push({creationIndex:u,name:p,uuid:d,boxStream:l})}n.sort((o,a)=>o.creationIndex-a.creationIndex).forEach(({name:o,uuid:a,boxStream:s})=>this.createBox(o,a,l=>l.read(s))),this.endTransaction()}toJSON(){return this.#t.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:X(e.toJSON())}))}#h(){I(this.#c,()=>"Modification only prohibited in transaction mode.")}};var nl;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let i=r.collectIndexedBoxes(e),n=ce(t,0,i.length);if(n<i.length)for(let o=n;o<i.length;o++)i[o].index.setValue(o+1);return n},r.removeOrder=(e,t)=>{let i=r.collectIndexedBoxes(e);if(t<i.length)for(let n=t+1;n<i.length;n++)i[n].index.setValue(n-1)},r.moveIndex=(e,t,i)=>{let n=r.collectIndexedBoxes(e),o=n[t];if(i<0){let a=ce(t+i,0,n.length-1);for(let s=a;s<t;s++)n[s].index.setValue(s+1);o.index.setValue(a)}else if(i>1){let a=ce(t+(i-1),0,n.length-1);for(let s=t;s<a;s++)n[s+1].index.setValue(s);o.index.setValue(a)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${i}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof E,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:i})=>r.isIndexedBox(i)&&(t===void 0||i instanceof t)?i:N(`${i} has no index field`)).sort((i,n)=>i.index.getValue()-n.index.getValue())})(nl||(nl={}));var Ue=class extends K{#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 X(this.#e[e])}optField(e){return g.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Fe.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){wo.readFields(e,this.#e)}write(e){wo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,i])=>(e[t]=i.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Ch(e))Object.entries(e).forEach(([t,i])=>{let n=this.#e[parseInt(t)];Z(i)&&n.fromJSON(i)});else return N("Type mismatch")}};var jn;(function(r){r.sender=(n,o)=>o(new t(n)),r.executor=(n,o)=>new i(n,o);let e=n=>{let o=[];for(let a of n)a instanceof MessagePort&&o.push(a),typeof ImageBitmap<"u"&&a instanceof ImageBitmap&&o.push(a),typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas&&o.push(a);return o};class t{#e;#t=new Map;#r;#i=0;constructor(o){this.#e=o,this.#r=o.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(o,...a)=>{let s=e(a);this.#e.send({type:"send",returnId:!1,func:o.name,args:Array.from(Je.map(a,l=>({value:l})))},s)};dispatchAndReturn=(o,...a)=>new Promise((s,l)=>{let u=Je.reduce(a,(d,f,v)=>(typeof f=="function"&&d.push([v,f]),d),[]);this.#t.set(this.#i,{executorTuple:{resolve:s,reject:l},callbacks:new Map(u)});let p=e(a);this.#e.send({type:"send",returnId:this.#i,func:o.name,args:Array.from(Je.map(a,(d,f)=>typeof d=="function"?{callback:f}:{value:d}))},p),this.#i++});#n=o=>{let a=this.#t.get(o.returnId);Z(a)?o.type==="resolve"?(a.executorTuple.resolve(o.resolve),this.#t.delete(o.returnId)):o.type==="reject"?(a.executorTuple.reject(o.reject),this.#t.delete(o.returnId)):o.type==="callback"&&a.callbacks?.get(o.funcAt).apply(this,o.args):N(`Promise has already been resolved. ${JSON.stringify(o)}`)}}class i{#e;#t;#r;constructor(o,a){this.#e=o,this.#t=a,this.#r=o.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=o=>{I(o.type==="send",()=>"Message type must be 'send'");let a=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),s=X(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:N(`${o.func.toString()} has no promise.`)));else try{s.apply(this.#t,o.args.map(p=>"callback"in p?(...d)=>this.#a(l,p.callback,d):p.value)).then(p=>{try{this.#n(l,p)}catch(d){this.#o(l,d)}},p=>this.#o(l,p))}catch(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=i})(jn||(jn={}));var wP={for:r=>new Vx(r)},uB=[],Vx=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??uB)}channel(e){return new zx(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},zx=class r{#e;#t;#r=new te;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(i=>{"__id__"in i&&i.__id__==="42"&&"message"in i&&"channel"in i&&i.channel===t&&this.#r.notify(i.message)})}send(e,t){this.#e.send({__id__:"42",channel:this.#t,message:e},t)}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var lf;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let i=e,n=()=>{--i<=0?t():requestAnimationFrame(n)};requestAnimationFrame(n)}),r.timeSpan=(e,...t)=>new Promise(i=>setTimeout(i,e.millis(),...t)),r.event=(e,t)=>new Promise(i=>e.addEventListener(t,i,{once:!0})),r.observable=e=>new Promise(t=>{let i=e.subscribe(()=>{i.terminate(),t()})}),r.complete=e=>new Promise((t,i)=>{let n=setInterval(()=>{let{status:o,value:a,error:s}=Sa(()=>e.next());if(o==="success"){let{done:l,value:u}=a;l&&(clearInterval(n),t(u))}else clearInterval(n),i(s)},0)})})(lf||(lf={}));var Ux=class{maxRetry;timeSpan;#e=0;constructor(e,t){this.maxRetry=e,this.timeSpan=t}retry(e,t){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(t,this.timeSpan.millis()),!0)}},uf;(function(r){class e{value;status="resolved";constructor(s){this.value=s}error=Pa("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(s){this.error=s}value=Pa("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(a,s)=>{let l=!0;return a.own(L.create(()=>l=!1)),new Promise((u,p)=>s.then(d=>{l&&u(d)},d=>{l&&p(d)}))},r.tryCatch=a=>a.then(s=>new e(s),s=>new t(s));let i=new Ux(3,kc.seconds(3));r.retry=(a,s=i)=>a().catch(l=>new Promise((u,p)=>{let d=f=>{s.retry(f,()=>a().then(v=>u(v),d))||p(f)};d(l)})),r.guardedRetry=(a,s)=>{let l=async(u=0)=>{try{return await a()}catch(p){if(s(p,++u))return console.debug("retrying after failure:",p),await lf.timeSpan(kc.seconds(1)),l(u);throw new Error(`Failed after ${u} retries: ${p}`)}};return l()},r.approvedRetry=(a,s)=>{let l=async()=>{try{return await a()}catch(u){if(await Js.approve(s(u)))return l();throw u}};return l()},r.fail=(a,s)=>{let l=()=>new Promise((u,p)=>setTimeout(()=>p("fails first"),a.millis()));return()=>{let u=l();return l=s,u}},r.timeout=(a,s,l)=>new Promise((u,p)=>{let d=!0,f=setTimeout(()=>{d=!1,p(new Error(l??"timeout"))},s.millis());a.then(v=>{d&&u(v)},v=>{d&&p(v)}).finally(()=>clearTimeout(f))}),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),p=s.then(u,u);return s=p.catch(()=>{}),p}},r.memoizeAsync=(a,s)=>{let l=null,u=Date.now();return()=>{let p=Date.now();return(Tn(l)||Z(s)&&p-u>s.millis())&&(u=p,l=a(),l.catch(d=>(l=null,d))),l}},r.allWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,p=!1,d=async()=>{for(;u<a.length&&!p;){let f=u++;try{let v=await a[f]();p||(l[f]=v)}catch(v){throw p=!0,v}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},d)),l},r.allSettledWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,p=async()=>{for(;u<a.length;){let d=u++;try{let f=await a[d]();l[d]={status:"fulfilled",value:f}}catch(f){l[d]={status:"rejected",reason:f}}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},p)),l};class n{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let l=Promise.withResolvers();return this.#e.push([s,l]),l.promise.finally(()=>this.#r())}}#r(){if(I(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:l,reject:u}]=this.#e.shift();this.#t++,s().then(l,u)}}}r.Limit=n;class o{#e;#t;#r;#i=g.None;constructor(s,l,u){this.#e=s,this.#t=l,this.#r=u}update(s){this.#i=g.wrap(s),s.then(l=>{this.#i.contains(s)&&this.#e(l)}).catch(l=>{this.#i.contains(s)&&this.#t(l)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),_(this.#r))})}terminate(){this.#i=g.None}}r.Latest=o})(uf||(uf={}));var bP=(r,e)=>jn.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(i=>{let n=i.type;n==="new"?r.createBox(i.name,i.uuid,o=>o.read(new ot(i.buffer))):n==="update-primitive"?r.findVertex(we.reconstruct(i.address)).unwrap(()=>`Could not find primitive field ${i.address}`).setValue(i.value):n==="update-pointer"?r.findVertex(we.reconstruct(i.address)).unwrap(()=>`Could not find pointer field ${i.address}`).targetAddress=Z(i.target)?g.wrap(we.reconstruct(i.target)):g.None:i.type==="delete"&&r.unstageBox(r.findBox(i.uuid).unwrap(()=>`Could not find box ${A.toString(i.uuid)}`))}),r.endTransaction()}checksum(t){return O.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var cf=class{#e=0;#t=!1;#r=!1;isRecording=!1;isCountingIn=!1;metronomeEnabled=!1;getLeapStateAndReset(){let e=this.#r;return this.#r=!1,e}get position(){return this.#e}set position(e){this.#e=e,this.#r=!0}get transporting(){return this.#t}set transporting(e){this.#t!==e&&(this.#t=e)}pause(){this.#t=!1,this.isRecording=!1,this.isCountingIn=!1}advanceTo(e){this.#e=e}};var AP;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(AP||(AP={}));var _P;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(_P||(_P={}));var bt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(bt||(bt={}));var ol={white:new xt(0,0,100),blue:new xt(189,100,65),green:new xt(150,77,69),yellow:new xt(60,100,84),cream:new xt(65,20,83),orange:new xt(31,100,73),red:new xt(354,100,65),purple:new xt(314,100,78),bright:new xt(197,0,100),gray:new xt(197,31,85),dark:new xt(197,15,62),shadow:new xt(197,10,42),black:new xt(197,10,14),background:new xt(197,6,3),panelBackground:new xt(197,14,7),panelBackgroundBright:new xt(197,14,10),panelBackgroundDark:new xt(197,14,4)};var $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.Time=119]="Time",r[r.Timeline=120]="Timeline",r[r.Tool=121]="Tool",r[r.Triangle=122]="Triangle",r[r.Unknown=123]="Unknown",r[r.UserFolder=124]="UserFolder",r[r.Velocity=125]="Velocity",r[r.Vinyl=126]="Vinyl",r[r.VUMeter=127]="VUMeter",r[r.Waveform=128]="Waveform",r[r.Zeitgeist=129]="Zeitgeist"})($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=0]="Deprecated",r[r.Timeline=1]="Timeline",r[r.Selection=2]="Selection",r[r.PianoMode=3]="PianoMode",r[r.User=4]="User",r[r.AudioConnection=5]="AudioConnection",r[r.InstrumentHost=6]="InstrumentHost",r[r.AudioOutput=7]="AudioOutput",r[r.Capture=8]="Capture",r[r.NotesConnection=9]="NotesConnection",r[r.VoltageConnection=10]="VoltageConnection",r[r.AudioUnits=11]="AudioUnits",r[r.MidiEffectHost=12]="MidiEffectHost",r[r.AudioEffectHost=13]="AudioEffectHost",r[r.AudioPlayMode=14]="AudioPlayMode",r[r.AudioBusses=15]="AudioBusses",r[r.AuxSend=16]="AuxSend",r[r.FileUploadState=17]="FileUploadState",r[r.Modulation=18]="Modulation",r[r.Automation=19]="Automation",r[r.Parameter=20]="Parameter",r[r.ParameterController=21]="ParameterController",r[r.MidiControl=22]="MidiControl",r[r.StepAutomation=23]="StepAutomation",r[r.Editing=24]="Editing",r[r.Shadertoy=25]="Shadertoy",r[r.AudioFile=26]="AudioFile",r[r.WarpMarkers=27]="WarpMarkers",r[r.TransientMarkers=28]="TransientMarkers",r[r.SoundfontFile=29]="SoundfontFile",r[r.AudioUnit=30]="AudioUnit",r[r.MarkerTrack=31]="MarkerTrack",r[r.MarkerEvents=32]="MarkerEvents",r[r.ClipCollection=33]="ClipCollection",r[r.RegionCollection=34]="RegionCollection",r[r.TrackCollection=35]="TrackCollection",r[r.Device=36]="Device",r[r.MIDIDevice=37]="MIDIDevice",r[r.Groove=38]="Groove",r[r.ModularSetup=39]="ModularSetup",r[r.ModuleCollection=40]="ModuleCollection",r[r.ConnectionCollection=41]="ConnectionCollection",r[r.DeviceUserInterface=42]="DeviceUserInterface",r[r.NoteEvents=43]="NoteEvents",r[r.NoteEventFeature=44]="NoteEventFeature",r[r.NoteEventCollection=45]="NoteEventCollection",r[r.ValueEvents=46]="ValueEvents",r[r.ValueEventCollection=47]="ValueEventCollection",r[r.ValueInterpolation=48]="ValueInterpolation",r[r.Sample=49]="Sample"})(c||(c={}));var bo;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(bo||(bo={}));var sn;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(sn||(sn={}));var PP=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?N(`Indices cannot be equal (${r}, ${e})`):t};var Ln=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Rt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},df,Mi,Ao,pf,Kn,Ot=class r{static create(e,t,i){return new r(e,t,i)}constructor(e,t,i){df.set(this,void 0),Mi.set(this,void 0),Ao.set(this,void 0),pf.set(this,void 0),Kn.set(this,null),Ln(this,df,e,"f"),Ln(this,Mi,A.newSet(n=>n.adapter.uuid),"f"),Ln(this,Ao,new Bt,"f"),Ln(this,pf,e.pointerHub.catchupAndSubscribe({onAdded:n=>{Ln(this,Kn,null,"f");let o=t(n.box),a=o.indexField.subscribe(()=>{Ln(this,Kn,null,"f"),Rt(this,Ao,"f").proxy.onReorder(o)}),s=Rt(this,Mi,"f").add({adapter:o,subscription:a});I(s,`Could not add ${o}`),Rt(this,Ao,"f").proxy.onAdd(o)},onRemoved:n=>{Ln(this,Kn,null,"f");let o=n.box.address.uuid,{adapter:a,subscription:s}=Rt(this,Mi,"f").removeByKey(o);s.terminate(),Rt(this,Ao,"f").proxy.onRemove(a)}},i),"f")}field(){return Rt(this,df,"f")}subscribe(e){return Rt(this,Ao,"f").subscribe(e)}catchupAndSubscribe(e){return Rt(this,Mi,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=He.exactMapped(this.adapters(),e,PP,i=>i.indexField.getValue());return t===-1?g.None:g.wrap(this.adapters()[t])}getAdapterById(e){return Rt(this,Mi,"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 Rt(this,Kn,"f")===null&&Ln(this,Kn,Rt(this,Mi,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),Rt(this,Kn,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let i=this.adapters(),n=i[e];if(t<0){let o=ce(e+t,0,i.length-1);for(let a=o;a<e;a++)i[a].indexField.setValue(a+1);n.indexField.setValue(o)}else if(t>1){let o=ce(e+(t-1),0,i.length-1);for(let a=e;a<o;a++)i[a+1].indexField.setValue(a);n.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return Rt(this,Mi,"f").size()}isEmpty(){return this.size()===0}terminate(){Ln(this,Kn,null,"f"),Rt(this,Mi,"f").forEach(({subscription:e})=>e.terminate()),Rt(this,Mi,"f").clear(),Rt(this,Ao,"f").terminate(),Rt(this,pf,"f").terminate()}};df=new WeakMap,Mi=new WeakMap,Ao=new WeakMap,pf=new WeakMap,Kn=new WeakMap;var Ma;(function(r){r.create=(e,t,i,n)=>{switch(e){case"RootBox":return al.create(t,i,n);case"SelectionBox":return ln.create(t,i,n);case"UserInterfaceBox":return Ia.create(t,i,n);case"UploadFileBox":return hf.create(t,i,n);case"ShadertoyBox":return ff.create(t,i,n);case"TimelineBox":return Da.create(t,i,n);case"TrackBox":return ir.create(t,i,n);case"NoteEventBox":return _o.create(t,i,n);case"NoteEventRepeatBox":return mf.create(t,i,n);case"NoteEventCollectionBox":return Wn.create(t,i,n);case"NoteRegionBox":return Ca.create(t,i,n);case"NoteClipBox":return sl.create(t,i,n);case"ValueEventBox":return Po.create(t,i,n);case"ValueEventCollectionBox":return Zn.create(t,i,n);case"ValueEventCurveBox":return So.create(t,i,n);case"ValueRegionBox":return Ta.create(t,i,n);case"ValueClipBox":return ll.create(t,i,n);case"AudioRegionBox":return Eo.create(t,i,n);case"AudioClipBox":return ul.create(t,i,n);case"AudioPitchBox":return gf.create(t,i,n);case"AudioTimeStretchBox":return vf.create(t,i,n);case"TransientMarkerBox":return yf.create(t,i,n);case"WarpMarkerBox":return xf.create(t,i,n);case"MarkerBox":return cl.create(t,i,n);case"AudioFileBox":return Dr.create(t,i,n);case"SoundfontFileBox":return Yr.create(t,i,n);case"AudioUnitBox":return Xe.create(t,i,n);case"CaptureAudioBox":return Bo.create(t,i,n);case"CaptureMidiBox":return Fo.create(t,i,n);case"AudioBusBox":return Ii.create(t,i,n);case"AuxSendBox":return Ra.create(t,i,n);case"GrooveShuffleBox":return dl.create(t,i,n);case"UnknownAudioEffectDeviceBox":return wf.create(t,i,n);case"UnknownMidiEffectDeviceBox":return bf.create(t,i,n);case"DeviceInterfaceKnobBox":return Af.create(t,i,n);case"ModularDeviceBox":return _f.create(t,i,n);case"StereoToolDeviceBox":return Pf.create(t,i,n);case"CompressorDeviceBox":return pl.create(t,i,n);case"DelayDeviceBox":return Sf.create(t,i,n);case"CrusherDeviceBox":return Ef.create(t,i,n);case"DattorroReverbDeviceBox":return Bf.create(t,i,n);case"VelocityDeviceBox":return Ff.create(t,i,n);case"FoldDeviceBox":return Nf.create(t,i,n);case"TidalDeviceBox":return kf.create(t,i,n);case"RevampDeviceBox":return $f.create(t,i,n);case"ReverbDeviceBox":return Mf.create(t,i,n);case"VaporisateurDeviceBox":return hl.create(t,i,n);case"MIDIOutputDeviceBox":return fl.create(t,i,n);case"MIDIOutputBox":return Di.create(t,i,n);case"MIDIOutputParameterBox":return Ci.create(t,i,n);case"SoundfontDeviceBox":return ml.create(t,i,n);case"NanoDeviceBox":return gl.create(t,i,n);case"PlayfieldDeviceBox":return vl.create(t,i,n);case"PlayfieldSampleBox":return No.create(t,i,n);case"TapeDeviceBox":return yl.create(t,i,n);case"ArpeggioDeviceBox":return If.create(t,i,n);case"PitchDeviceBox":return Df.create(t,i,n);case"ZeitgeistDeviceBox":return Cf.create(t,i,n);case"ModularBox":return Tf.create(t,i,n);case"ModuleConnectionBox":return Rf.create(t,i,n);case"ModularAudioInputBox":return Of.create(t,i,n);case"ModularAudioOutputBox":return Vf.create(t,i,n);case"ModuleDelayBox":return zf.create(t,i,n);case"ModuleMultiplierBox":return Uf.create(t,i,n);case"ModuleGainBox":return jf.create(t,i,n);default:return N(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let i=new ot(t),n=i.readString(),o=A.fromDataInput(i),a=r.create(n,e,o);return a.read(i),a}})(Ma||(Ma={}));var Lf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get keyboard(){return this.getField(1)}get timeRangeInQuarters(){return this.getField(2)}get noteScale(){return this.getField(3)}get noteLabels(){return this.getField(4)}get transpose(){return this.getField(5)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:h},{length:4},"",0),2:w.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:h},{min:1,max:64,scaling:"linear"},"",8),3:w.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:h},{min:.5,max:2,scaling:"linear"},"",1),4:M.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:h},!1),5:E.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:h},{min:-48,max:48},"st",0)}}};var al=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:h}),i)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return _(e.visitRootBox,this)}get timeline(){return this.getField(1)}get users(){return this.getField(2)}get created(){return this.getField(3)}get groove(){return this.getField(4)}get modularSetups(){return this.getField(10)}get audioUnits(){return this.getField(20)}get audioBusses(){return this.getField(21)}get outputDevice(){return this.getField(30)}get outputMidiDevices(){return this.getField(35)}get pianoMode(){return this.getField(40)}get shadertoy(){return this.getField(100)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:h},c.Timeline,!0),2:K.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:h}),4:B.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:h},c.Groove,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[c.AudioUnits],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[c.AudioBusses],mandatory:!1}}),30:K.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!0}}),35:K.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!1}}),40:Lf.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:h}),100:B.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:h},c.Shadertoy,!1),111:B.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:h},c.Editing,!1)}}};var ln=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:h}),i)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return _(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:h},c.Selection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:h},c.Selection,!0)}}};var Ia=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:h}),i)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return _(e.visitUserInterfaceBox,this)}get root(){return this.getField(1)}get selection(){return this.getField(10)}get uploadStates(){return this.getField(11)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},c.User,!0),10:K.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[c.Selection],mandatory:!1}}),11:K.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:h},c.Editing,!1),22:B.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:h},c.Editing,!1),23:B.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:h},c.Editing,!1)}}};var hf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:h}),i)}static ClassName="UploadFileBox";constructor(e){super(e)}accept(e){return _(e.visitUploadFileBox,this)}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:h},c.FileUploadState,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},c.FileUploadState,!0)}}};var ff=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[c.Shadertoy],mandatory:!0}}),i)}static ClassName="ShadertoyBox";constructor(e){super(e)}accept(e){return _(e.visitShadertoyBox,this)}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:h}),2:M.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:h},!0)}}};var Kf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4),2:E.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4)}}};var Wf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get from(){return this.getField(2)}get to(){return this.getField(3)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),2:E.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:h},"any","ppqn",0),3:E.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:h},"any","ppqn",15360)}}};var Zf=class r extends Ue{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:K.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0)}}};var Da=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:h}),i)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return _(e.visitTimelineBox,this)}get root(){return this.getField(1)}get signature(){return this.getField(10)}get loopArea(){return this.getField(11)}get deprecatedMarkerTrack(){return this.getField(20)}get markerTrack(){return this.getField(21)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[c.Timeline],mandatory:!0}}),10:Kf.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:h}),11:Wf.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:h}),20:K.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!1,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),21:Zf.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:h}),30:E.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:h},"positive","ppqn",491520),31:w.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:h},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var ir=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[c.Selection,c.PianoMode],mandatory:!1}}),i)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return _(e.visitTrackBox,this)}get tracks(){return this.getField(1)}get target(){return this.getField(2)}get regions(){return this.getField(3)}get clips(){return this.getField(4)}get index(){return this.getField(10)}get type(){return this.getField(11)}get enabled(){return this.getField(20)}get excludePianoMode(){return this.getField(30)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:h},c.TrackCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:h},c.Automation,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[c.RegionCollection],mandatory:!1}}),4:K.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[c.ClipCollection],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),11:E.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:h},{values:[0,1,2,3]},""),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),30:M.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:h},!1)}}};var _o=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[c.Selection,c.NoteEventFeature],mandatory:!1}}),i)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventBox,this)}get events(){return this.getField(1)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get pitch(){return this.getField(20)}get velocity(){return this.getField(21)}get playCount(){return this.getField(22)}get playCurve(){return this.getField(23)}get cent(){return this.getField(24)}get chance(){return this.getField(25)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},c.NoteEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn",240),20:E.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),21:w.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:h},"unipolar","%",.7874015748031497),22:E.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),23:w.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:h},"bipolar","%",0),24:w.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:h},{min:-50,max:50,scaling:"linear"},"ct",0),25:E.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:h},{min:0,max:100},"",100)}}};var mf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:h}),i)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventRepeatBox,this)}get event(){return this.getField(1)}get count(){return this.getField(2)}get curve(){return this.getField(3)}get length(){return this.getField(4)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},c.NoteEventFeature,!0),2:E.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),3:w.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:h},"bipolar","%",0),4:w.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:h},"unipolar","%",1)}}};var Wn=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.NoteEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.NoteEventCollection],mandatory:!0}})}}};var Ca=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),i)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteRegionBox,this)}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get eventOffset(){return this.getField(14)}get mute(){return this.getField(15)}get label(){return this.getField(16)}get hue(){return this.getField(17)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},c.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},c.NoteEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:E.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:h},"any","ppqn"),15:M.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:h}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:h}),17:E.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var ko=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get loop(){return this.getField(1)}get reverse(){return this.getField(2)}get mute(){return this.getField(3)}get speed(){return this.getField(4)}get quantise(){return this.getField(5)}get trigger(){return this.getField(6)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:h},!0),2:M.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:h}),3:M.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!1,pointerRules:h}),4:E.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:h},"non-negative",""),5:E.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:h},"non-negative",""),6:E.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:h},"non-negative","")}}};var sl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),i)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return _(e.visitNoteClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},c.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},c.NoteEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:ko.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Po=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventBox,this)}get events(){return this.getField(1)}get position(){return this.getField(10)}get index(){return this.getField(11)}get interpolation(){return this.getField(12)}get value(){return this.getField(13)}get slope(){return this.getField(14)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},c.ValueEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:E.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[c.ValueInterpolation],mandatory:!1}},{values:[0,1]},"",1),13:w.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:h},"unipolar","%"),14:w.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:h},"any","",NaN)}}};var Zn=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.ValueEvents],mandatory:!1}}),2:K.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.ValueEventCollection],mandatory:!0}})}}};var So=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:h}),i)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},c.ValueInterpolation,!0),2:w.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:h},"unipolar","%",.5)}}};var Ta=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),i)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return _(e.visitValueRegionBox,this)}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},c.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},c.ValueEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var ll=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),i)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return _(e.visitValueClipBox,this)}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},c.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},c.ValueEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:ko.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Eo=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),i)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return _(e.visitAudioRegionBox,this)}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}get timeBase(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}get gain(){return this.getField(17)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},c.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},c.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:h},"pitch"),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical"),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},c.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},c.Deprecated,!1),7:w.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},c.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:w.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"any","mixed"),12:w.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","mixed"),13:w.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"any","mixed"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),17:w.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db")}}};var ul=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[c.Selection,c.Editing],mandatory:!1}}),i)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return _(e.visitAudioClipBox,this)}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}get gain(){return this.getField(14)}get playback(){return this.getField(20)}get timeBase(){return this.getField(21)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},c.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},c.AudioFile,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:ko.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},c.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!1,pointerRules:h},c.Deprecated,!1),7:w.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},c.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),14:w.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db"),20:C.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!1,pointerRules:h},"pitch"),21:C.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical")}}};var gf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchBox",pointerRules:{accepts:[c.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioPitchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioPitchBox,this)}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[c.WarpMarkers],mandatory:!0}})}}};var vf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[c.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioTimeStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioTimeStretchBox,this)}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[c.WarpMarkers],mandatory:!0}}),2:E.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:h},"positive","enum",2),3:w.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:h},"positive","ratio",1)}}};var yf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="TransientMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitTransientMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},c.TransientMarkers,!0),2:w.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var xf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="WarpMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitWarpMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},c.WarpMarkers,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:w.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var cl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return _(e.visitMarkerBox,this)}get track(){return this.getField(1)}get position(){return this.getField(2)}get plays(){return this.getField(3)}get label(){return this.getField(4)}get hue(){return this.getField(5)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:h},c.MarkerTrack,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:E.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:h},"non-negative","",1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Dr=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[c.AudioFile,c.FileUploadState],mandatory:!0}}),i)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return _(e.visitAudioFileBox,this)}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}get transientMarkers(){return this.getField(10)}initializeFields(){return{1:w.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),2:w.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[c.TransientMarkers],mandatory:!1}})}}};var Yr=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[c.SoundfontFile],mandatory:!0}}),i)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:h})}}};var Xe=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[c.Selection,c.Automation],mandatory:!1}}),i)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return _(e.visitAudioUnitBox,this)}get type(){return this.getField(1)}get collection(){return this.getField(2)}get editing(){return this.getField(3)}get index(){return this.getField(11)}get volume(){return this.getField(12)}get panning(){return this.getField(13)}get mute(){return this.getField(14)}get solo(){return this.getField(15)}get tracks(){return this.getField(20)}get midiEffects(){return this.getField(21)}get input(){return this.getField(22)}get audioEffects(){return this.getField(23)}get auxSends(){return this.getField(24)}get output(){return this.getField(25)}get capture(){return this.getField(26)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:h},"instrument"),2:B.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:h},c.AudioUnits,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:w.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:w.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),20:K.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[c.TrackCollection],mandatory:!1}}),21:K.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MidiEffectHost],mandatory:!1}}),22:K.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.InstrumentHost,c.AudioOutput],mandatory:!1}}),23:K.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),24:K.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:h},c.AudioOutput,!1),26:B.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:h},c.Capture,!1)}}};var Bo=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),i)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureAudioBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:h},"any","",1),11:w.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:h},"decibel","dB",0)}}};var Fo=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),i)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureMidiBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:h},"any","",-1)}}};var Ii=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:h}),i)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return _(e.visitAudioBusBox,this)}get collection(){return this.getField(1)}get output(){return this.getField(2)}get input(){return this.getField(3)}get enabled(){return this.getField(4)}get icon(){return this.getField(5)}get label(){return this.getField(6)}get color(){return this.getField(7)}get minimized(){return this.getField(8)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},c.AudioBusses,!0),2:B.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:h},c.AudioOutput,!0),3:K.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!1}}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:h}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:h}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:h},"red"),8:M.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:h})}}};var Ra=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:h}),i)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return _(e.visitAuxSendBox,this)}get audioUnit(){return this.getField(1)}get targetBus(){return this.getField(2)}get index(){return this.getField(3)}get routing(){return this.getField(4)}get sendGain(){return this.getField(5)}get sendPan(){return this.getField(6)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:h},c.AuxSend,!0),2:B.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:h},c.AudioOutput,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:E.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1),5:w.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB"),6:w.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","")}}};var dl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[c.Groove],mandatory:!0}}),i)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return _(e.visitGrooveShuffleBox,this)}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:h}),10:w.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.6),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"non-negative","ppqn",480)}}};var wf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownAudioEffectDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var bf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownMidiEffectDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Af=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:h}),i)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return _(e.visitDeviceInterfaceKnobBox,this)}get userInterface(){return this.getField(1)}get parameter(){return this.getField(2)}get index(){return this.getField(3)}get anchor(){return this.getField(10)}get color(){return this.getField(11)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:h},c.DeviceUserInterface,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:h},c.ParameterController,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),10:w.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:h},"unipolar","%"),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:h})}}};var Gf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:K.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[c.DeviceUserInterface],mandatory:!1}})}}};var _f=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitModularDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modularSetup(){return this.getField(10)}get userInterface(){return this.getField(11)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:h},c.ModularSetup,!0),11:Gf.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:h})}}};var Pf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitStereoToolDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get panning(){return this.getField(11)}get stereo(){return this.getField(12)}get invertL(){return this.getField(13)}get invertR(){return this.getField(14)}get swap(){return this.getField(15)}get panningMixing(){return this.getField(20)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:w.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%",0),12:w.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%",0),13:M.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),14:M.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1)}}};var pl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCompressorDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get automakeup(){return this.getField(11)}get autoattack(){return this.getField(12)}get autorelease(){return this.getField(13)}get inputgain(){return this.getField(14)}get threshold(){return this.getField(15)}get ratio(){return this.getField(16)}get knee(){return this.getField(17)}get attack(){return this.getField(18)}get release(){return this.getField(19)}get makeup(){return this.getField(20)}get mix(){return this.getField(21)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:M.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!1),11:M.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!0),12:M.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!1),13:M.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!1),14:w.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:w.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:w.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:w.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:w.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:w.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",5),20:w.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:w.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Sf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDelayDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get delay(){return this.getField(10)}get feedback(){return this.getField(11)}get cross(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"any","",4),11:w.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),12:w.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%",0),13:w.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%",0),14:w.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",-6),15:w.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var Ef=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCrusherDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get crush(){return this.getField(10)}get bits(){return this.getField(11)}get boost(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",0),11:E.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:w.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:w.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Bf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="DattorroReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDattorroReverbDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get preDelay(){return this.getField(10)}get bandwidth(){return this.getField(11)}get inputDiffusion1(){return this.getField(12)}get inputDiffusion2(){return this.getField(13)}get decay(){return this.getField(14)}get decayDiffusion1(){return this.getField(15)}get decayDiffusion2(){return this.getField(16)}get damping(){return this.getField(17)}get excursionRate(){return this.getField(18)}get excursionDepth(){return this.getField(19)}get wet(){return this.getField(20)}get dry(){return this.getField(21)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:w.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.9999),12:w.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.75),13:w.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.625),14:w.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),15:w.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.7),16:w.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),17:w.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.005),18:w.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),19:w.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.7),20:w.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",-6),21:w.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var Ff=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="VelocityDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVelocityDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get magnetPosition(){return this.getField(10)}get magnetStrength(){return this.getField(11)}get randomSeed(){return this.getField(12)}get randomAmount(){return this.getField(13)}get offset(){return this.getField(14)}get mix(){return this.getField(15)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),11:w.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%"),12:E.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:h},"any","",2048),13:w.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%"),14:w.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%",0),15:w.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Nf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitFoldDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get drive(){return this.getField(10)}get overSampling(){return this.getField(11)}get volume(){return this.getField(12)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:E.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:h},{length:3},"",0),12:w.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var kf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="TidalDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTidalDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get slope(){return this.getField(10)}get symmetry(){return this.getField(11)}get rate(){return this.getField(20)}get depth(){return this.getField(21)}get offset(){return this.getField(22)}get channelOffset(){return this.getField(23)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%",-.25),11:w.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),20:w.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",3),21:w.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","",1),22:w.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:w.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 Lc=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get order(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:w.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:E.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{length:4},""),12:w.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 Kc=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:w.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:w.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 xl=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}}),10:w.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:w.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:w.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 $f=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitRevampDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get highPass(){return this.getField(10)}get lowShelf(){return this.getField(11)}get lowBell(){return this.getField(12)}get midBell(){return this.getField(13)}get highBell(){return this.getField(14)}get highShelf(){return this.getField(15)}get lowPass(){return this.getField(16)}get gain(){return this.getField(17)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:Lc.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:h}),11:Kc.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:h}),12:xl.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:h}),13:xl.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:h}),14:xl.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:h}),15:Kc.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:h}),16:Lc.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:h}),17:w.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 Mf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitReverbDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get decay(){return this.getField(10)}get preDelay(){return this.getField(11)}get damp(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),11:w.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:w.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",.5),13:w.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%",0),14:w.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",-3),15:w.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var qf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get volume(){return this.getField(2)}get octave(){return this.getField(3)}get tune(){return this.getField(4)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:w.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","db",-1/0),3:E.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:w.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 Hf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get rate(){return this.getField(2)}get sync(){return this.getField(3)}get targetTune(){return this.getField(10)}get targetCutoff(){return this.getField(11)}get targetVolume(){return this.getField(12)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:w.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:M.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},!1),10:w.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%"),11:w.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%"),12:w.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%")}}};var Jf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get attack(){return this.getField(1)}get hold(){return this.getField(2)}get release(){return this.getField(3)}get volume(){return this.getField(4)}initializeFields(){return{1:w.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:w.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:w.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:w.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","db",.001)}}};var hl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVaporisateurDeviceBox,this)}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get octave(){return this.getField(11)}get tune(){return this.getField(12)}get waveform(){return this.getField(13)}get cutoff(){return this.getField(14)}get resonance(){return this.getField(15)}get attack(){return this.getField(16)}get release(){return this.getField(17)}get filterEnvelope(){return this.getField(18)}get decay(){return this.getField(19)}get sustain(){return this.getField(20)}get glideTime(){return this.getField(21)}get voicingMode(){return this.getField(22)}get unisonCount(){return this.getField(23)}get unisonDetune(){return this.getField(24)}get unisonStereo(){return this.getField(25)}get filterOrder(){return this.getField(26)}get filterKeyboard(){return this.getField(27)}get lfo(){return this.getField(30)}get oscillators(){return this.getField(40)}get noise(){return this.getField(50)}get version(){return this.getField(99)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",-6),11:E.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"any","oct"),12:w.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"any","ct"),13:E.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"any",""),14:w.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:w.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:w.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:w.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:w.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%"),19:w.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:w.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",1),21:w.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",0),22:E.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{values:[0,1]},"",1),23:E.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:w.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:w.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",1),26:E.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:w.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","%"),30:Hf.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:h}),40:of.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:h},e=>qf.create(e),2),50:Jf.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:h}),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:h},"any","")}}};var Qf=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h})}}};var fl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="MIDIOutputDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputDeviceBox,this)}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get deprecatedDevice(){return this.getField(10)}get channel(){return this.getField(11)}get deprecatedDelay(){return this.getField(12)}get parameters(){return this.getField(13)}get device(){return this.getField(14)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:Qf.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:h}),11:E.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:h},{min:0,max:15},"ch"),12:E.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:h},"any","ms",10),13:K.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:h},c.MIDIDevice,!1)}}};var Di=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:h}),i)}static ClassName="MIDIOutputBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputBox,this)}get root(){return this.getField(1)}get device(){return this.getField(2)}get id(){return this.getField(3)}get label(){return this.getField(4)}get delayInMs(){return this.getField(5)}get sendTransportMessages(){return this.getField(6)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},c.MIDIDevice,!0),2:K.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:h}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:h},{min:0,max:500},"ms",10),6:M.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:h},!0)}}};var Ci=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:h}),i)}static ClassName="MIDIOutputParameterBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputParameterBox,this)}get owner(){return this.getField(1)}get label(){return this.getField(2)}get controller(){return this.getField(3)}get value(){return this.getField(4)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},c.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h},""),3:E.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:h},{min:0,max:127},"#",64),4:w.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!0}},"unipolar","%")}}};var ml=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontDeviceBox,this)}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get file(){return this.getField(10)}get presetIndex(){return this.getField(11)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:h},c.SoundfontFile,!1),11:E.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:h},{min:0,max:65535},"")}}};var gl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitNanoDeviceBox,this)}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get file(){return this.getField(15)}get release(){return this.getField(20)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"decibel","dB",-3),15:B.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:h},c.AudioFile,!1),20:w.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 vl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldDeviceBox,this)}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get samples(){return this.getField(10)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:K.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[c.Sample],mandatory:!1}})}}};var No=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[c.Editing],mandatory:!1}}),i)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldSampleBox,this)}get device(){return this.getField(10)}get file(){return this.getField(11)}get midiEffects(){return this.getField(12)}get audioEffects(){return this.getField(13)}get index(){return this.getField(15)}get label(){return this.getField(20)}get icon(){return this.getField(21)}get enabled(){return this.getField(22)}get minimized(){return this.getField(23)}get mute(){return this.getField(40)}get solo(){return this.getField(41)}get exclude(){return this.getField(42)}get polyphone(){return this.getField(43)}get gate(){return this.getField(44)}get pitch(){return this.getField(45)}get sampleStart(){return this.getField(46)}get sampleEnd(){return this.getField(47)}get attack(){return this.getField(48)}get release(){return this.getField(49)}initializeFields(){return{10:B.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:h},c.Sample,!0),11:B.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:h},c.AudioFile,!0),12:K.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MidiEffectHost],mandatory:!1}}),13:K.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),15:E.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:h}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:h}),22:M.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),23:M.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),40:M.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:h}),41:M.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:h}),42:M.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:h}),43:M.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:h}),44:E.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:h},{length:3},"",0),45:w.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:w.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",0),47:w.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%",1),48:w.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:w.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 yl=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.Automation],mandatory:!1}}),i)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTapeDeviceBox,this)}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get flutter(){return this.getField(10)}get wow(){return this.getField(11)}get noise(){return this.getField(12)}get saturation(){return this.getField(13)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%"),11:w.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%"),12:w.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%"),13:w.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"unipolar","%")}}};var If=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitArpeggioDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modeIndex(){return this.getField(10)}get numOctaves(){return this.getField(11)}get rateIndex(){return this.getField(12)}get gate(){return this.getField(13)}get repeat(){return this.getField(14)}get velocity(){return this.getField(15)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{length:3},"",0),11:E.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:E.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},{length:17},"",9),13:w.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:E.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:w.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MidiControl],mandatory:!1}},"bipolar","",0)}}};var Df=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPitchDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get semiTones(){return this.getField(10)}get cents(){return this.getField(11)}get octaves(){return this.getField(12)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.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:w.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:E.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 Cf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[c.Device,c.Selection],mandatory:!1}}),i)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitZeitgeistDeviceBox,this)}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get groove(){return this.getField(10)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},c.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:h},c.Groove,!0)}}};var Tf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:h}),i)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return _(e.visitModularBox,this)}get collection(){return this.getField(1)}get device(){return this.getField(2)}get editing(){return this.getField(3)}get modules(){return this.getField(11)}get connections(){return this.getField(12)}get label(){return this.getField(13)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},c.ModularSetup,!0),2:K.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!0}}),3:K.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[c.ModuleCollection],mandatory:!1}}),12:K.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:h})}}};var Rf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:h}),i)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return _(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},c.ConnectionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:h},c.VoltageConnection,!0),3:B.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:h},c.VoltageConnection,!0)}}};var Xr=class r extends Ue{static create(e){return new r(e)}constructor(e){super(e)}get collection(){return this.getField(1)}get label(){return this.getField(2)}get x(){return this.getField(3)}get y(){return this.getField(4)}get collapsed(){return this.getField(5)}get removable(){return this.getField(6)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},c.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:E.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:h},"any","x"),4:E.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:h},"any","y"),5:M.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:h},!1),6:M.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:h},!0)}}};var Of=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:Xr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Vf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:Xr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var zf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return _(e.visitModuleDelayBox,this)}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(11)}get time(){return this.getField(20)}initializeFields(){return{1:Xr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var Uf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return _(e.visitModuleMultiplierBox,this)}get attributes(){return this.getField(1)}get voltageInputX(){return this.getField(10)}get voltageInputY(){return this.getField(11)}get voltageOutput(){return this.getField(12)}get multiplier(){return this.getField(20)}initializeFields(){return{1:Xr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:K.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:h},"unipolar","%")}}};var jf=class r extends ${static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),i)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return _(e.visitModuleGainBox,this)}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(12)}get gain(){return this.getField(20)}initializeFields(){return{1:Xr.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:K.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:K.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1}},"decibel","dB")}}};var un;(function(r){r.write=(e,t)=>{if(t.type==="none")e.disconnect(),e.setValue(0);else if(t.type==="linear")e.disconnect(),e.setValue(1);else if(t.type==="curve"){e.setValue(0);let i=e.pointerHub.filter(c.ValueInterpolation).at(0)?.box;Z(i)?(yx(i,So),i.slope.setValue(t.slope)):So.create(e.box.graph,A.generate(),n=>{n.slope.setValue(t.slope),n.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return Z(t)?(yx(t,So),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?xo.None:e.getValue()===1?xo.Linear:N("Unknown Interpolation value")}})(un||(un={}));var $o=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ce=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Wc,wl,lt,Zc,Mo,Gc,Gn=class r{constructor(e,t){this.type="value-event",Wc.set(this,new z),wl.set(this,void 0),lt.set(this,void 0),Zc.set(this,void 0),Mo.set(this,void 0),Gc.set(this,!1),$o(this,wl,e,"f"),$o(this,lt,t,"f"),$o(this,Zc,Ce(this,Wc,"f").own(new Rh(()=>un.read(Ce(this,lt,"f").interpolation))),"f");let i=()=>{Ce(this,Zc,"f").invalidate(),this.collection.ifSome(n=>n.onEventPropertyChanged())};Ce(this,Wc,"f").ownAll(Ce(this,lt,"f").subscribe(Fe.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let o=this.collection.unwrap(),a=n.address.fieldKeys,s=O.equals(Ce(this,lt,"f").index.address.fieldKeys,a),l=O.equals(Ce(this,lt,"f").position.address.fieldKeys,a);s||l?o.requestSorting():o.onEventPropertyChanged()}}),Ce(this,lt,"f").interpolation.subscribe(i),Ce(this,lt,"f").interpolation.pointerHub.subscribe({onAdded:({box:n})=>{Ce(this,Mo,"f").terminate(),$o(this,Mo,n.subscribe(Fe.Children,i),"f"),i()},onRemoved:()=>{Ce(this,Mo,"f").terminate(),$o(this,Mo,L.Empty,"f"),i()}})),$o(this,Mo,Ce(this,lt,"f").interpolation.pointerHub.filter(c.ValueInterpolation).at(0)?.box.subscribe(Fe.Children,i)??L.Empty,"f")}onSelected(){$o(this,Gc,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){$o(this,Gc,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Ce(this,Mo,"f").terminate(),Ce(this,Wc,"f").terminate()}get box(){return Ce(this,lt,"f")}get uuid(){return Ce(this,lt,"f").address.uuid}get address(){return Ce(this,lt,"f").address}get position(){return Ce(this,lt,"f").position.getValue()}get index(){return Ce(this,lt,"f").index.getValue()}set interpolation(e){un.write(Ce(this,lt,"f").interpolation,e)}get interpolation(){return Ce(this,Zc,"f").get()}get value(){return Ce(this,lt,"f").value.getValue()}get isSelected(){return Ce(this,Gc,"f")}get collection(){return Ce(this,lt,"f").events.targetVertex.map(e=>Ce(this,wl,"f").boxAdapters.adapterFor(e.box,nr))}copyTo(e){let t=Po.create(Ce(this,wl,"f").boxGraph,A.generate(),i=>{i.position.setValue(e?.position??this.position),i.index.setValue(e?.index??this.index),i.events.refer(e?.events??this.collection.unwrap().box.events),i.value.setValue(e?.value??this.value)});return un.write(t.interpolation,e?.interpolation??this.interpolation),Ce(this,wl,"f").boxAdapters.adapterFor(t,r)}copyFrom(e){return Ce(this,lt,"f").position.setValue(e?.position??this.position),Ce(this,lt,"f").index.setValue(e?.index??this.index),Ce(this,lt,"f").events.refer(e?.events??this.collection.unwrap().box.events),Ce(this,lt,"f").value.setValue(e?.value??this.value),un.write(Ce(this,lt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Wc=new WeakMap,wl=new WeakMap,lt=new WeakMap,Zc=new WeakMap,Mo=new WeakMap,Gc=new WeakMap;Gn.Comparator=(r,e)=>{let t=r.position-e.position;if(t!==0)return t;let i=r.index-e.index;if(i!==0)return i;throw new Error(`${r} and ${e} are identical in terms of comparison`)};var qc=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Te=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Hc,Jc,Io,ei,Oa,Qc,qn,Yf,nr=class r{constructor(e,t){Hc.add(this),Jc.set(this,new z),Io.set(this,void 0),ei.set(this,void 0),Oa.set(this,void 0),Qc.set(this,void 0),qn.set(this,void 0),qc(this,Io,e,"f"),qc(this,ei,t,"f"),qc(this,Oa,new te,"f"),qc(this,Qc,A.newSet(n=>n.uuid),"f"),qc(this,qn,mr.create(Gn.Comparator),"f");let i=n=>{let o=X(n.accept({visitValueEventBox:a=>Te(this,Io,"f").boxAdapters.adapterFor(a,Gn)}),`Could not find adapter for ${n}`);Te(this,Qc,"f").add(o)&&(Te(this,qn,"f").add(o),Te(this,Hc,"m",Yf).call(this))};Te(this,ei,"f").events.pointerHub.incoming().forEach(({box:n})=>i(n)),Te(this,Jc,"f").own(Te(this,ei,"f").events.pointerHub.subscribe({onAdded:({box:n})=>i(n),onRemoved:({box:{address:{uuid:n}}})=>{Te(this,qn,"f").remove(Te(this,Qc,"f").removeByKey(n)),Te(this,Hc,"m",Yf).call(this)}})),Te(this,Jc,"f").own(Te(this,ei,"f").owners.pointerHub.subscribe({onAdded:()=>Te(this,Oa,"f").notify(this),onRemoved:()=>Te(this,Oa,"f").notify(this)}))}valueAt(e,t){return rf.valueAt(Te(this,qn,"f"),e,t)}copy(){let e=Te(this,Io,"f").boxGraph,t=Zn.create(e,A.generate());return Te(this,qn,"f").asArray().forEach(i=>i.copyTo({events:t.events})),Te(this,Io,"f").boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return t===null?g.None:g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t===null)return g.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(t.position===e)return g.wrap(t);if(t.interpolation.type==="none")return g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t.interpolation.type==="linear"){let{position:n,value:o}=t,{position:a,value:s}=i;return g.wrap(this.createEvent({position:e,value:Oh(o,s,(e-n)/(a-n)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:n,value:o}=t,{position:a,value:s}=i,l=a-n,u=e-n,p=Jr.byHalf(l,o,Jr.valueAt({slope:t.interpolation.slope,steps:l,y0:o,y1:s},l*.5),s),d=Jr.valueAt(p,u),f=Jr.slopeByHalf(o,Jr.valueAt(p,u*.5),d);return un.write(t.box.interpolation,xo.Curve(f)),g.wrap(this.createEvent({position:e,value:d,index:0,interpolation:xo.Curve(Jr.slopeByHalf(d,Jr.valueAt(p,(u+l)*.5),s))}))}return N("Unknown interpolation type")}subscribeChange(e){return Te(this,Oa,"f").subscribe(e)}createEvent({position:e,index:t,value:i,interpolation:n}){let o=Po.create(Te(this,Io,"f").boxGraph,A.generate(),a=>{a.position.setValue(e),a.index.setValue(t),a.value.setValue(i),a.events.refer(Te(this,ei,"f").events)});return un.write(o.interpolation,n),Te(this,Io,"f").boxAdapters.adapterFor(o,Gn)}requestSorting(){Te(this,qn,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Te(this,Hc,"m",Yf).call(this)}terminate(){Te(this,Jc,"f").terminate()}get box(){return Te(this,ei,"f")}get uuid(){return Te(this,ei,"f").address.uuid}get address(){return Te(this,ei,"f").address}get numOwners(){return Te(this,ei,"f").owners.pointerHub.filter(c.ValueEventCollection).length}get events(){return Te(this,qn,"f")}toString(){return`{ValueEventCollectionBox ${A.toString(Te(this,ei,"f").address.uuid)}}`}};Jc=new WeakMap,Io=new WeakMap,ei=new WeakMap,Oa=new WeakMap,Qc=new WeakMap,qn=new WeakMap,Hc=new WeakSet,Yf=function(){Te(this,Oa,"f").notify(this)};var Va=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},be=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},za,Do,Ua,At,ja,ed,Yc,Xc,bl,Co=class{constructor(e,t){za.add(this),this.type="value-clip",Do.set(this,new z),Ua.set(this,void 0),At.set(this,void 0),ja.set(this,void 0),ed.set(this,void 0),Yc.set(this,void 0),Xc.set(this,L.Empty),Va(this,Ua,e,"f"),Va(this,At,t,"f"),Va(this,Yc,!0,"f"),Va(this,ja,be(this,Do,"f").own(new Ir(!1)),"f"),Va(this,ed,be(this,Do,"f").own(new te),"f"),be(this,Do,"f").own(be(this,At,"f").pointerHub.subscribe({onAdded:()=>be(this,za,"m",bl).call(this),onRemoved:()=>be(this,za,"m",bl).call(this)})),be(this,Do,"f").own(be(this,At,"f").subscribe(Fe.Children,i=>be(this,za,"m",bl).call(this))),be(this,Do,"f").own(be(this,At,"f").events.catchupAndSubscribe(({targetVertex:i})=>{be(this,Xc,"f").terminate(),Va(this,Xc,i.match({none:()=>L.Empty,some:({box:n})=>be(this,Ua,"f").boxAdapters.adapterFor(n,nr).subscribeChange(()=>be(this,za,"m",bl).call(this))}),"f"),be(this,za,"m",bl).call(this)})),Va(this,Yc,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return be(this,ja,"f").catchupAndSubscribe(e)}subscribeChange(e){return be(this,ed,"f").subscribe(e)}accept(e){return _(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&be(this,At,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:be(this,At,"f").events.targetVertex.unwrap();ll.create(be(this,Ua,"f").boxGraph,A.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(be(this,At,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){be(this,ja,"f").setValue(!0)}onDeselected(){be(this,ja,"f").setValue(!1)}get isSelected(){return be(this,ja,"f").getValue()}terminate(){be(this,Xc,"f").terminate(),be(this,Do,"f").terminate()}get box(){return be(this,At,"f")}get uuid(){return be(this,At,"f").address.uuid}get address(){return be(this,At,"f").address}get indexField(){return be(this,At,"f").index}get duration(){return be(this,At,"f").duration.getValue()}get mute(){return be(this,At,"f").mute.getValue()}get hue(){return be(this,At,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return be(this,At,"f").events.targetVertex.map(e=>be(this,Ua,"f").boxAdapters.adapterFor(e.box,nr))}get label(){return be(this,At,"f").label.getValue()}get trackBoxAdapter(){return be(this,Yc,"f")?g.None:be(this,At,"f").clips.targetVertex.map(e=>be(this,Ua,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${A.toString(be(this,At,"f").address.uuid)} d: ${Y.toString(this.duration)}}`}};Do=new WeakMap,Ua=new WeakMap,At=new WeakMap,ja=new WeakMap,ed=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,za=new WeakSet,bl=function(){be(this,ed,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var SP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Al=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},jx,La,Xf,_l=class{constructor(e){this.type="transient-marker",jx.set(this,new z),La.set(this,void 0),Xf.set(this,void 0),SP(this,La,e,"f"),SP(this,Xf,new te,"f")}get box(){return Al(this,La,"f")}get uuid(){return Al(this,La,"f").address.uuid}get address(){return Al(this,La,"f").address}get position(){return Al(this,La,"f").position.getValue()}subscribe(e){return Al(this,Xf,"f").subscribe(e)}terminate(){Al(this,jx,"f").terminate()}};jx=new WeakMap,La=new WeakMap,Xf=new WeakMap;var td=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Vt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},em,rd,cn,id,Pl,tm,Ti=class r{constructor(e,t){em.set(this,new z),rd.set(this,void 0),cn.set(this,void 0),id.set(this,void 0),Pl.set(this,void 0),tm.set(this,void 0),td(this,rd,e,"f"),td(this,cn,t,"f"),td(this,id,A.newSet(({uuid:i})=>i),"f"),td(this,Pl,mr.create(r.Comparator),"f"),td(this,tm,uf.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:i,resolve:n,reject:o}=Promise.withResolvers(),a=this.getOrCreateLoader(),s=a.subscribe(l=>{l.type==="loaded"?(s.terminate(),n(a.data.unwrap("State mismatch"))):l.type==="error"&&(s.terminate(),o(l.reason))});return i}),"f"),Vt(this,em,"f").own(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=Vt(this,rd,"f").boxAdapters.adapterFor(i.box,_l);Vt(this,id,"f").add(n)&&Vt(this,Pl,"f").add(n)},onRemoved:({box:{address:{uuid:i}}})=>{Vt(this,Pl,"f").remove(Vt(this,id,"f").removeByKey(i))}}))}get box(){return Vt(this,cn,"f")}get uuid(){return Vt(this,cn,"f").address.uuid}get address(){return Vt(this,cn,"f").address}get startInSeconds(){return Vt(this,cn,"f").startInSeconds.getValue()}get endInSeconds(){return Vt(this,cn,"f").endInSeconds.getValue()}get transients(){return Vt(this,Pl,"f")}get fileName(){return Vt(this,cn,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Vt(this,tm,"f").call(this)}getOrCreateLoader(){return Vt(this,rd,"f").sampleManager.getOrCreate(Vt(this,cn,"f").address.uuid)}terminate(){Vt(this,em,"f").terminate()}};em=new WeakMap,rd=new WeakMap,cn=new WeakMap,id=new WeakMap,Pl=new WeakMap,tm=new WeakMap;Ti.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),N("Events at the same position: "+r.position+", "+e.position)):t};var nd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},or=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},od,rm,im,Hn,sd,ad,nm,To=class{constructor(e,t){od.add(this),this.type="warp-marker",rm.set(this,new z),im.set(this,void 0),Hn.set(this,void 0),sd.set(this,void 0),ad.set(this,!1),nd(this,im,e,"f"),nd(this,Hn,t,"f"),nd(this,sd,new te,"f"),or(this,rm,"f").own(t.subscribe(Fe.Children,()=>or(this,od,"m",nm).call(this)))}onSelected(){nd(this,ad,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),or(this,od,"m",nm).call(this)}onDeselected(){nd(this,ad,!1,"f"),or(this,od,"m",nm).call(this)}get box(){return or(this,Hn,"f")}get uuid(){return or(this,Hn,"f").address.uuid}get address(){return or(this,Hn,"f").address}get position(){return or(this,Hn,"f").position.getValue()}get seconds(){return or(this,Hn,"f").seconds.getValue()}get isSelected(){return or(this,ad,"f")}get optWarping(){return or(this,Hn,"f").owner.targetVertex.map(e=>or(this,im,"f").boxAdapters.adapterFor(e.box,dn.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return or(this,sd,"f").subscribe(e)}terminate(){or(this,rm,"f").terminate()}};rm=new WeakMap,im=new WeakMap,Hn=new WeakMap,sd=new WeakMap,ad=new WeakMap,od=new WeakSet,nm=function(){or(this,sd,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var om=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),N("Events at the same position: "+r.position+", "+e.position)):t};var ld=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ar=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},am,sm,Sl,Ka,ud,El,pn=class{constructor(e,t){am.set(this,new z),sm.set(this,void 0),Sl.set(this,void 0),Ka.set(this,void 0),ud.set(this,void 0),El.set(this,void 0),ld(this,sm,e,"f"),ld(this,Sl,t,"f"),ld(this,Ka,new te,"f"),ld(this,ud,A.newSet(({uuid:i})=>i),"f"),ld(this,El,mr.create(om),"f"),ar(this,am,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=ar(this,sm,"f").boxAdapters.adapterFor(i.box,To);ar(this,ud,"f").add(n)&&(ar(this,El,"f").add(n),ar(this,Ka,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{ar(this,El,"f").remove(ar(this,ud,"f").removeByKey(i)),ar(this,Ka,"f").notify()}}))}get box(){return ar(this,Sl,"f")}get uuid(){return ar(this,Sl,"f").address.uuid}get address(){return ar(this,Sl,"f").address}get warpMarkers(){return ar(this,El,"f")}subscribe(e){return ar(this,Ka,"f").subscribe(e)}onChanged(){ar(this,Ka,"f").notify()}terminate(){ar(this,am,"f").terminate()}};am=new WeakMap,sm=new WeakMap,Sl=new WeakMap,Ka=new WeakMap,ud=new WeakMap,El=new WeakMap;var cd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},zt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lm,um,Ro,Wa,dd,Bl,hn=class{constructor(e,t){lm.set(this,new z),um.set(this,void 0),Ro.set(this,void 0),Wa.set(this,void 0),dd.set(this,void 0),Bl.set(this,void 0),cd(this,um,e,"f"),cd(this,Ro,t,"f"),cd(this,Wa,new te,"f"),cd(this,dd,A.newSet(({uuid:i})=>i),"f"),cd(this,Bl,mr.create(om),"f"),zt(this,lm,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=zt(this,um,"f").boxAdapters.adapterFor(i.box,To);zt(this,dd,"f").add(n)&&(zt(this,Bl,"f").add(n),zt(this,Wa,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{zt(this,Bl,"f").remove(zt(this,dd,"f").removeByKey(i)),zt(this,Wa,"f").notify()}}))}get box(){return zt(this,Ro,"f")}get uuid(){return zt(this,Ro,"f").address.uuid}get address(){return zt(this,Ro,"f").address}get warpMarkers(){return zt(this,Bl,"f")}get playbackRate(){return zt(this,Ro,"f").playbackRate.getValue()}get transientPlayMode(){return qr(zt(this,Ro,"f").transientPlayMode.getValue(),bo)}subscribe(e){return zt(this,Wa,"f").subscribe(e)}onChanged(){zt(this,Wa,"f").notify()}terminate(){zt(this,lm,"f").terminate()}};lm=new WeakMap,um=new WeakMap,Ro=new WeakMap,Wa=new WeakMap,dd=new WeakMap,Bl=new WeakMap;var dn;(function(r){r.isAudioPlayMode=e=>e instanceof pn||e instanceof hn})(dn||(dn={}));var Cr=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},oe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Za,Fl,Ga,at,Nl,qa,pd,fd,hd,Ha,kl,$l,Ml,Jn=class r{constructor(e,t){Za.add(this),this.type="audio-clip",Fl.set(this,new z),Ga.set(this,void 0),at.set(this,void 0),Nl.set(this,void 0),qa.set(this,void 0),pd.set(this,void 0),fd.set(this,void 0),hd.set(this,void 0),Ha.set(this,g.None),kl.set(this,g.None),$l.set(this,L.Empty),Cr(this,Ga,e,"f"),Cr(this,at,t,"f"),Cr(this,hd,!0,"f"),Cr(this,Nl,new Qr,"f"),Cr(this,qa,oe(this,Fl,"f").own(new Ir(!1)),"f"),Cr(this,pd,yo.aware(e.tempoMap,t.timeBase,r.STATIC_POSITION,t.duration),"f"),Cr(this,fd,oe(this,Fl,"f").own(new te),"f"),oe(this,Fl,"f").ownAll(oe(this,at,"f").pointerHub.subscribe({onAdded:()=>oe(this,Za,"m",Ml).call(this),onRemoved:()=>oe(this,Za,"m",Ml).call(this)}),oe(this,at,"f").playMode.catchupAndSubscribe(({targetVertex:i})=>{oe(this,$l,"f").terminate(),i.match({none:()=>oe(this,Nl,"f").clear(),some:({box:n})=>{let o=oe(this,Ga,"f").boxAdapters.adapterFor(n,dn.isAudioPlayMode);Cr(this,$l,o.subscribe(()=>oe(this,Za,"m",Ml).call(this)),"f"),oe(this,Nl,"f").wrap(o)}})}),oe(this,at,"f").file.catchupAndSubscribe(i=>{Cr(this,Ha,i.targetVertex.map(n=>oe(this,Ga,"f").boxAdapters.adapterFor(n.box,Ti)),"f"),oe(this,kl,"f").ifSome(n=>n.terminate()),Cr(this,kl,oe(this,Ha,"f").map(n=>n.getOrCreateLoader().subscribe(()=>oe(this,Za,"m",Ml).call(this))),"f")}),oe(this,at,"f").subscribe(Fe.Children,i=>oe(this,Za,"m",Ml).call(this))),Cr(this,hd,!1,"f")}catchupAndSubscribeSelected(e){return oe(this,qa,"f").catchupAndSubscribe(e)}subscribeChange(e){return oe(this,fd,"f").subscribe(e)}accept(e){return _(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){ul.create(oe(this,Ga,"f").boxGraph,A.generate(),t=>{t.index.setValue(this.indexField.getValue()),t.gain.setValue(this.gain.getValue()),t.timeBase.setValue(this.timeBase),t.label.setValue(this.label),t.hue.setValue(this.hue),t.duration.setValue(this.duration),t.mute.setValue(this.mute),t.clips.refer(oe(this,at,"f").clips.targetVertex.unwrap()),t.file.refer(oe(this,at,"f").file.targetVertex.unwrap()),t.events.refer(oe(this,at,"f").events.targetVertex.unwrap()),oe(this,at,"f").playMode.ifVertex(i=>t.playMode.refer(i.box))})}onSelected(){oe(this,qa,"f").setValue(!0)}onDeselected(){oe(this,qa,"f").setValue(!1)}get isSelected(){return oe(this,qa,"f").getValue()}get box(){return oe(this,at,"f")}get uuid(){return oe(this,at,"f").address.uuid}get address(){return oe(this,at,"f").address}get indexField(){return oe(this,at,"f").index}get duration(){return oe(this,pd,"f").toPPQN()}set duration(e){oe(this,pd,"f").fromPPQN(e)}get mute(){return oe(this,at,"f").mute.getValue()}get hue(){return oe(this,at,"f").hue.getValue()}get gain(){return oe(this,at,"f").gain}get file(){return oe(this,Ha,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return oe(this,Nl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return g.None}get timeBase(){return qr(oe(this,at,"f").timeBase.getValue(),rr)}get waveformOffset(){return oe(this,at,"f").waveformOffset}get isPlayModeNoWarp(){return oe(this,at,"f").playMode.isEmpty()}get asPlayModePitch(){return this.observableOptPlayMode.map(e=>De(e,pn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>De(e,hn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>dn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(oe(this,Ha,"f").isEmpty())return"No Audio File";let e=oe(this,Ha,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):oe(this,at,"f").label.getValue()}get trackBoxAdapter(){return oe(this,hd,"f")?g.None:oe(this,at,"f").clips.targetVertex.map(e=>oe(this,Ga,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return!1}get canMirror(){return!1}terminate(){oe(this,kl,"f").ifSome(e=>e.terminate()),Cr(this,kl,g.None,"f"),oe(this,$l,"f").terminate(),Cr(this,$l,L.Empty,"f"),oe(this,Fl,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${A.toString(oe(this,at,"f").address.uuid)} d: ${Y.toString(this.duration)}}`}};Fl=new WeakMap,Ga=new WeakMap,at=new WeakMap,Nl=new WeakMap,qa=new WeakMap,pd=new WeakMap,fd=new WeakMap,hd=new WeakMap,Ha=new WeakMap,kl=new WeakMap,$l=new WeakMap,Za=new WeakSet,Ml=function(){oe(this,fd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};Jn.STATIC_POSITION={getValue:()=>0};var md=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},mt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Il,Ft,cm,gd,Ja=class r{constructor(e,t){this.type="note-event",Il.set(this,void 0),Ft.set(this,void 0),cm.set(this,void 0),gd.set(this,!1),md(this,Il,e,"f"),md(this,Ft,t,"f"),md(this,cm,mt(this,Ft,"f").subscribe(Fe.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.collection.unwrap(),o=i.address.fieldKeys,a=O.equals(mt(this,Ft,"f").pitch.address.fieldKeys,o),s=O.equals(mt(this,Ft,"f").position.address.fieldKeys,o);a||s?n.requestSorting():n.onEventPropertyChanged()}}),"f")}onSelected(){md(this,gd,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){md(this,gd,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){mt(this,cm,"f").terminate()}get box(){return mt(this,Ft,"f")}get uuid(){return mt(this,Ft,"f").address.uuid}get address(){return mt(this,Ft,"f").address}get position(){return mt(this,Ft,"f").position.getValue()}get duration(){return mt(this,Ft,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return mt(this,Ft,"f").velocity.getValue()}get pitch(){return mt(this,Ft,"f").pitch.getValue()}get cent(){return mt(this,Ft,"f").cent.getValue()}get chance(){return mt(this,Ft,"f").chance.getValue()}get playCount(){return mt(this,Ft,"f").playCount.getValue()}get playCurve(){return mt(this,Ft,"f").playCurve.getValue()}get isSelected(){return mt(this,gd,"f")}get collection(){return mt(this,Ft,"f").events.targetVertex.map(e=>mt(this,Il,"f").boxAdapters.adapterFor(e.box,ti))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:t}=this.collection.unwrap();return e===t?.5:1-(this.pitch-e)/(t-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return mt(this,Il,"f").boxAdapters.adapterFor(_o.create(mt(this,Il,"f").boxGraph,A.generate(),t=>{t.position.setValue(e?.position??this.position),t.duration.setValue(e?.duration??this.duration),t.pitch.setValue(e?.pitch??this.pitch),t.playCount.setValue(e?.playCount??this.playCount),t.events.refer(e?.events??this.collection.unwrap().box.events),t.velocity.setValue(this.velocity),t.cent.setValue(this.cent),t.chance.setValue(this.chance)}),r)}computeCurveValue(e){return tr.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,i=O.create(n=>{let o=Math.floor(this.computeCurveValue(n/e)*this.duration),a=Math.floor(this.computeCurveValue((n+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+o),duration:Math.max(1,a-o),playCount:1,events:t})},e);return mt(this,Ft,"f").delete(),i}};Il=new WeakMap,Ft=new WeakMap,cm=new WeakMap,gd=new WeakMap;var fn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ge=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Qn,vd,Oo,Ri,Qa,yd,ri,pm,hm,fm,Vo,dm,xd,ti=class r{constructor(e,t){Qn.add(this),vd.set(this,new z),Oo.set(this,void 0),Ri.set(this,void 0),Qa.set(this,void 0),yd.set(this,void 0),ri.set(this,void 0),pm.set(this,60),hm.set(this,60),fm.set(this,0),Vo.set(this,!1),fn(this,Oo,e,"f"),fn(this,Ri,t,"f"),fn(this,Qa,new te,"f"),fn(this,yd,A.newSet(i=>i.uuid),"f"),fn(this,ri,mr.create(tr.Comparator),"f"),ge(this,vd,"f").own(ge(this,Ri,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=ge(this,Oo,"f").boxAdapters.adapterFor(i,Ja);ge(this,yd,"f").add(n)&&(ge(this,ri,"f").add(n),ge(this,Qn,"m",dm).call(this))},onRemoved:({box:{address:{uuid:i}}})=>{ge(this,ri,"f").remove(ge(this,yd,"f").removeByKey(i)),ge(this,Qn,"m",dm).call(this)}})),ge(this,vd,"f").own(ge(this,Ri,"f").owners.pointerHub.subscribe({onAdded:()=>ge(this,Qa,"f").notify(this),onRemoved:()=>ge(this,Qa,"f").notify(this)}))}copy(){let e=ge(this,Oo,"f").boxGraph,t=Wn.create(e,A.generate());return ge(this,ri,"f").asArray().forEach(i=>i.copyTo({events:t.events})),ge(this,Oo,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:i,pitch:n,chance:o,playCount:a,cent:s}){return ge(this,Oo,"f").boxAdapters.adapterFor(_o.create(ge(this,Oo,"f").boxGraph,A.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(i),l.pitch.setValue(n),l.chance.setValue(o),l.playCount.setValue(a),l.cent.setValue(s),l.events.refer(ge(this,Ri,"f").events)}),Ja)}subscribeChange(e){return ge(this,Qa,"f").subscribe(e)}selectable(){return ge(this,ri,"f").asArray()}selectableAt(e){for(let t of ge(this,ri,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return Je.one(t);return Je.empty()}selectablesBetween(e,t){let i=[];for(let n of ge(this,ri,"f").asArray())Fc.intersect1D(n.position,n.complete,e.u,t.u)&&Fc.intersect1D(n.pitch,n.pitch,e.v,t.v)&&i.push(n);return i}requestSorting(){ge(this,ri,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){ge(this,Qn,"m",dm).call(this)}terminate(){ge(this,vd,"f").terminate()}get box(){return ge(this,Ri,"f")}get uuid(){return ge(this,Ri,"f").address.uuid}get address(){return ge(this,Ri,"f").address}get numOwners(){return ge(this,Ri,"f").owners.pointerHub.filter(c.NoteEventCollection).length}get events(){return ge(this,Vo,"f")||ge(this,Qn,"m",xd).call(this),ge(this,ri,"f")}get minPitch(){return ge(this,Vo,"f")||ge(this,Qn,"m",xd).call(this),ge(this,pm,"f")}get maxPitch(){return ge(this,Vo,"f")||ge(this,Qn,"m",xd).call(this),ge(this,hm,"f")}get maxDuration(){return ge(this,Vo,"f")||ge(this,Qn,"m",xd).call(this),ge(this,fm,"f")}toString(){return`{NoteEventCollectionBox ${A.toString(ge(this,Ri,"f").address.uuid)}}`}};vd=new WeakMap,Oo=new WeakMap,Ri=new WeakMap,Qa=new WeakMap,yd=new WeakMap,ri=new WeakMap,pm=new WeakMap,hm=new WeakMap,fm=new WeakMap,Vo=new WeakMap,Qn=new WeakSet,dm=function(){fn(this,Vo,!1,"f"),ge(this,Qa,"f").notify(this)},xd=function(){let e=127,t=0,i=0;ge(this,ri,"f").asArray().forEach(({pitch:n,duration:o})=>{e=Math.min(e,n),t=Math.max(t,n),i=Math.max(i,o)}),fn(this,pm,e,"f"),fn(this,hm,t,"f"),fn(this,fm,i,"f"),fn(this,Vo,!0,"f")};var Ya=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Xa,Dl,es,_t,ts,Ad,wd,bd,Cl,Tl=class{constructor(e,t){Xa.add(this),this.type="note-clip",Dl.set(this,new z),es.set(this,void 0),_t.set(this,void 0),ts.set(this,void 0),Ad.set(this,void 0),wd.set(this,void 0),bd.set(this,L.Empty),Ya(this,es,e,"f"),Ya(this,_t,t,"f"),Ya(this,wd,!0,"f"),Ya(this,ts,Pe(this,Dl,"f").own(new Ir(!1)),"f"),Ya(this,Ad,Pe(this,Dl,"f").own(new te),"f"),Pe(this,Dl,"f").ownAll(Pe(this,_t,"f").pointerHub.subscribe({onAdded:()=>Pe(this,Xa,"m",Cl).call(this),onRemoved:()=>Pe(this,Xa,"m",Cl).call(this)}),Pe(this,_t,"f").subscribe(Fe.Children,i=>Pe(this,Xa,"m",Cl).call(this)),Pe(this,_t,"f").events.catchupAndSubscribe(({targetVertex:i})=>{Pe(this,bd,"f").terminate(),Ya(this,bd,i.match({none:()=>L.Empty,some:({box:n})=>Pe(this,es,"f").boxAdapters.adapterFor(n,ti).subscribeChange(()=>Pe(this,Xa,"m",Cl).call(this))}),"f"),Pe(this,Xa,"m",Cl).call(this)})),Ya(this,wd,!1,"f")}catchupAndSubscribeSelected(e){return Pe(this,ts,"f").catchupAndSubscribe(e)}subscribeChange(e){return Pe(this,Ad,"f").subscribe(e)}accept(e){return _(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Pe(this,_t,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Pe(this,_t,"f").events.targetVertex.unwrap();sl.create(Pe(this,es,"f").boxGraph,A.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(Pe(this,_t,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){Pe(this,ts,"f").setValue(!0)}onDeselected(){Pe(this,ts,"f").setValue(!1)}get isSelected(){return Pe(this,ts,"f").getValue()}terminate(){Pe(this,bd,"f").terminate(),Pe(this,Dl,"f").terminate()}get box(){return Pe(this,_t,"f")}get uuid(){return Pe(this,_t,"f").address.uuid}get address(){return Pe(this,_t,"f").address}get indexField(){return Pe(this,_t,"f").index}get duration(){return Pe(this,_t,"f").duration.getValue()}get mute(){return Pe(this,_t,"f").mute.getValue()}get hue(){return Pe(this,_t,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Pe(this,_t,"f").events.targetVertex.map(e=>Pe(this,es,"f").boxAdapters.adapterFor(e.box,ti))}get label(){return Pe(this,_t,"f").label.getValue()}get trackBoxAdapter(){return Pe(this,wd,"f")?g.None:Pe(this,_t,"f").clips.targetVertex.map(e=>Pe(this,es,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${A.toString(Pe(this,_t,"f").address.uuid)} d: ${Y.toString(this.duration)}}`}};Dl=new WeakMap,es=new WeakMap,_t=new WeakMap,ts=new WeakMap,Ad=new WeakMap,wd=new WeakMap,bd=new WeakMap,Xa=new WeakSet,Cl=function(){Pe(this,Ad,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var mm={for:(r,e)=>X(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Tl),visitValueClipBox:t=>r.adapterFor(t,Co),visitAudioClipBox:t=>r.adapterFor(t,Jn)}),"")};var gm=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},zo=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vm,Rl,_d,Pd,ym=class{constructor(e,t){vm.set(this,void 0),Rl.set(this,void 0),_d.set(this,void 0),Pd.set(this,void 0),gm(this,vm,e,"f"),gm(this,Rl,new z,"f"),gm(this,_d,zo(this,Rl,"f").own(new te),"f"),gm(this,Pd,zo(this,Rl,"f").own(Ot.create(e.box.clips,i=>mm.for(t,i),c.ClipCollection)),"f"),zo(this,Pd,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return zo(this,vm,"f")}get collection(){return zo(this,Pd,"f")}dispatchChange(){zo(this,_d,"f").notify()}subscribeChanges(e){return zo(this,_d,"f").subscribe(e)}terminate(){zo(this,Rl,"f").terminate()}};vm=new WeakMap,Rl=new WeakMap,_d=new WeakMap,Pd=new WeakMap;var ht=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},G=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Tr,Sd,mn,je,Ed,Bd,Fd,Ol,Nd,kd,rs,Vl,zl,Ul,jl,Ll,ii,Uo=class r{constructor(e,t){Tr.add(this),this.type="audio-region",Sd.set(this,void 0),mn.set(this,void 0),je.set(this,void 0),Ed.set(this,void 0),Bd.set(this,void 0),Fd.set(this,void 0),Ol.set(this,void 0),Nd.set(this,void 0),kd.set(this,void 0),rs.set(this,g.None),Vl.set(this,L.Empty),zl.set(this,L.Empty),Ul.set(this,L.Empty),jl.set(this,L.Empty),Ll.set(this,void 0),ht(this,mn,e,"f"),ht(this,je,t,"f"),ht(this,Sd,new z,"f");let{timeBase:i,position:n,duration:o,loopOffset:a,loopDuration:s}=t;ht(this,Ed,yo.aware(e.tempoMap,i,n,o),"f"),ht(this,Bd,yo.aware(e.tempoMap,i,n,a),"f"),ht(this,Fd,yo.aware(e.tempoMap,i,n,s),"f"),ht(this,Ol,new Qr,"f"),ht(this,Nd,new te,"f"),ht(this,Ll,!1,"f"),ht(this,kd,!0,"f"),G(this,Sd,"f").ownAll(G(this,je,"f").pointerHub.subscribe({onAdded:()=>G(this,Tr,"m",ii).call(this),onRemoved:()=>G(this,Tr,"m",ii).call(this)}),G(this,je,"f").file.catchupAndSubscribe(l=>{ht(this,rs,l.targetVertex.map(u=>G(this,mn,"f").boxAdapters.adapterFor(u.box,Ti)),"f"),G(this,Vl,"f").terminate(),ht(this,Vl,G(this,rs,"f").mapOr(u=>u.getOrCreateLoader().subscribe(()=>G(this,Tr,"m",ii).call(this)),L.Empty),"f")}),G(this,je,"f").playMode.catchupAndSubscribe(({targetVertex:l})=>{G(this,zl,"f").terminate(),l.match({none:()=>G(this,Ol,"f").clear(),some:({box:u})=>{let p=G(this,mn,"f").boxAdapters.adapterFor(u,dn.isAudioPlayMode);ht(this,zl,p.subscribe(()=>G(this,Tr,"m",ii).call(this)),"f"),G(this,Ol,"f").wrap(p)}})}),G(this,je,"f").timeBase.catchupAndSubscribe(l=>{G(this,Ul,"f").terminate(),qr(l.getValue(),rr)===rr.Seconds&&ht(this,Ul,e.tempoMap.subscribe(()=>G(this,Tr,"m",ii).call(this)),"f")}),G(this,je,"f").subscribe(Fe.Children,l=>{if(!this.trackBoxAdapter.isEmpty()&&(l.type==="primitive"||l.type==="pointer")){let u=this.trackBoxAdapter.unwrap();G(this,je,"f").position.address.equals(l.address)?(u.regions.onIndexingChanged(),G(this,Tr,"m",ii).call(this)):G(this,Tr,"m",ii).call(this)}}),G(this,je,"f").events.catchupAndSubscribe(({targetVertex:l})=>{G(this,jl,"f").terminate(),ht(this,jl,l.match({none:()=>L.Empty,some:({box:u})=>G(this,mn,"f").boxAdapters.adapterFor(u,nr).subscribeChange(()=>G(this,Tr,"m",ii).call(this))}),"f"),G(this,Tr,"m",ii).call(this)})),ht(this,kd,!1,"f")}subscribeChange(e){return G(this,Nd,"f").subscribe(e)}accept(e){return _(e.visitAudioRegionBoxAdapter,this)}onSelected(){ht(this,Ll,!0,"f"),G(this,Tr,"m",ii).call(this)}onDeselected(){ht(this,Ll,!1,"f"),G(this,Tr,"m",ii).call(this)}get isSelected(){return G(this,Ll,"f")}get box(){return G(this,je,"f")}get uuid(){return G(this,je,"f").address.uuid}get address(){return G(this,je,"f").address}get position(){return G(this,je,"f").position.getValue()}get duration(){return G(this,Ed,"f").toPPQN()}get complete(){return this.position+this.duration}get loopOffset(){return G(this,Bd,"f").toPPQN()}get loopDuration(){return G(this,Fd,"f").toPPQN()}get offset(){return this.position-this.loopOffset}get mute(){return G(this,je,"f").mute.getValue()}get hue(){return G(this,je,"f").hue.getValue()}get gain(){return G(this,je,"f").gain}get file(){return G(this,rs,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return G(this,Ol,"f")}get timeBase(){return qr(G(this,je,"f").timeBase.getValue(),rr)}get waveformOffset(){return G(this,je,"f").waveformOffset}get isPlayModeNoWarp(){return G(this,je,"f").playMode.isEmpty()}get asPlayModePitch(){return this.observableOptPlayMode.map(e=>De(e,pn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>De(e,hn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>dn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(G(this,rs,"f").isEmpty())return"No Audio File";let e=G(this,rs,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):G(this,je,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get trackBoxAdapter(){return G(this,je,"f").regions.targetVertex.map(e=>G(this,mn,"f").boxAdapters.adapterFor(e.box,pt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return G(this,je,"f").events.targetVertex.map(e=>G(this,mn,"f").boxAdapters.adapterFor(e.box,nr))}set position(e){G(this,je,"f").position.setValue(e)}set duration(e){G(this,Ed,"f").fromPPQN(e)}set loopOffset(e){G(this,Bd,"f").fromPPQN(e)}set loopDuration(e){G(this,Fd,"f").fromPPQN(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners,n=G(this,mn,"f").boxAdapters.adapterFor(Eo.create(G(this,mn,"f").boxGraph,A.generate(),o=>{o.timeBase.setValue(G(this,je,"f").timeBase.getValue()),o.position.setValue(e?.position??G(this,je,"f").position.getValue()),o.regions.refer(e?.track??G(this,je,"f").regions.targetVertex.unwrap()),o.file.refer(G(this,je,"f").file.targetVertex.unwrap()),o.events.refer(i),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),G(this,je,"f").playMode.ifVertex(a=>o.playMode.refer(a.box))}),r);return n.duration=e?.duration??this.duration,n.loopOffset=e?.loopOffset??this.loopOffset,n.loopDuration=e?.loopDuration??this.loopDuration,n}consolidate(){}canFlatten(e){return!1}flatten(e){return g.None}terminate(){G(this,Vl,"f").terminate(),ht(this,Vl,L.Empty,"f"),G(this,Ul,"f").terminate(),ht(this,Ul,L.Empty,"f"),G(this,zl,"f").terminate(),ht(this,zl,L.Empty,"f"),G(this,jl,"f").terminate(),ht(this,jl,L.Empty,"f"),G(this,Sd,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${A.toString(G(this,je,"f").address.uuid)}}`}};Sd=new WeakMap,mn=new WeakMap,je=new WeakMap,Ed=new WeakMap,Bd=new WeakMap,Fd=new WeakMap,Ol=new WeakMap,Nd=new WeakMap,kd=new WeakMap,rs=new WeakMap,Vl=new WeakMap,zl=new WeakMap,Ul=new WeakMap,jl=new WeakMap,Ll=new WeakMap,Tr=new WeakSet,ii=function(){G(this,kd,"f")||(G(this,Nd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var Yn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},de=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},gn,xm,vn,Qe,Id,$d,Kl,Md,Xn,jo=class r{constructor(e,t){gn.add(this),this.type="note-region",xm.set(this,new z),vn.set(this,void 0),Qe.set(this,void 0),Id.set(this,void 0),$d.set(this,void 0),Kl.set(this,void 0),Md.set(this,L.Empty),Yn(this,vn,e,"f"),Yn(this,Qe,t,"f"),Yn(this,Id,new te,"f"),Yn(this,Kl,!1,"f"),Yn(this,$d,!0,"f"),de(this,xm,"f").ownAll(de(this,Qe,"f").pointerHub.subscribe({onAdded:()=>de(this,gn,"m",Xn).call(this),onRemoved:()=>de(this,gn,"m",Xn).call(this)}),de(this,Qe,"f").subscribe(Fe.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();de(this,Qe,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),de(this,gn,"m",Xn).call(this)):de(this,gn,"m",Xn).call(this)}}),de(this,Qe,"f").events.catchupAndSubscribe(({targetVertex:i})=>{de(this,Md,"f").terminate(),Yn(this,Md,i.match({none:()=>L.Empty,some:({box:n})=>de(this,vn,"f").boxAdapters.adapterFor(n,ti).subscribeChange(()=>de(this,gn,"m",Xn).call(this))}),"f"),de(this,gn,"m",Xn).call(this)})),Yn(this,$d,!1,"f")}set position(e){de(this,Qe,"f").position.setValue(e)}set duration(e){de(this,Qe,"f").duration.setValue(e)}set loopOffset(e){de(this,Qe,"f").loopOffset.setValue(e)}set loopDuration(e){de(this,Qe,"f").loopDuration.setValue(e)}subscribeChange(e){return de(this,Id,"f").subscribe(e)}accept(e){return _(e.visitNoteRegionBoxAdapter,this)}onSelected(){Yn(this,Kl,!0,"f"),de(this,gn,"m",Xn).call(this)}onDeselected(){Yn(this,Kl,!1,"f"),de(this,gn,"m",Xn).call(this)}get isSelected(){return de(this,Kl,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let i=t.unwrap(),n=Kt.globalToLocal(this,e);for(let o of i.events.iterateFrom(n-i.maxDuration)){if(n<o.position)return;n<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){de(this,Md,"f").terminate(),de(this,xm,"f").terminate()}get box(){return de(this,Qe,"f")}get uuid(){return de(this,Qe,"f").address.uuid}get address(){return de(this,Qe,"f").address}get position(){return de(this,Qe,"f").position.getValue()}get duration(){return de(this,Qe,"f").duration.getValue()}get loopOffset(){return de(this,Qe,"f").loopOffset.getValue()}get loopDuration(){return de(this,Qe,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return de(this,Qe,"f").mute.getValue()}get hue(){return de(this,Qe,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return de(this,Qe,"f").events.targetVertex.map(e=>de(this,vn,"f").boxAdapters.adapterFor(e.box,ti))}get label(){return de(this,Qe,"f").label.getValue()}get trackBoxAdapter(){return de(this,$d,"f")?g.None:de(this,Qe,"f").regions.targetVertex.map(e=>de(this,vn,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return de(this,vn,"f").boxAdapters.adapterFor(Ca.create(de(this,vn,"f").boxGraph,A.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??de(this,Qe,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=de(this,vn,"f").boxGraph,i=Wn.create(t,A.generate());e.events.asArray().forEach(n=>n.copyTo({events:i.events})),de(this,Qe,"f").events.refer(i.owners)})}canFlatten(e){return e.length>0&&O.satisfy(e,(t,i)=>t.trackBoxAdapter.contains(i.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return g.None;let t=de(this,vn,"f").boxGraph,i=e.toSorted(vo.Comparator),n=O.getFirst(i,"Internal error (no first)"),o=O.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,l=n.trackBoxAdapter.unwrap(),u=Wn.create(t,A.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of Kt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),F=Math.floor(m-y);for(let D of f.optCollection.unwrap().events.iterateRange(x,F))D.copyTo({position:D.position+y-n.position,events:u.events})}}),p.forEach(({box:d})=>d.delete()),g.wrap(Ca.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(u.owners),d.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${A.toString(de(this,Qe,"f").address.uuid)} p: ${Y.toString(this.position)}, c: ${Y.toString(this.complete)}}`}};xm=new WeakMap,vn=new WeakMap,Qe=new WeakMap,Id=new WeakMap,$d=new WeakMap,Kl=new WeakMap,Md=new WeakMap,gn=new WeakSet,Xn=function(){de(this,Id,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var eo=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},le=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Oi,Wl,yn,Ye,Td,Zl,Dd,Cd,xn,to=class r{constructor(e,t){Oi.add(this),this.type="value-region",Wl.set(this,new z),yn.set(this,void 0),Ye.set(this,void 0),Td.set(this,void 0),Zl.set(this,void 0),Dd.set(this,void 0),Cd.set(this,L.Empty),eo(this,yn,e,"f"),eo(this,Ye,t,"f"),eo(this,Dd,!0,"f"),eo(this,Td,new te,"f"),eo(this,Zl,!1,"f"),le(this,Wl,"f").own(le(this,Ye,"f").pointerHub.subscribe({onAdded:()=>le(this,Oi,"m",xn).call(this),onRemoved:()=>le(this,Oi,"m",xn).call(this)})),le(this,Wl,"f").own(le(this,Ye,"f").subscribe(Fe.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();le(this,Ye,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),le(this,Oi,"m",xn).call(this)):le(this,Oi,"m",xn).call(this)}})),le(this,Wl,"f").own(le(this,Ye,"f").events.catchupAndSubscribe(({targetVertex:i})=>{le(this,Cd,"f").terminate(),eo(this,Cd,i.match({none:()=>L.Empty,some:({box:n})=>le(this,yn,"f").boxAdapters.adapterFor(n,nr).subscribeChange(()=>le(this,Oi,"m",xn).call(this))}),"f"),le(this,Oi,"m",xn).call(this)})),eo(this,Dd,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(Kt.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let i=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?i.valueAt(this.loopDuration,e):i.valueAt(Kt.globalToLocal(this,this.complete),e)}subscribeChange(e){return le(this,Td,"f").subscribe(e)}accept(e){return _(e.visitValueRegionBoxAdapter,this)}onSelected(){eo(this,Zl,!0,"f"),le(this,Oi,"m",xn).call(this)}onDeselected(){eo(this,Zl,!1,"f"),le(this,Oi,"m",xn).call(this)}get isSelected(){return le(this,Zl,"f")}onValuesPropertyChanged(){le(this,Oi,"m",xn).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){le(this,Cd,"f").terminate(),le(this,Wl,"f").terminate()}get box(){return le(this,Ye,"f")}get uuid(){return le(this,Ye,"f").address.uuid}get address(){return le(this,Ye,"f").address}get position(){return le(this,Ye,"f").position.getValue()}get duration(){return le(this,Ye,"f").duration.getValue()}get loopOffset(){return le(this,Ye,"f").loopOffset.getValue()}get loopDuration(){return le(this,Ye,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return le(this,Ye,"f").mute.getValue()}get hue(){return le(this,Ye,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return le(this,Ye,"f").events.targetVertex.map(e=>le(this,yn,"f").boxAdapters.adapterFor(e.box,nr))}get label(){return le(this,Ye,"f").label.getValue()}get trackBoxAdapter(){return le(this,Dd,"f")?g.None:le(this,Ye,"f").regions.targetVertex.map(e=>le(this,yn,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}set position(e){le(this,Ye,"f").position.setValue(e)}set duration(e){le(this,Ye,"f").duration.setValue(e)}set loopOffset(e){le(this,Ye,"f").loopOffset.setValue(e)}set loopDuration(e){le(this,Ye,"f").loopDuration.setValue(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return le(this,yn,"f").boxAdapters.adapterFor(Ta.create(le(this,yn,"f").boxGraph,A.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??le(this,Ye,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=le(this,yn,"f").boxGraph,i=Zn.create(t,A.generate());e.asArray().forEach(n=>n.copyTo({events:i.events})),le(this,Ye,"f").events.refer(i.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return g.None;let t=le(this,yn,"f").boxGraph,i=e.toSorted(vo.Comparator),n=O.getFirst(i,"Internal error (no first)"),o=O.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,l=n.trackBoxAdapter.unwrap(),u=Zn.create(t,A.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of Kt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),F=Math.floor(m-y);for(let D of f.events.unwrap().iterateRange(x,F));}}),p.forEach(({box:d})=>d.delete()),g.wrap(Ta.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(u.owners),d.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${A.toString(le(this,Ye,"f").address.uuid)} p: ${Y.toString(this.position)}, c: ${Y.toString(this.complete)}}`}};Wl=new WeakMap,yn=new WeakMap,Ye=new WeakMap,Td=new WeakMap,Zl=new WeakMap,Dd=new WeakMap,Cd=new WeakMap,Oi=new WeakSet,xn=function(){le(this,Td,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var EP=(r,e)=>r.position-e.position,BP={for:(r,e)=>X(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,jo),visitAudioRegionBox:t=>r.adapterFor(t,Uo),visitValueRegionBox:t=>r.adapterFor(t,to)}),"")};var Gl=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Tt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Rd,is,Od,ql,ns,Hl,wm=class{constructor(e,t){Rd.set(this,void 0),is.set(this,void 0),Od.set(this,void 0),ql.set(this,void 0),ns.set(this,void 0),Hl.set(this,void 0),Gl(this,Rd,e,"f"),Gl(this,is,new z,"f"),Gl(this,Od,Tt(this,is,"f").own(new te),"f"),Gl(this,ql,Tt(this,is,"f").own(new Bt),"f"),Gl(this,ns,vo.create(EP),"f"),Gl(this,Hl,A.newSet(i=>i.uuid),"f"),Tt(this,is,"f").ownAll(Tt(this,Rd,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=BP.for(t,i),o=Tt(this,Hl,"f").add(n);I(o,`Cannot add ${i}`),Tt(this,ns,"f").add(n),Tt(this,ql,"f").forEach(a=>a.onAdded(n)),this.dispatchChange()},onRemoved:({box:{address:{uuid:i}}})=>{let n=Tt(this,Hl,"f").removeByKey(i);Tt(this,ns,"f").remove(n),Tt(this,ql,"f").forEach(o=>o.onRemoved(n)),this.dispatchChange()}},c.RegionCollection))}get trackBoxAdapter(){return Tt(this,Rd,"f")}get collection(){return Tt(this,ns,"f")}get adapters(){return Tt(this,Hl,"f")}onIndexingChanged(){Tt(this,ns,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),Tt(this,ql,"f").subscribe(e)}subscribeChanges(e){return Tt(this,Od,"f").subscribe(e)}dispatchChange(){Tt(this,Od,"f").notify()}terminate(){Tt(this,is,"f").terminate()}};Rd=new WeakMap,is=new WeakMap,Od=new WeakMap,ql=new WeakMap,ns=new WeakMap,Hl=new WeakMap;var re;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(re||(re={}));(function(r){r.toLabelString=e=>{switch(e){case r.Audio:return"Audio";case r.Notes:return"Notes";case r.Value:return"Automation";case r.Undefined:default:return"N/A"}},r.toIconSymbol=e=>{switch(e){case r.Audio:return $e.Waveform;case r.Notes:return $e.Piano;case r.Value:return $e.Automation;case r.Undefined:return $e.AudioBus;default:return $e.Unknown}}})(re||(re={}));var bm;(function(r){r.isDeviceBox=e=>"host"in e&&De(e.host,B)&&"label"in e&&De(e.label,C)&&"enabled"in e&&De(e.enabled,M)&&"minimized"in e&&De(e.minimized,M),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===c.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&De(e.index,E)&&(e.host.pointerType===c.MidiEffectHost||e.host.pointerType===c.AudioEffectHost),r.lookupHostField=e=>Z(e)&&"host"in e&&De(e.host,B)?e.host:N(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>Z(e)&&"label"in e&&De(e.label,C)?e.label:N(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>Z(e)&&"enabled"in e&&De(e.enabled,M)?e.enabled:N(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>Z(e)&&"minimized"in e&&De(e.minimized,M)?e.minimized:N(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>Z(e)&&"index"in e&&De(e.index,E)?e.index:N(`Could not find 'index' field in '${e?.name}'`)})(bm||(bm={}));var FP;(function(r){r.toTrackType=e=>{switch(e){case"midi":return re.Notes;case"audio":return re.Audio;default:return N()}}})(FP||(FP={}));var ie;(function(r){r.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),r.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),r.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",r.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",r.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",r.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",r.deleteEffectDevices=e=>{if(e.length===0)return;I(O.satisfy(e,(n,o)=>n.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(c.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(c.MidiEffectHost):N("unknown type")).map(({box:n})=>bm.lookupIndexField(n)).filter(n=>e.some(o=>A.Comparator(o.uuid,n.address.uuid)!==0)).sort((n,o)=>n.getValue()-o.getValue()).forEach((n,o)=>n.setValue(o)),e.forEach(n=>n.box.delete())}})(ie||(ie={}));var Am=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ut=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vd,_m,Vi,os,Pm,Sm=class{constructor(e,t){Vd.set(this,void 0),_m.set(this,new te),Vi.set(this,void 0),os.set(this,void 0),Pm.set(this,void 0),Am(this,Vd,e,"f"),Am(this,Vi,Ot.create(e.box.tracks,i=>t.adapterFor(i,pt),c.TrackCollection),"f"),Am(this,os,A.newSet(({uuid:i})=>i),"f"),Am(this,Pm,Ut(this,Vi,"f").catchupAndSubscribe({onAdd:i=>Ut(this,os,"f").add({uuid:i.uuid,subscription:i.regions.subscribeChanges(()=>Ut(this,_m,"f").notify())}),onRemove:({uuid:i})=>Ut(this,os,"f").removeByKey(i).subscription.terminate(),onReorder:i=>{}}),"f")}create(e,t,i){let n=Ut(this,Vd,"f").box.graph,o=Ut(this,Vd,"f").box.tracks;ir.create(n,A.generate(),a=>{a.index.setValue(i??Ut(this,Vi,"f").getMinFreeIndex()),a.type.setValue(e),a.tracks.refer(o),a.target.refer(t)})}controls(e){return g.wrap(Ut(this,Vi,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=Ut(this,Vi,"f").adapters(),i=t.indexOf(e);if(i===-1)return N(`Cannot delete ${e}. Does not exist.`);for(let n=i+1;n<t.length;n++)t[n].indexField.setValue(n-1);e.box.delete()}get collection(){return Ut(this,Vi,"f")}values(){return Ut(this,Vi,"f").adapters()}catchupAndSubscribe(e){return Ut(this,Vi,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Ut(this,_m,"f").subscribe(e)}terminate(){Ut(this,Vi,"f").terminate(),Ut(this,Pm,"f").terminate(),Ut(this,os,"f").forEach(({subscription:e})=>e.terminate()),Ut(this,os,"f").clear()}};Vd=new WeakMap,_m=new WeakMap,Vi=new WeakMap,os=new WeakMap,Pm=new WeakMap;var NP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},zi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Em,Rr,sr=class{constructor(e,t){this.type="bus",this.accepts="audio",Em.set(this,void 0),Rr.set(this,void 0),NP(this,Em,e,"f"),NP(this,Rr,t,"f")}catchupAndSubscribe(e){return e(this),zi(this,Rr,"f").subscribe(Fe.Children,()=>e(this))}get uuid(){return zi(this,Rr,"f").address.uuid}get address(){return zi(this,Rr,"f").address}get box(){return zi(this,Rr,"f")}get enabledField(){return zi(this,Rr,"f").enabled}get minimizedField(){return zi(this,Rr,"f").minimized}get iconField(){return zi(this,Rr,"f").icon}get labelField(){return zi(this,Rr,"f").label}get colorField(){return zi(this,Rr,"f").color}get iconSymbol(){return $e.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return zi(this,Em,"f").boxAdapters.adapterFor(zi(this,Rr,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}toString(){return`{${this.constructor.name}}`}};Em=new WeakMap,Rr=new WeakMap;var zd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ut=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ro,Jl,Ql,ni,Ud,Bm=class{constructor(e,t){ro.set(this,void 0),Jl.set(this,void 0),Ql.set(this,void 0),ni.set(this,void 0),Ud.set(this,L.Empty),zd(this,ro,new z,"f"),zd(this,Jl,ut(this,ro,"f").own(new te),"f"),zd(this,Ql,ut(this,ro,"f").own(new Ir($e.Unknown)),"f"),zd(this,ni,ut(this,ro,"f").own(new Ir(g.None)),"f"),ut(this,ro,"f").own(ut(this,ni,"f").subscribe(i=>{ut(this,Ud,"f").terminate(),zd(this,Ud,i.getValue().match({none:()=>(ut(this,Jl,"f").notify(g.None),L.Empty),some:({labelField:n,iconField:o})=>L.many(o.catchupAndSubscribe(a=>ut(this,Ql,"f").setValue($e.fromName(a.getValue()))),n.catchupAndSubscribe(a=>ut(this,Jl,"f").notify(g.wrap(a.getValue()))))}),"f")})),ut(this,ro,"f").own(e.catchupAndSubscribe({onAdded:({box:i})=>{I(ut(this,ni,"f").getValue().isEmpty(),"Already set");let n=i instanceof Ii?t.adapterFor(i,sr):t.adapterFor(i,ie.isInstrument);ut(this,ni,"f").getValue().unwrapOrNull()!==n&&ut(this,ni,"f").setValue(g.wrap(n))},onRemoved:({box:i})=>{I(ut(this,ni,"f").getValue().unwrap("Cannot remove").box.address.equals(i.address),"Unexpected value to remove"),ut(this,ni,"f").setValue(g.None)}},c.InstrumentHost,c.AudioOutput))}getValue(){return ut(this,ni,"f").getValue()}subscribe(e){return ut(this,ni,"f").subscribe(e)}catchupAndSubscribe(e){return e(ut(this,ni,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),ut(this,Jl,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return ut(this,Ql,"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 ut(this,Ql,"f")}terminate(){ut(this,ro,"f").terminate(),ut(this,Ud,"f").terminate()}};ro=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,ni=new WeakMap,Ud=new WeakMap;var kP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},as=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Fm,io,pe=class{constructor(e){Fm.set(this,void 0),io.set(this,void 0),kP(this,Fm,e,"f"),kP(this,io,we.newSet(t=>t.address),"f")}terminate(){as(this,io,"f").forEach(e=>e.terminate()),as(this,io,"f").clear()}parameters(){return as(this,io,"f").values()}parameterAt(e){return as(this,io,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,i,n,o){let a=new ss(as(this,Fm,"f"),e,t,i,n,o),s=as(this,io,"f").add(a);return I(s,`Could not add adapter for ${e}`),a}removeParameter(e){return as(this,io,"f").removeByKey(e)}};Fm=new WeakMap,io=new WeakMap;var ls=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},et=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},us,oi,Lo,Yl,Nm,km,jd,Xl=class{constructor(e,t){us.set(this,void 0),oi.set(this,void 0),Lo.set(this,void 0),Yl.set(this,void 0),Nm.set(this,void 0),km.set(this,void 0),jd.set(this,L.Empty),ls(this,us,e,"f"),ls(this,oi,t,"f"),ls(this,Lo,new z,"f"),ls(this,Yl,et(this,Lo,"f").own(new te),"f"),et(this,Lo,"f").own(t.targetBus.catchupAndSubscribe(()=>{et(this,jd,"f").terminate(),ls(this,jd,this.optTargetBus.match({none:()=>(et(this,Yl,"f").notify(g.None),L.Empty),some:i=>i.catchupAndSubscribe(n=>et(this,Yl,"f").notify(g.wrap(n)))}),"f")})),ls(this,Nm,et(this,Lo,"f").own(new ss(et(this,us,"f"),et(this,oi,"f").sendPan,S.bipolar(),P.percent({unit:"%",fractionDigits:0}),"panning")),"f"),ls(this,km,et(this,Lo,"f").own(new ss(et(this,us,"f"),et(this,oi,"f").sendGain,S.DefaultDecibel,P.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),et(this,Yl,"f").subscribe(e)}get uuid(){return et(this,oi,"f").address.uuid}get address(){return et(this,oi,"f").address}get box(){return et(this,oi,"f")}get indexField(){return et(this,oi,"f").index}get sendPan(){return et(this,Nm,"f")}get sendGain(){return et(this,km,"f")}get targetBus(){return et(this,us,"f").boxAdapters.adapterFor(et(this,oi,"f").targetBus.targetVertex.unwrap("no audioUnit").box,sr)}get optTargetBus(){return et(this,oi,"f").targetBus.targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>et(this,us,"f").boxAdapters.adapterFor(t,sr)})))}delete(){et(this,oi,"f").delete()}terminate(){et(this,Lo,"f").terminate(),et(this,jd,"f").terminate()}};us=new WeakMap,oi=new WeakMap,Lo=new WeakMap,Yl=new WeakMap,Nm=new WeakMap,km=new WeakMap,jd=new WeakMap;var Ld=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},wn=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},$m,Mm,eu,tu,Kd,Im=class{constructor(e,t){$m.set(this,void 0),Mm.set(this,void 0),eu.set(this,void 0),tu.set(this,void 0),Kd.set(this,L.Empty),Ld(this,$m,e,"f"),Ld(this,Mm,t,"f"),Ld(this,eu,new z,"f"),Ld(this,tu,wn(this,eu,"f").own(new te),"f"),wn(this,eu,"f").own(e.catchupAndSubscribe(()=>{wn(this,Kd,"f").terminate(),Ld(this,Kd,this.adapter.match({none:()=>(wn(this,tu,"f").notify(g.None),L.Empty),some:i=>i.catchupAndSubscribe(n=>wn(this,tu,"f").notify(g.wrap(n)))}),"f")}))}subscribe(e){return wn(this,tu,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return wn(this,$m,"f").targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>wn(this,Mm,"f").adapterFor(t,sr)})))}terminate(){wn(this,eu,"f").terminate(),wn(this,Kd,"f").terminate()}};$m=new WeakMap,Mm=new WeakMap,eu=new WeakMap,tu=new WeakMap,Kd=new WeakMap;var no=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ae=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Dm,$P,bn,Or,ft,ds,ru,cs,Cm,Tm,Rm,Om,MP,IP,ai=class{constructor(e,t){Dm.add(this),this.class="device-host",bn.set(this,new z),Or.set(this,void 0),ft.set(this,void 0),ds.set(this,void 0),ru.set(this,void 0),cs.set(this,void 0),Cm.set(this,void 0),Tm.set(this,void 0),Rm.set(this,void 0),Om.set(this,void 0),no(this,Or,e,"f"),no(this,ft,t,"f"),no(this,ds,ae(this,bn,"f").own(new pe(ae(this,Or,"f"))),"f"),no(this,ru,ae(this,bn,"f").own(new Sm(this,ae(this,Or,"f").boxAdapters)),"f"),no(this,cs,ae(this,bn,"f").own(new Bm(ae(this,ft,"f").input.pointerHub,ae(this,Or,"f").boxAdapters)),"f"),no(this,Cm,ae(this,bn,"f").own(Ot.create(ae(this,ft,"f").midiEffects,i=>ae(this,Or,"f").boxAdapters.adapterFor(i,ie.isMidiEffect),c.MidiEffectHost)),"f"),no(this,Tm,ae(this,bn,"f").own(Ot.create(ae(this,ft,"f").audioEffects,i=>ae(this,Or,"f").boxAdapters.adapterFor(i,ie.isAudioEffect),c.AudioEffectHost)),"f"),no(this,Rm,ae(this,bn,"f").own(Ot.create(ae(this,ft,"f").auxSends,i=>ae(this,Or,"f").boxAdapters.adapterFor(i,Xl),c.AuxSend)),"f"),no(this,Om,ae(this,bn,"f").own(new Im(ae(this,ft,"f").output,ae(this,Or,"f").boxAdapters)),"f"),this.namedParameter=ae(this,Dm,"m",MP).call(this,t),ae(this,Dm,"m",IP).call(this)}get box(){return ae(this,ft,"f")}get uuid(){return ae(this,ft,"f").address.uuid}get address(){return ae(this,ft,"f").address}get indexField(){return ae(this,ft,"f").index}get type(){return ae(this,ft,"f").type.getValue()}get captureBox(){return ae(this,ft,"f").capture.targetVertex}get tracks(){return ae(this,ru,"f")}get input(){return ae(this,cs,"f")}get midiEffects(){return ae(this,Cm,"f")}get audioEffects(){return ae(this,Tm,"f")}get inputAdapter(){return ae(this,cs,"f").getValue()}get auxSends(){return ae(this,Rm,"f")}get output(){return ae(this,Om,"f")}get isBus(){return this.input.getValue().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.getValue().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return ae(this,ft,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ae(this,Or,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return ae(this,ft,"f").midiEffects}get inputField(){return ae(this,ft,"f").input}get audioEffectsField(){return ae(this,ft,"f").audioEffects}get tracksField(){return ae(this,ft,"f").tracks}get minimizedField(){return ae(this,cs,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return ae(this,cs,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}indicesLimit(){let e=ae(this,Or,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),i=this.type,n=t,o=t;for(;n>0&&e[n-1].type===i;)n--;for(;o<e.length-1&&e[o+1].type===i;)o++;return[n,o+1]}move(e){ae(this,Or,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){ae(this,ru,"f").collection.move(e,t)}deleteTrack(e){ae(this,ru,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ae(this,bn,"f").terminate()}};$P=ai,bn=new WeakMap,Or=new WeakMap,ft=new WeakMap,ds=new WeakMap,ru=new WeakMap,cs=new WeakMap,Cm=new WeakMap,Tm=new WeakMap,Rm=new WeakMap,Om=new WeakMap,Dm=new WeakSet,MP=function(e){return{volume:ae(this,ds,"f").createParameter(e.volume,$P.VolumeMapper,P.decible,"volume"),panning:ae(this,ds,"f").createParameter(e.panning,S.bipolar(),P.panning,"panning",.5),mute:ae(this,ds,"f").createParameter(e.mute,S.bool,P.bool,"mute"),solo:ae(this,ds,"f").createParameter(e.solo,S.bool,P.bool,"solo")}},IP=function(){let e=this.address.toString(),t=ae(this,ft,"f").capture.targetAddress.unwrapOrUndefined(),i=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ae(this,ft,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;I(this.type!==bt.Instrument||ae(this,ft,"f").capture.targetAddress.nonEmpty(),i)};ai.VolumeMapper=S.decibel(-96,-9,6);var iu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ze=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vm,Ko,lr,ps,zm,Um,Wd,DP,CP,pt=class{constructor(e,t){Vm.add(this),Ko.set(this,void 0),lr.set(this,void 0),ps.set(this,void 0),zm.set(this,void 0),Um.set(this,void 0),Wd.set(this,void 0),iu(this,Ko,e,"f"),iu(this,lr,t,"f"),iu(this,ps,new z,"f"),iu(this,zm,Ze(this,ps,"f").own(new ym(this,e.boxAdapters)),"f"),iu(this,Um,Ze(this,ps,"f").own(new wm(this,e.boxAdapters)),"f"),iu(this,Wd,Ze(this,ps,"f").own(new Ir(-1)),"f")}catchupAndSubscribePath(e){let t=[g.None,g.None],i=()=>{t.every(n=>n.nonEmpty())?e(g.wrap(t.map(n=>n.unwrap()))):e(g.None)};return L.many(Ze(this,Vm,"m",DP).call(this,n=>{t[0].equals(n)||(t[0]=n,i())}),Ze(this,Vm,"m",CP).call(this,n=>{t[1].equals(n)||(t[1]=n,i())}))}set targetDeviceName(e){Ze(this,lr,"f").target.targetVertex.ifSome(t=>{let i=t.box;if(i instanceof Xe)return Ze(this,Ko,"f").boxAdapters.adapterFor(i,ai).input.getValue().ifSome(({labelField:o})=>o.setValue(e));if("label"in i&&i.label instanceof C)return i.label.setValue(e)})}get targetDeviceName(){return Ze(this,lr,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof Xe?Ze(this,Ko,"f").boxAdapters.adapterFor(t,ai).input.label:"label"in t&&t.label instanceof C?g.wrap(t.label.getValue()):g.wrap(t.name)})}terminate(){Ze(this,ps,"f").terminate()}get audioUnit(){return Be(Ze(this,lr,"f").tracks.targetVertex.unwrap().box,Xe)}get target(){return Ze(this,lr,"f").target}get clips(){return Ze(this,zm,"f")}get regions(){return Ze(this,Um,"f")}get enabled(){return Ze(this,lr,"f").enabled}get indexField(){return Ze(this,lr,"f").index}get type(){return Ze(this,lr,"f").type.getValue()}get box(){return Ze(this,lr,"f")}get uuid(){return Ze(this,lr,"f").address.uuid}get address(){return Ze(this,lr,"f").address}get listIndex(){return Ze(this,Wd,"f").getValue()}set listIndex(e){Ze(this,Wd,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===re.Audio;case"note-clip":return this.type===re.Notes;case"value-clip":return this.type===re.Value;case"audio-region":return this.type===re.Audio;case"note-region":return this.type===re.Notes;case"value-region":return this.type===re.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let i=t,n=Ze(this,Ko,"f").clipSequencing.iterate(this.uuid,e,e+tf);for(let{optClip:o,sectionFrom:a}of n)i=o.match({none:()=>{let s=this.regions.collection.lowerEqual(e,l=>!l.mute);if(s===null){let l=this.regions.collection.optAt(0);return De(l,to)?l.incomingValue(t):t}else if(De(s,to))return e<s.complete?s.valueAt(e,t):s.outgoingValue(t);return t},some:s=>a===e&&De(s,Co)?s.valueAt(e,t):t});return i}};Ko=new WeakMap,lr=new WeakMap,ps=new WeakMap,zm=new WeakMap,Um=new WeakMap,Wd=new WeakMap,Vm=new WeakSet,DP=function(e){let t=Ze(this,lr,"f").target.targetVertex;if(t.nonEmpty()){let i=t.unwrap().box;return i instanceof Xe?Ze(this,Ko,"f").boxAdapters.adapterFor(i,ai).input.catchupAndSubscribeLabelChange(o=>e(o)):"label"in i&&i.label instanceof C?i.label.catchupAndSubscribe(n=>e(g.wrap(n.getValue()))):(e(g.wrap(i.name)),L.Empty)}return e(g.None),L.Empty},CP=function(e){let t=this.type;switch(t){case re.Audio:case re.Notes:return e(g.wrap(re[t])),L.Empty;case re.Value:{let i=Ze(this,lr,"f").target.targetVertex.unwrap();if(i.isField())e(Ze(this,Ko,"f").parameterFieldAdapters.opt(i.address).map(n=>n.name));else if(i.isBox())e(g.wrap(i.name));else return N("Illegal State. Vertex is not a field nor box.");return L.Empty}case re.Undefined:return e(g.wrap("")),L.Empty;default:return e(g.None),L.Empty}};var jt=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ue=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Wo,Vr,Zo,hs,jm,Lm,fs,ms,Go,qo,gs,nu,Zd,TP=[c.Automation,c.Modulation,c.MidiControl,c.ParameterController],ss=class{constructor(e,t,i,n,o,a){Wo.set(this,void 0),Vr.set(this,void 0),Zo.set(this,void 0),hs.set(this,void 0),jm.set(this,void 0),Lm.set(this,void 0),fs.set(this,new z),ms.set(this,void 0),Go.set(this,void 0),qo.set(this,g.None),gs.set(this,g.None),nu.set(this,null),Zd.set(this,!1),jt(this,Wo,e,"f"),jt(this,Vr,t,"f"),jt(this,Zo,i,"f"),jt(this,hs,n,"f"),jt(this,jm,o,"f"),jt(this,Lm,a??0,"f"),ue(this,fs,"f").own(ue(this,Wo,"f").parameterFieldAdapters.register(this)),jt(this,ms,ue(this,fs,"f").own(new te),"f"),jt(this,Go,new Bt,"f"),ue(this,fs,"f").own(ue(this,Vr,"f").subscribe(()=>ue(this,ms,"f").notify(this))),ue(this,fs,"f").own(ue(this,Vr,"f").pointerHub.catchupAndSubscribe({onAdded:s=>{ue(this,Go,"f").proxy.onControlSourceAdd(Lx(s.pointerType)),s.box.accept({visitTrackBox:l=>{I(ue(this,qo,"f").isEmpty(),"Already assigned");let u=ue(this,Wo,"f").boxAdapters.adapterFor(l,pt);jt(this,qo,g.wrap(u),"f"),ue(this,Wo,"f").isMainThread&&jt(this,gs,g.wrap(ue(this,Wo,"f").liveStreamReceiver.subscribeFloat(ue(this,Vr,"f").address,p=>{ue(this,nu,"f")!==p&&(jt(this,nu,p,"f"),ue(this,ms,"f").notify(this))})),"f")}})},onRemoved:s=>{ue(this,Go,"f").proxy.onControlSourceRemove(Lx(s.pointerType)),s.box.accept({visitTrackBox:l=>{I(ue(this,qo,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),jt(this,qo,g.None,"f"),ue(this,Wo,"f").isMainThread&&(ue(this,gs,"f").ifSome(u=>u.terminate()),jt(this,gs,g.None,"f"),jt(this,nu,null,"f"),ue(this,ms,"f").notify(this))}})}},...TP)),t.getValue()!==i.clamp(t.getValue())&&console.warn(`${o} (${t.getValue()}) is out of bounds`,"constraints"in t?t.constraints:"no constraints",i,t.address.fieldKeys.join(", "),t.box.name)}registerMidiControl(){return ue(this,Go,"f").proxy.onControlSourceAdd("midi"),jt(this,Zd,!0,"f"),{terminate:()=>{jt(this,Zd,!1,"f"),ue(this,Go,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ue(this,Vr,"f")}get valueMapping(){return ue(this,Zo,"f")}get stringMapping(){return ue(this,hs,"f")}get name(){return ue(this,jm,"f")}get anchor(){return ue(this,Lm,"f")}get type(){return ue(this,Vr,"f").type}get address(){return ue(this,Vr,"f").address}get track(){return ue(this,qo,"f")}valueAt(e){let t=ue(this,qo,"f");if(t.nonEmpty()){let i=t.unwrap();if(i.enabled)return this.valueMapping.y(i.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return ue(this,ms,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ue(this,Zd,"f")&&e.onControlSourceAdd("midi"),ue(this,Vr,"f").pointerHub.filter(...TP).forEach(t=>e.onControlSourceAdd(Lx(t.pointerType))),ue(this,Go,"f").subscribe(e)}getValue(){return ue(this,Vr,"f").getValue()}setValue(e){ue(this,Vr,"f").setValue(e)}setUnitValue(e){this.setValue(ue(this,Zo,"f").y(e))}getUnitValue(){return ue(this,Zo,"f").x(this.getValue())}getControlledValue(){return ue(this,Zo,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ue(this,nu,"f")??this.getUnitValue()}getControlledPrintValue(){return ue(this,hs,"f").x(this.getControlledValue())}getPrintValue(){return ue(this,hs,"f").x(this.getValue())}setPrintValue(e){let t=ue(this,hs,"f").y(e);t.type==="unitValue"?this.setUnitValue(ce(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ue(this,Zo,"f").clamp(ue(this,Vr,"f").initValue))}terminate(){ue(this,gs,"f").ifSome(e=>e.terminate()),jt(this,gs,g.None,"f"),ue(this,fs,"f").terminate()}};Wo=new WeakMap,Vr=new WeakMap,Zo=new WeakMap,hs=new WeakMap,jm=new WeakMap,Lm=new WeakMap,fs=new WeakMap,ms=new WeakMap,Go=new WeakMap,qo=new WeakMap,gs=new WeakMap,nu=new WeakMap,Zd=new WeakMap;var Lx=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 N(`${r.toString()} is an unknown pointer type`)}};var Kx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ui=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},oo,vs,Km,Wm=class{constructor(e,t,i){oo.set(this,void 0),vs.set(this,void 0),Km.set(this,void 0),Kx(this,oo,A.newSet(n=>n.uuid),"f"),Kx(this,vs,new Bt,"f"),Kx(this,Km,e.catchupAndSubscribe({onAdded:n=>{let o=t(n.box),a=Ui(this,oo,"f").add(o);I(a,`Could not add ${o}`),Ui(this,vs,"f").proxy.onAdd(o)},onRemoved:n=>{let o=n.box.address.uuid;Ui(this,vs,"f").proxy.onRemove(Ui(this,oo,"f").removeByKey(o))}},i),"f")}subscribe(e){return Ui(this,vs,"f").subscribe(e)}catchupAndSubscribe(e){return Ui(this,oo,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return Ui(this,oo,"f").values()}size(){return Ui(this,oo,"f").size()}isEmpty(){return this.size()===0}terminate(){Ui(this,oo,"f").clear(),Ui(this,vs,"f").terminate(),Ui(this,Km,"f").terminate()}};oo=new WeakMap,vs=new WeakMap,Km=new WeakMap;var Wx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Nt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Zx,Zm,Gd,si,An,RP,li=class{constructor(e,t){Zx.add(this),this.type="audio-effect",this.accepts="audio",Gd.set(this,void 0),si.set(this,void 0),An.set(this,void 0),Wx(this,Gd,e,"f"),Wx(this,si,t,"f"),Wx(this,An,new pe(Nt(this,Gd,"f")),"f"),this.namedParameter=Nt(this,Zx,"m",RP).call(this,t)}get box(){return Nt(this,si,"f")}get uuid(){return Nt(this,si,"f").address.uuid}get address(){return Nt(this,si,"f").address}get indexField(){return Nt(this,si,"f").index}get labelField(){return Nt(this,si,"f").label}get enabledField(){return Nt(this,si,"f").enabled}get minimizedField(){return Nt(this,si,"f").minimized}get host(){return Nt(this,si,"f").host}deviceHost(){return Nt(this,Gd,"f").boxAdapters.adapterFor(Nt(this,si,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Nt(this,An,"f").terminate()}};Zm=li,Gd=new WeakMap,si=new WeakMap,An=new WeakMap,Zx=new WeakSet,RP=function(e){return{delay:Nt(this,An,"f").createParameter(e.delay,S.linearInteger(0,Zm.OffsetFractions.length-1),Zm.OffsetStringMapping,"delay"),feedback:Nt(this,An,"f").createParameter(e.feedback,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:Nt(this,An,"f").createParameter(e.cross,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"cross"),filter:Nt(this,An,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:Nt(this,An,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Nt(this,An,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};li.OffsetFractions=er.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();li.OffsetStringMapping=P.indices("",Zm.OffsetFractions.map(([r,e])=>`${r}/${e}`));var Gx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},kt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},qx,qd,ui,_n,OP,ou=class{constructor(e,t){qx.add(this),this.type="audio-effect",this.accepts="audio",qd.set(this,void 0),ui.set(this,void 0),_n.set(this,void 0),Gx(this,qd,e,"f"),Gx(this,ui,t,"f"),Gx(this,_n,new pe(kt(this,qd,"f")),"f"),this.namedParameter=kt(this,qx,"m",OP).call(this,t)}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,qd,"f").boxAdapters.adapterFor(kt(this,ui,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){kt(this,_n,"f").terminate()}};qd=new WeakMap,ui=new WeakMap,_n=new WeakMap,qx=new WeakSet,OP=function(e){return{decay:kt(this,_n,"f").createParameter(e.decay,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:kt(this,_n,"f").createParameter(e.preDelay,S.exponential(.001,.5),P.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:kt(this,_n,"f").createParameter(e.damp,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"damping"),filter:kt(this,_n,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter"),dry:kt(this,_n,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:kt(this,_n,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};var Hx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},gt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Qx,Hd,zr,ji,UP,au=class{constructor(e,t){Qx.add(this),this.type="audio-effect",this.accepts="audio",Hd.set(this,void 0),zr.set(this,void 0),ji.set(this,void 0),Hx(this,Hd,e,"f"),Hx(this,zr,t,"f"),Hx(this,ji,new pe(gt(this,Hd,"f")),"f"),this.namedParameter=gt(this,Qx,"m",UP).call(this,t)}get box(){return gt(this,zr,"f")}get uuid(){return gt(this,zr,"f").address.uuid}get address(){return gt(this,zr,"f").address}get indexField(){return gt(this,zr,"f").index}get labelField(){return gt(this,zr,"f").label}get enabledField(){return gt(this,zr,"f").enabled}get minimizedField(){return gt(this,zr,"f").minimized}get host(){return gt(this,zr,"f").host}get spectrum(){return gt(this,zr,"f").address.append(4095)}deviceHost(){return gt(this,Hd,"f").boxAdapters.adapterFor(gt(this,zr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){gt(this,ji,"f").terminate()}};Hd=new WeakMap,zr=new WeakMap,ji=new WeakMap,Qx=new WeakSet,UP=function(e){return{highPass:VP(gt(this,ji,"f"),e.highPass,"High-Pass"),lowShelf:zP(gt(this,ji,"f"),e.lowShelf,"Low-Shelf"),lowBell:Jx(gt(this,ji,"f"),e.lowBell,"Low-Bell"),midBell:Jx(gt(this,ji,"f"),e.midBell,"Mid-Bell"),highBell:Jx(gt(this,ji,"f"),e.highBell,"High-Bell"),highShelf:zP(gt(this,ji,"f"),e.highShelf,"High-Shelf"),lowPass:VP(gt(this,ji,"f"),e.lowPass,"Low-Pass")}};var Yx=S.exponential(20,2e4),jP=S.linear(-24,24),LP=S.exponential(.01,10),VP=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Yx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,S.linearInteger(0,3),P.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,LP,P.numeric({fractionDigits:3}),`${t} Q`)}),zP=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Yx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,jP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),Jx=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Yx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,jP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,LP,P.numeric({fractionDigits:3}),`${t} Q`)});var KP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},gr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Gm,qm,vr,Ho=class{constructor(e,t){this.type="marker-event",Gm.set(this,new z),qm.set(this,void 0),vr.set(this,void 0),KP(this,qm,e,"f"),KP(this,vr,t,"f"),gr(this,Gm,"f").own(gr(this,vr,"f").subscribe(Fe.Children,i=>{if(!this.trackAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackAdapter.unwrap();gr(this,vr,"f").position.address.equals(i.address)?n.onSortingChanged():n.dispatchChange()}}))}get box(){return gr(this,vr,"f")}get uuid(){return gr(this,vr,"f").address.uuid}get address(){return gr(this,vr,"f").address}get position(){return gr(this,vr,"f").position.getValue()}get plays(){return gr(this,vr,"f").plays.getValue()}get hue(){return gr(this,vr,"f").hue.getValue()}get label(){return gr(this,vr,"f").label.getValue()}get trackAdapter(){return gr(this,vr,"f").track.targetVertex.map(e=>gr(this,qm,"f").boxAdapters.adapterFor(e.box,Pn).markerTrack)}terminate(){gr(this,Gm,"f").terminate()}toString(){return`{MarkerBoxAdapter ${A.toString(gr(this,vr,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Gm=new WeakMap,qm=new WeakMap,vr=new WeakMap;Ho.Comparator=(r,e)=>r.position-e.position;var Jd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ci=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Qd,su,Yd,ys,Hm,Jm=class{constructor(e,t){Qd.set(this,void 0),su.set(this,void 0),Yd.set(this,void 0),ys.set(this,void 0),Hm.set(this,void 0),Jd(this,Qd,e,"f"),Jd(this,su,t,"f"),this.changeNotifier=new te,Jd(this,Yd,A.newSet(i=>i.uuid),"f"),Jd(this,ys,mr.create(Ho.Comparator),"f"),Jd(this,Hm,ci(this,su,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{if(i instanceof cl){let n=ci(this,Qd,"f").boxAdapters.adapterFor(i,Ho),o=ci(this,Yd,"f").add(n);I(o,"Could not add adapter"),ci(this,ys,"f").add(n),this.dispatchChange()}},onRemoved:({box:{address:{uuid:i}}})=>{ci(this,ys,"f").remove(ci(this,Yd,"f").removeByKey(i)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return ci(this,Qd,"f")}get enabled(){return ci(this,su,"f").enabled.getValue()}get events(){return ci(this,ys,"f")}get object(){return ci(this,su,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){ci(this,ys,"f").onIndexingChanged(),this.dispatchChange()}terminate(){ci(this,Hm,"f").terminate()}};Qd=new WeakMap,su=new WeakMap,Yd=new WeakMap,ys=new WeakMap,Hm=new WeakMap;var WP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ao=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Li,Qm,Pn=class{constructor(e,t){Li.set(this,void 0),Qm.set(this,void 0),WP(this,Li,t,"f"),WP(this,Qm,new Jm(e,ao(this,Li,"f").markerTrack),"f")}terminate(){}get box(){return ao(this,Li,"f")}get uuid(){return ao(this,Li,"f").address.uuid}get address(){return ao(this,Li,"f").address}get markerTrack(){return ao(this,Qm,"f")}get signature(){return[ao(this,Li,"f").signature.nominator.getValue(),ao(this,Li,"f").signature.denominator.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=ao(this,Li,"f").signature;return Y.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),ao(this,Li,"f").signature.subscribe(()=>e(this.signature))}};Li=new WeakMap,Qm=new WeakMap;var cB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Xd=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Jo,Qo=class{constructor(e,t){Jo.set(this,void 0),cB(this,Jo,t,"f")}get box(){return Xd(this,Jo,"f")}get uuid(){return Xd(this,Jo,"f").address.uuid}get address(){return Xd(this,Jo,"f").address}get source(){return Xd(this,Jo,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return Xd(this,Jo,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};Jo=new WeakMap;var xs=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},di=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ym,ws,bs,Xm,eg,ep,pi=class{constructor(e,t){Ym.set(this,void 0),ws.set(this,void 0),bs.set(this,void 0),Xm.set(this,void 0),eg.set(this,void 0),ep.set(this,!1),xs(this,Ym,e,"f"),xs(this,ws,t,"f"),xs(this,bs,new z,"f"),xs(this,Xm,t.attributes,"f"),xs(this,eg,di(this,bs,"f").own(new pe(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return di(this,bs,"f").own(e)}ownAll(...e){di(this,bs,"f").ownAll(...e)}onSelected(){xs(this,ep,!0,"f")}onDeselected(){xs(this,ep,!1,"f")}isSelected(){return di(this,ep,"f")}get box(){return di(this,ws,"f")}get attributes(){return di(this,Xm,"f")}get uuid(){return di(this,ws,"f").address.uuid}get address(){return di(this,ws,"f").address}get parameters(){return di(this,eg,"f")}get modular(){return di(this,Ym,"f").boxAdapters.adapterFor(di(this,ws,"f").attributes.collection.targetVertex.unwrap().box,Yo)}terminate(){di(this,bs,"f").terminate()}};Ym=new WeakMap,ws=new WeakMap,bs=new WeakMap,Xm=new WeakMap,eg=new WeakMap,ep=new WeakMap;var tg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},so=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},rg,Xo,tp,ig,Zt;(function(r){r.Input="input",r.Output="output"})(Zt||(Zt={}));var Gt=class r{static create(e,t,i,n){return new r(e,t,i,n??t.fieldName)}constructor(e,t,i,n){rg.set(this,void 0),Xo.set(this,void 0),tp.set(this,void 0),ig.set(this,void 0),tg(this,rg,e,"f"),tg(this,Xo,t,"f"),tg(this,tp,i,"f"),tg(this,ig,n,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(i=>i===t))}get connections(){return so(this,Xo,"f").pointerHub.isEmpty()?O.empty():so(this,Xo,"f").pointerHub.filter(c.VoltageConnection).map(({box:e})=>so(this,rg,"f").adapterFor(e,Qo))}get field(){return so(this,Xo,"f")}get address(){return so(this,Xo,"f").address}get direction(){return so(this,tp,"f")}get name(){return so(this,ig,"f")}toString(){return`{ModuleConnectorAdapter address: ${so(this,Xo,"f").address.toString()}, direction: ${so(this,tp,"f")}}`}};rg=new WeakMap,Xo=new WeakMap,tp=new WeakMap,ig=new WeakMap;var Xx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},rp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ng,ip,np,lu=class extends pi{constructor(e,t){super(e,t),ng.set(this,void 0),ip.set(this,void 0),np.set(this,void 0),Xx(this,ng,this.parameters.createParameter(t.time,S.exponential(1,1e4),P.numeric({unit:"ms"}),"Time"),"f"),Xx(this,ip,Gt.create(e.boxAdapters,t.voltageInput,Zt.Input,"Input"),"f"),Xx(this,np,Gt.create(e.boxAdapters,t.voltageOutput,Zt.Output,"Output"),"f")}get parameterTime(){return rp(this,ng,"f")}get voltageInput(){return rp(this,ip,"f")}get voltageOutput(){return rp(this,np,"f")}get inputs(){return[rp(this,ip,"f")]}get outputs(){return[rp(this,np,"f")]}};ng=new WeakMap,ip=new WeakMap,np=new WeakMap;var dB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ZP=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},op,uu=class extends pi{constructor(e,t){super(e,t),op.set(this,void 0),dB(this,op,Gt.create(e.boxAdapters,t.input,Zt.Input,"Input"),"f")}get voltageInput(){return ZP(this,op,"f")}get inputs(){return[ZP(this,op,"f")]}get outputs(){return O.empty()}};op=new WeakMap;var ew=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ap=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},og,sp,lp,cu=class extends pi{constructor(e,t){super(e,t),og.set(this,void 0),sp.set(this,void 0),lp.set(this,void 0),ew(this,og,this.parameters.createParameter(t.gain,S.DefaultDecibel,P.numeric({unit:"db"}),"Gain"),"f"),ew(this,sp,Gt.create(e.boxAdapters,t.voltageInput,Zt.Input,"Input"),"f"),ew(this,lp,Gt.create(e.boxAdapters,t.voltageOutput,Zt.Output,"Output"),"f")}get parameterGain(){return ap(this,og,"f")}get voltageInput(){return ap(this,sp,"f")}get voltageOutput(){return ap(this,lp,"f")}get inputs(){return[ap(this,sp,"f")]}get outputs(){return[ap(this,lp,"f")]}};og=new WeakMap,sp=new WeakMap,lp=new WeakMap;var tw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},rw=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ag,sg,lg,du=class extends pi{constructor(e,t){super(e,t),ag.set(this,void 0),sg.set(this,void 0),lg.set(this,void 0),tw(this,ag,Gt.create(e.boxAdapters,t.voltageInputX,Zt.Input,"X"),"f"),tw(this,sg,Gt.create(e.boxAdapters,t.voltageInputY,Zt.Input,"Y"),"f"),tw(this,lg,Gt.create(e.boxAdapters,t.voltageOutput,Zt.Output,"Result"),"f")}get inputs(){return[rw(this,ag,"f"),rw(this,sg,"f")]}get outputs(){return[rw(this,lg,"f")]}};ag=new WeakMap,sg=new WeakMap,lg=new WeakMap;var pB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},GP=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},up,pu=class extends pi{constructor(e,t){super(e,t),up.set(this,void 0),pB(this,up,Gt.create(e.boxAdapters,t.output,Zt.Output,"Output"),"f")}get voltageOutput(){return GP(this,up,"f")}get inputs(){return O.empty()}get outputs(){return[GP(this,up,"f")]}};up=new WeakMap;var hu;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>X(t.accept({visitModuleGainBox:i=>e.adapterFor(i,cu),visitModuleDelayBox:i=>e.adapterFor(i,lu),visitModuleMultiplierBox:i=>e.adapterFor(i,du),visitModularAudioInputBox:i=>e.adapterFor(i,pu),visitModularAudioOutputBox:i=>e.adapterFor(i,uu)}),`Could not find ModuleAdapter for ${t.name}`)})(hu||(hu={}));var qP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},As=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ug,cg,_s,iw,fu=class{constructor(e,t){ug.add(this),cg.set(this,void 0),_s.set(this,void 0),qP(this,cg,e,"f"),qP(this,_s,t,"f")}get box(){return As(this,_s,"f")}get uuid(){return As(this,_s,"f").address.uuid}get address(){return As(this,_s,"f").address}get moduleAdapter(){return hu.adapterFor(As(this,cg,"f").boxAdapters,As(this,ug,"a",iw).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(As(this,ug,"a",iw).address)}terminate(){}};cg=new WeakMap,_s=new WeakMap,ug=new WeakSet,iw=function(){return As(this,_s,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var HP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},yr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},mu,xr,ea=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",mu.set(this,void 0),xr.set(this,void 0),HP(this,mu,e,"f"),HP(this,xr,t,"f")}get box(){return yr(this,xr,"f")}get uuid(){return yr(this,xr,"f").address.uuid}get address(){return yr(this,xr,"f").address}get indexField(){return yr(this,xr,"f").index}get labelField(){return yr(this,xr,"f").label}get enabledField(){return yr(this,xr,"f").enabled}get minimizedField(){return yr(this,xr,"f").minimized}get host(){return yr(this,xr,"f").host}parameterAt(e){return N("Not yet implemented")}deviceHost(){return yr(this,mu,"f").boxAdapters.adapterFor(yr(this,xr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return yr(this,mu,"f").boxAdapters.adapterFor(yr(this,xr,"f").modularSetup.targetVertex.unwrap("No Modular found").box,Yo)}elements(){return yr(this,xr,"f").userInterface.elements.pointerHub.filter(c.DeviceUserInterface).map(e=>yr(this,mu,"f").boxAdapters.adapterFor(e.box,fu))}terminate(){}};mu=new WeakMap,xr=new WeakMap;var cp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Le=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},gu,ta,vu,Ur,Ps,Ss,Yo=class{constructor(e,t){gu.set(this,new z),ta.set(this,void 0),vu.set(this,void 0),Ur.set(this,void 0),Ps.set(this,void 0),Ss.set(this,void 0),cp(this,vu,e,"f"),cp(this,Ur,t,"f"),cp(this,ta,Le(this,gu,"f").own(new Bt),"f"),cp(this,Ps,A.newSet(s=>s.uuid),"f"),cp(this,Ss,A.newSet(s=>s.uuid),"f");let i=s=>{let l=hu.adapterFor(Le(this,vu,"f").boxAdapters,s.box);Le(this,Ps,"f").add(l)&&Le(this,ta,"f").proxy.onModuleAdded(l)},n=s=>Le(this,ta,"f").proxy.onModuleRemoved(Le(this,Ps,"f").removeByKey(s.address.uuid)),o=s=>{let l=Le(this,vu,"f").boxAdapters.adapterFor(s.box,Qo);Le(this,Ss,"f").add(l)&&Le(this,ta,"f").proxy.onConnectionAdded(l)},a=s=>Le(this,ta,"f").proxy.onConnectionRemoved(Le(this,Ss,"f").removeByKey(s.address.uuid));Le(this,Ur,"f").modules.pointerHub.filter(c.ModuleCollection).forEach(i),Le(this,Ur,"f").connections.pointerHub.filter(c.ConnectionCollection).forEach(o),Le(this,gu,"f").own(Le(this,Ur,"f").modules.pointerHub.subscribe({onAdded:i,onRemoved:n},c.ModuleCollection)),Le(this,gu,"f").own(Le(this,Ur,"f").connections.pointerHub.subscribe({onAdded:o,onRemoved:a},c.ConnectionCollection))}catchupAndSubscribe(e){return vx(e.onModuleAdded,t=>Le(this,Ps,"f").forEach(i=>t(i))),vx(e.onConnectionAdded,t=>Le(this,Ss,"f").forEach(i=>t(i))),Le(this,ta,"f").subscribe(e)}get box(){return Le(this,Ur,"f")}get address(){return Le(this,Ur,"f").address}get uuid(){return Le(this,Ur,"f").address.uuid}get editingField(){return Le(this,Ur,"f").editing}get labelField(){return Le(this,Ur,"f").label}get modules(){return Le(this,Ps,"f").values()}get connections(){return Le(this,Ss,"f").values()}get device(){return Le(this,vu,"f").boxAdapters.adapterFor(X(Le(this,Ur,"f").device.pointerHub.incoming().at(0),"No device found").box,ea)}terminate(){console.debug(`terminate ${this}`),Le(this,gu,"f").terminate()}};gu=new WeakMap,ta=new WeakMap,vu=new WeakMap,Ur=new WeakMap,Ps=new WeakMap,Ss=new WeakMap;var dp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ur=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},nw,xu,pp,dg,yu,fp,pg,hp,hg,JP,Sn=class{constructor(e,t){nw.add(this),this.type="groove-adapter",pp.set(this,new z),dg.set(this,void 0),yu.set(this,void 0),fp.set(this,void 0),pg.set(this,new qh({duration:()=>ur(this,hg,"f"),fx:i=>bx(i,ur(this,hp,"f")),fy:i=>bx(i,1-ur(this,hp,"f"))})),hp.set(this,0),hg.set(this,Y.SemiQuaver*2),dp(this,dg,e,"f"),dp(this,yu,t,"f"),dp(this,fp,ur(this,pp,"f").own(new pe(ur(this,dg,"f"))),"f"),this.namedParameter=ur(this,nw,"m",JP).call(this,t),ur(this,pp,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(i=>dp(this,hg,i.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(i=>dp(this,hp,oP(i.getValue(),.01),"f")))}unwarp(e){return ur(this,pg,"f").unwarp(e)}warp(e){return ur(this,pg,"f").warp(e)}get box(){return ur(this,yu,"f")}get uuid(){return ur(this,yu,"f").address.uuid}get address(){return ur(this,yu,"f").address}terminate(){ur(this,pp,"f").terminate()}};xu=Sn,pp=new WeakMap,dg=new WeakMap,yu=new WeakMap,fp=new WeakMap,pg=new WeakMap,hp=new WeakMap,hg=new WeakMap,nw=new WeakSet,JP=function(e){return{duration:ur(this,fp,"f").createParameter(e.duration,S.values(xu.DurationPPQNs),P.values("",xu.DurationPPQNs,xu.DurationStrings),"duration"),amount:ur(this,fp,"f").createParameter(e.amount,S.unipolar(),P.percent({fractionDigits:0}),"amount")}};Sn.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Sn.DurationPPQNs=xu.Durations.map(([r,e])=>Y.fromSignature(r,e));Sn.DurationStrings=xu.Durations.map(([r,e])=>`${r}/${e}`);var wu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ct=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},En,ra,bu,fg,mg,mp,gp,ow,ia=class{constructor(e,t,i,n,o){En.set(this,void 0),ra.set(this,void 0),bu.set(this,void 0),fg.set(this,void 0),mg.set(this,void 0),mp.set(this,new z),gp.set(this,void 0),ow.set(this,g.None),wu(this,En,e,"f"),wu(this,ra,t,"f"),wu(this,bu,i,"f"),wu(this,fg,n,"f"),wu(this,mg,o??0,"f"),wu(this,gp,ct(this,mp,"f").own(new te),"f"),ct(this,mp,"f").own(ct(this,En,"f").subscribe(()=>ct(this,gp,"f").notify(this))),e.getValue()!==t.clamp(e.getValue())&&console.warn(`${n} (${e.getValue()}) is out of bounds`,t)}get field(){return ct(this,En,"f")}get valueMapping(){return ct(this,ra,"f")}get stringMapping(){return ct(this,bu,"f")}get name(){return ct(this,fg,"f")}get anchor(){return ct(this,mg,"f")}get type(){return ct(this,En,"f").type}get address(){return ct(this,En,"f").address}get track(){return ct(this,ow,"f")}subscribe(e){return ct(this,gp,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return ct(this,En,"f").getValue()}setValue(e){ct(this,En,"f").setValue(ct(this,ra,"f").clamp(e))}setUnitValue(e){this.setValue(ct(this,ra,"f").y(e))}getUnitValue(){return ct(this,ra,"f").x(this.getValue())}getPrintValue(){return ct(this,bu,"f").x(this.getValue())}setPrintValue(e){let t=ct(this,bu,"f").y(e);t.type==="unitValue"?this.setUnitValue(ce(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ct(this,ra,"f").clamp(ct(this,En,"f").initValue))}terminate(){ct(this,mp,"f").terminate()}};En=new WeakMap,ra=new WeakMap,bu=new WeakMap,fg=new WeakMap,mg=new WeakMap,mp=new WeakMap,gp=new WeakMap,ow=new WeakMap;var Au=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},hi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Bn,gg,vg,yg,xg,wg,bg=class{constructor(e){Bn.set(this,void 0),gg.set(this,void 0),vg.set(this,void 0),yg.set(this,void 0),xg.set(this,void 0),wg.set(this,void 0),Au(this,Bn,e,"f"),Au(this,gg,new ia(hi(this,Bn,"f").keyboard,S.values([88,76,61,49]),P.numeric({fractionDigits:1}),"Keyboard Type"),"f"),Au(this,vg,new ia(hi(this,Bn,"f").timeRangeInQuarters,S.exponential(1,64),P.numeric({fractionDigits:1}),"Time-Range"),"f"),Au(this,yg,new ia(hi(this,Bn,"f").noteScale,S.exponential(.5,2),P.numeric({fractionDigits:1}),"Note Scale"),"f"),Au(this,xg,new ia(hi(this,Bn,"f").noteLabels,S.bool,P.bool,"Note Labels"),"f"),Au(this,wg,new ia(hi(this,Bn,"f").transpose,S.linearInteger(-48,48),P.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return hi(this,Bn,"f").box.subscribe(Fe.Children,()=>e(this))}get object(){return hi(this,Bn,"f")}get keyboard(){return hi(this,gg,"f")}get timeRangeInQuarters(){return hi(this,vg,"f")}get noteScale(){return hi(this,yg,"f")}get noteLabels(){return hi(this,xg,"f")}get transpose(){return hi(this,wg,"f")}};Bn=new WeakMap,gg=new WeakMap,vg=new WeakMap,yg=new WeakMap,xg=new WeakMap,wg=new WeakMap;var vp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},$t=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Es,jr,_u,Ag,_g,Pu=class{constructor(e,t){Es.set(this,void 0),jr.set(this,void 0),_u.set(this,void 0),Ag.set(this,void 0),_g.set(this,void 0),vp(this,Es,e,"f"),vp(this,jr,t,"f"),vp(this,_u,Ot.create($t(this,jr,"f").audioUnits,i=>$t(this,Es,"f").boxAdapters.adapterFor(i,ai),c.AudioUnits),"f"),vp(this,Ag,new Wm($t(this,jr,"f").audioBusses.pointerHub,i=>$t(this,Es,"f").boxAdapters.adapterFor(i,sr),c.AudioBusses),"f"),vp(this,_g,new bg($t(this,jr,"f").pianoMode),"f")}get uuid(){return $t(this,jr,"f").address.uuid}get address(){return $t(this,jr,"f").address}get box(){return $t(this,jr,"f")}get audioBusses(){return $t(this,Ag,"f")}get audioUnits(){return $t(this,_u,"f")}get clips(){return $t(this,_u,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return $t(this,Es,"f").boxAdapters.adapterFor($t(this,jr,"f").groove.targetVertex.unwrap("no groove").box,Sn)}get timeline(){return $t(this,Es,"f").boxAdapters.adapterFor($t(this,jr,"f").timeline.targetVertex.unwrap("no timeline").box,Pn)}get pianoMode(){return $t(this,_g,"f")}get created(){return new Date($t(this,jr,"f").created.getValue())}get midiOutputDevices(){return $t(this,jr,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Be(e,Di))}terminate(){$t(this,_u,"f").terminate()}};Es=new WeakMap,jr=new WeakMap,_u=new WeakMap,Ag=new WeakMap,_g=new WeakMap;var aw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},qt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},sw,yp,Ki,na,QP,Su=class{constructor(e,t){sw.add(this),this.type="instrument",this.accepts="audio",yp.set(this,void 0),Ki.set(this,void 0),na.set(this,void 0),aw(this,yp,e,"f"),aw(this,Ki,t,"f"),aw(this,na,new pe(qt(this,yp,"f")),"f"),this.namedParameter=qt(this,sw,"m",QP).call(this,t)}get box(){return qt(this,Ki,"f")}get uuid(){return qt(this,Ki,"f").address.uuid}get address(){return qt(this,Ki,"f").address}get labelField(){return qt(this,Ki,"f").label}get iconField(){return qt(this,Ki,"f").icon}get defaultTrackType(){return re.Audio}get enabledField(){return qt(this,Ki,"f").enabled}get minimizedField(){return qt(this,Ki,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return qt(this,yp,"f").boxAdapters.adapterFor(qt(this,Ki,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){qt(this,na,"f").terminate()}};yp=new WeakMap,Ki=new WeakMap,na=new WeakMap,sw=new WeakSet,QP=function(e){return{flutter:qt(this,na,"f").createParameter(e.flutter,S.unipolar(),P.percent(),"flutter"),wow:qt(this,na,"f").createParameter(e.wow,S.unipolar(),P.percent(),"wow"),noise:qt(this,na,"f").createParameter(e.noise,S.unipolar(),P.percent(),"noise"),saturation:qt(this,na,"f").createParameter(e.saturation,S.unipolar(),P.percent(),"saturation")}};var Fn=(()=>{let t=[1,2,3,4],i=["12","24","36","48"],n=[Ke.sine,Ke.triangle,Ke.saw,Ke.square],o=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:S.exponential(20,2e4),CUTOFF_STRING_MAPPING:P.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:i,FILTER_ORDER_VALUE_MAPPING:S.values(t),FILTER_ORDER_STRING_MAPPING:P.values("db",t,i),LFO_WAVEFORM_VALUES:n,LFO_WAVEFORM_STRINGS:o,LFO_WAVEFORM_VALUE_MAPPING:S.values(n),LFO_WAVEFORM_STRING_MAPPING:P.values("",n,o)}})();var lw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Se=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},uw,xp,Wi,Ve,YP,Eu=class{constructor(e,t){uw.add(this),this.type="instrument",this.accepts="midi",xp.set(this,void 0),Wi.set(this,void 0),Ve.set(this,void 0),lw(this,xp,e,"f"),lw(this,Wi,t,"f"),lw(this,Ve,new pe(Se(this,xp,"f")),"f"),this.namedParameter=Se(this,uw,"m",YP).call(this,t)}get box(){return Se(this,Wi,"f")}get uuid(){return Se(this,Wi,"f").address.uuid}get address(){return Se(this,Wi,"f").address}get labelField(){return Se(this,Wi,"f").label}get iconField(){return Se(this,Wi,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Se(this,Wi,"f").enabled}get minimizedField(){return Se(this,Wi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Se(this,xp,"f").boxAdapters.adapterFor(Se(this,Wi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Se(this,Ve,"f").terminate()}};xp=new WeakMap,Wi=new WeakMap,Ve=new WeakMap,uw=new WeakSet,YP=function(e){let t=[sn.Monophonic,sn.Polyphonic];return{oscillators:e.oscillators.fields().map(i=>({waveform:Se(this,Ve,"f").createParameter(i.waveform,S.linearInteger(0,3),P.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Se(this,Ve,"f").createParameter(i.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Se(this,Ve,"f").createParameter(i.octave,S.linearInteger(-3,3),P.numeric({unit:"oct"}),"Octave",.5),tune:Se(this,Ve,"f").createParameter(i.tune,S.linear(-1200,1200),P.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Se(this,Ve,"f").createParameter(e.noise.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Se(this,Ve,"f").createParameter(e.noise.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Se(this,Ve,"f").createParameter(e.noise.hold,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Se(this,Ve,"f").createParameter(e.noise.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Se(this,Ve,"f").createParameter(e.filterOrder,Fn.FILTER_ORDER_VALUE_MAPPING,Fn.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Se(this,Ve,"f").createParameter(e.cutoff,Fn.CUTOFF_VALUE_MAPPING,Fn.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Se(this,Ve,"f").createParameter(e.resonance,S.exponential(.01,10),P.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Se(this,Ve,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Se(this,Ve,"f").createParameter(e.decay,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Se(this,Ve,"f").createParameter(e.sustain,S.unipolar(),P.percent({fractionDigits:1}),"Sustain"),release:Se(this,Ve,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Se(this,Ve,"f").createParameter(e.filterEnvelope,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Se(this,Ve,"f").createParameter(e.filterKeyboard,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Se(this,Ve,"f").createParameter(e.voicingMode,S.values(t),P.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:Se(this,Ve,"f").createParameter(e.glideTime,S.unipolar(),P.percent({fractionDigits:1}),"Glide time",0),unisonCount:Se(this,Ve,"f").createParameter(e.unisonCount,S.values([1,3,5]),P.values("#",[1,3,5],[1,3,5].map(i=>String(i))),"Unisono",0),unisonDetune:Se(this,Ve,"f").createParameter(e.unisonDetune,S.exponential(1,1200),P.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Se(this,Ve,"f").createParameter(e.unisonStereo,S.unipolar(),P.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Se(this,Ve,"f").createParameter(e.lfo.waveform,Fn.LFO_WAVEFORM_VALUE_MAPPING,Fn.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Se(this,Ve,"f").createParameter(e.lfo.rate,S.exponential(1e-4,30),P.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Se(this,Ve,"f").createParameter(e.lfo.targetTune,S.bipolar(),P.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Se(this,Ve,"f").createParameter(e.lfo.targetVolume,S.bipolar(),P.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Se(this,Ve,"f").createParameter(e.lfo.targetCutoff,S.bipolar(),P.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var cw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Mt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},dw,Pg,wp,fi,Nn,XP,Zi=class{constructor(e,t){dw.add(this),this.type="midi-effect",this.accepts="midi",wp.set(this,void 0),fi.set(this,void 0),Nn.set(this,void 0),cw(this,wp,e,"f"),cw(this,fi,t,"f"),cw(this,Nn,new pe(Mt(this,wp,"f")),"f"),this.namedParameter=Mt(this,dw,"m",XP).call(this,t)}get box(){return Mt(this,fi,"f")}get uuid(){return Mt(this,fi,"f").address.uuid}get address(){return Mt(this,fi,"f").address}get indexField(){return Mt(this,fi,"f").index}get labelField(){return Mt(this,fi,"f").label}get enabledField(){return Mt(this,fi,"f").enabled}get minimizedField(){return Mt(this,fi,"f").minimized}get host(){return Mt(this,fi,"f").host}deviceHost(){return Mt(this,wp,"f").boxAdapters.adapterFor(Mt(this,fi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Mt(this,Nn,"f").terminate()}};Pg=Zi,wp=new WeakMap,fi=new WeakMap,Nn=new WeakMap,dw=new WeakSet,XP=function(e){return{modeIndex:Mt(this,Nn,"f").createParameter(e.modeIndex,S.linearInteger(0,2),P.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:Mt(this,Nn,"f").createParameter(e.numOctaves,S.linearInteger(1,5),P.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Mt(this,Nn,"f").createParameter(e.rateIndex,S.linearInteger(0,Pg.RateFractions.length-1),Pg.RateStringMapping,"Rate"),gate:Mt(this,Nn,"f").createParameter(e.gate,S.linear(0,2),P.percent({fractionDigits:0}),"Gate"),repeat:Mt(this,Nn,"f").createParameter(e.repeat,S.linearInteger(1,16),P.numeric({fractionDigits:0}),"Repeat"),velocity:Mt(this,Nn,"f").createParameter(e.velocity,S.bipolar(),P.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Zi.RateFractions=er.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();Zi.RateStringMapping=P.indices("",Pg.RateFractions.map(([r,e])=>`${r}/${e}`));var pw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ht=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},hw,bp,mi,Bs,e1,Bu=class{constructor(e,t){hw.add(this),this.type="midi-effect",this.accepts="midi",bp.set(this,void 0),mi.set(this,void 0),Bs.set(this,void 0),pw(this,bp,e,"f"),pw(this,mi,t,"f"),pw(this,Bs,new pe(Ht(this,bp,"f")),"f"),this.namedParameter=Ht(this,hw,"m",e1).call(this,t)}get box(){return Ht(this,mi,"f")}get uuid(){return Ht(this,mi,"f").address.uuid}get address(){return Ht(this,mi,"f").address}get indexField(){return Ht(this,mi,"f").index}get labelField(){return Ht(this,mi,"f").label}get enabledField(){return Ht(this,mi,"f").enabled}get minimizedField(){return Ht(this,mi,"f").minimized}get host(){return Ht(this,mi,"f").host}deviceHost(){return Ht(this,bp,"f").boxAdapters.adapterFor(Ht(this,mi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ht(this,Bs,"f").terminate()}};bp=new WeakMap,mi=new WeakMap,Bs=new WeakMap,hw=new WeakSet,e1=function(e){return{octaves:Ht(this,Bs,"f").createParameter(e.octaves,S.linearInteger(-7,7),P.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Ht(this,Bs,"f").createParameter(e.semiTones,S.linearInteger(-36,36),P.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Ht(this,Bs,"f").createParameter(e.cents,S.linear(-50,50),P.numeric({unit:"cents",fractionDigits:1}),"cents")}};var fw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},wr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},mw,Ap,Gi,Fu,t1,Nu=class{constructor(e,t){mw.add(this),this.type="instrument",this.accepts="midi",Ap.set(this,void 0),Gi.set(this,void 0),Fu.set(this,void 0),fw(this,Ap,e,"f"),fw(this,Gi,t,"f"),fw(this,Fu,new pe(wr(this,Ap,"f")),"f"),this.namedParameter=wr(this,mw,"m",t1).call(this,t)}get box(){return wr(this,Gi,"f")}get uuid(){return wr(this,Gi,"f").address.uuid}get address(){return wr(this,Gi,"f").address}get labelField(){return wr(this,Gi,"f").label}get iconField(){return wr(this,Gi,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return wr(this,Gi,"f").enabled}get minimizedField(){return wr(this,Gi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return wr(this,Ap,"f").boxAdapters.adapterFor(wr(this,Gi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){wr(this,Fu,"f").terminate()}};Ap=new WeakMap,Gi=new WeakMap,Fu=new WeakMap,mw=new WeakSet,t1=function(e){return{volume:wr(this,Fu,"f").createParameter(e.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"volume"),release:wr(this,Fu,"f").createParameter(e.release,S.exponential(.001,8),P.numeric({unit:"s",fractionDigits:3}),"release")}};var ku=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},q=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},gw,Fs,oa,xe,Sg,Eg,Lr,$u,r1,Mu=class{constructor(e,t){gw.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",Fs.set(this,new z),oa.set(this,void 0),xe.set(this,void 0),Sg.set(this,void 0),Eg.set(this,void 0),Lr.set(this,void 0),$u.set(this,g.None),ku(this,oa,e,"f"),ku(this,xe,t,"f"),ku(this,Sg,q(this,Fs,"f").own(Ot.create(q(this,xe,"f").midiEffects,i=>q(this,oa,"f").boxAdapters.adapterFor(i,ie.isMidiEffect),c.MidiEffectHost)),"f"),ku(this,Eg,q(this,Fs,"f").own(Ot.create(q(this,xe,"f").audioEffects,i=>q(this,oa,"f").boxAdapters.adapterFor(i,ie.isAudioEffect),c.AudioEffectHost)),"f"),ku(this,Lr,q(this,Fs,"f").own(new pe(q(this,oa,"f"))),"f"),this.namedParameter=q(this,gw,"m",r1).call(this,t),q(this,Fs,"f").own(q(this,xe,"f").file.catchupAndSubscribe(i=>{ku(this,$u,i.targetVertex.map(({box:n})=>q(this,oa,"f").boxAdapters.adapterFor(n,Ti)),"f"),q(this,$u,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return q(this,xe,"f")}get uuid(){return q(this,xe,"f").address.uuid}get address(){return q(this,xe,"f").address}get peakAddress(){return q(this,xe,"f").address.append(1001)}get indexField(){return q(this,xe,"f").index}get gate(){return q(this,xe,"f").gate.getValue()}get exclude(){return q(this,xe,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${q(this,$u,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return q(this,xe,"f").icon}get defaultTrackType(){return re.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return q(this,xe,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return q(this,xe,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return q(this,$u,"f")}fileUUID(){return q(this,xe,"f").file.targetAddress.unwrap().uuid}resetParameters(){q(this,xe,"f").mute.reset(),q(this,xe,"f").solo.reset(),q(this,xe,"f").exclude.reset(),q(this,xe,"f").polyphone.reset(),q(this,xe,"f").pitch.reset(),q(this,xe,"f").attack.reset(),q(this,xe,"f").release.reset(),q(this,xe,"f").sampleStart.reset(),q(this,xe,"f").sampleEnd.reset(),q(this,xe,"f").gate.reset()}copyToIndex(e){No.create(q(this,xe,"f").graph,A.generate(),t=>{t.file.refer(q(this,xe,"f").file.targetVertex.unwrap()),t.device.refer(q(this,xe,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(q(this,xe,"f").mute.getValue()),t.solo.setValue(q(this,xe,"f").solo.getValue()),t.sampleStart.setValue(q(this,xe,"f").sampleStart.getValue()),t.sampleEnd.setValue(q(this,xe,"f").sampleEnd.getValue()),t.attack.setValue(q(this,xe,"f").attack.getValue()),t.release.setValue(q(this,xe,"f").release.getValue()),t.pitch.setValue(q(this,xe,"f").pitch.getValue()),t.exclude.setValue(q(this,xe,"f").exclude.getValue()),t.gate.setValue(q(this,xe,"f").gate.getValue())})}get midiEffects(){return q(this,Sg,"f")}get inputAdapter(){return g.wrap(this)}get audioEffects(){return q(this,Eg,"f")}get labelField(){return q(this,xe,"f").label}get enabledField(){return q(this,xe,"f").enabled}get minimizedField(){return q(this,xe,"f").minimized}device(){return q(this,oa,"f").boxAdapters.adapterFor(q(this,xe,"f").device.targetVertex.unwrap().box,aa)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){q(this,Fs,"f").terminate()}};Fs=new WeakMap,oa=new WeakMap,xe=new WeakMap,Sg=new WeakMap,Eg=new WeakMap,Lr=new WeakMap,$u=new WeakMap,gw=new WeakSet,r1=function(e){return{gate:q(this,Lr,"f").createParameter(e.gate,S.linearInteger(0,2),P.indices("",["Off","On","Loop"]),"Gate"),mute:q(this,Lr,"f").createParameter(e.mute,S.bool,P.bool,"Mute"),solo:q(this,Lr,"f").createParameter(e.solo,S.bool,P.bool,"Solo"),polyphone:q(this,Lr,"f").createParameter(e.polyphone,S.bool,P.bool,"Polyphone"),exclude:q(this,Lr,"f").createParameter(e.exclude,S.bool,P.bool,"Exclude"),pitch:q(this,Lr,"f").createParameter(e.pitch,S.linear(-1200,1200),P.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:q(this,Lr,"f").createParameter(e.sampleStart,S.unipolar(),P.percent(),"Start",0),sampleEnd:q(this,Lr,"f").createParameter(e.sampleEnd,S.unipolar(),P.percent(),"End",1),attack:q(this,Lr,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:q(this,Lr,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var Bg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},br=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Iu,qi,_p,Fg,aa=class{constructor(e,t){this.type="instrument",this.accepts="midi",Iu.set(this,void 0),qi.set(this,void 0),_p.set(this,void 0),Fg.set(this,void 0),Bg(this,Iu,e,"f"),Bg(this,qi,t,"f"),Bg(this,_p,Ot.create(t.samples,i=>e.boxAdapters.adapterFor(i,Mu),c.Sample),"f"),Bg(this,Fg,new pe(br(this,Iu,"f")),"f")}reset(){br(this,_p,"f").adapters().forEach(e=>e.box.delete())}get box(){return br(this,qi,"f")}get uuid(){return br(this,qi,"f").address.uuid}get address(){return br(this,qi,"f").address}get labelField(){return br(this,qi,"f").label}get iconField(){return br(this,qi,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return br(this,qi,"f").enabled}get minimizedField(){return br(this,qi,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return br(this,_p,"f")}get context(){return br(this,Iu,"f")}deviceHost(){return br(this,Iu,"f").boxAdapters.adapterFor(br(this,qi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){br(this,Fg,"f").terminate()}};Iu=new WeakMap,qi=new WeakMap,_p=new WeakMap,Fg=new WeakMap;var vw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},It=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},yw,Pp,gi,kn,i1,Du=class{constructor(e,t){yw.add(this),this.type="audio-effect",this.accepts="audio",Pp.set(this,void 0),gi.set(this,void 0),kn.set(this,void 0),vw(this,Pp,e,"f"),vw(this,gi,t,"f"),vw(this,kn,new pe(It(this,Pp,"f")),"f"),this.namedParameter=It(this,yw,"m",i1).call(this,t)}get box(){return It(this,gi,"f")}get uuid(){return It(this,gi,"f").address.uuid}get address(){return It(this,gi,"f").address}get indexField(){return It(this,gi,"f").index}get labelField(){return It(this,gi,"f").label}get enabledField(){return It(this,gi,"f").enabled}get minimizedField(){return It(this,gi,"f").minimized}get host(){return It(this,gi,"f").host}deviceHost(){return It(this,Pp,"f").boxAdapters.adapterFor(It(this,gi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){It(this,kn,"f").terminate()}};Pp=new WeakMap,gi=new WeakMap,kn=new WeakMap,yw=new WeakSet,i1=function(e){return{volume:It(this,kn,"f").createParameter(e.volume,S.decibel(-72,0,12),P.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:It(this,kn,"f").createParameter(e.panning,S.bipolar(),P.panning,"Panning",.5),stereo:It(this,kn,"f").createParameter(e.stereo,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:It(this,kn,"f").createParameter(e.invertL,S.bool,P.bool,"Invert Left"),invertR:It(this,kn,"f").createParameter(e.invertR,S.bool,P.bool,"Invert Right"),swap:It(this,kn,"f").createParameter(e.swap,S.bool,P.bool,"Swap")}};var Ns;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(Ns||(Ns={}));var n1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ar=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Cu,_r,Tu=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",Cu.set(this,void 0),_r.set(this,void 0),n1(this,Cu,e,"f"),n1(this,_r,t,"f"),this.groove()}get box(){return Ar(this,_r,"f")}get uuid(){return Ar(this,_r,"f").address.uuid}get address(){return Ar(this,_r,"f").address}get indexField(){return Ar(this,_r,"f").index}get labelField(){return Ar(this,_r,"f").label}get enabledField(){return Ar(this,_r,"f").enabled}get minimizedField(){return Ar(this,_r,"f").minimized}get host(){return Ar(this,_r,"f").host}deviceHost(){return Ar(this,Cu,"f").boxAdapters.adapterFor(Ar(this,_r,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}groove(){return Ar(this,Cu,"f").boxAdapters.adapterFor(Ar(this,_r,"f").groove.targetVertex.unwrap("no groove").box,Ns.checkType)}catchupAndSubscribeGroove(e){return Ar(this,_r,"f").groove.catchupAndSubscribe(t=>e(Ar(this,Cu,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,Ns.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Cu=new WeakMap,_r=new WeakMap;var o1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Hi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ng,Kr,Ru=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",Ng.set(this,void 0),Kr.set(this,void 0),o1(this,Ng,e,"f"),o1(this,Kr,t,"f")}get box(){return Hi(this,Kr,"f")}get uuid(){return Hi(this,Kr,"f").address.uuid}get address(){return Hi(this,Kr,"f").address}get indexField(){return Hi(this,Kr,"f").index}get labelField(){return Hi(this,Kr,"f").label}get enabledField(){return Hi(this,Kr,"f").enabled}get minimizedField(){return Hi(this,Kr,"f").minimized}get host(){return Hi(this,Kr,"f").host}get commentField(){return Hi(this,Kr,"f").comment}deviceHost(){return Hi(this,Ng,"f").boxAdapters.adapterFor(Hi(this,Kr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Ng=new WeakMap,Kr=new WeakMap;var a1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ji=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},kg,Wr,Ou=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",kg.set(this,void 0),Wr.set(this,void 0),a1(this,kg,e,"f"),a1(this,Wr,t,"f")}get box(){return Ji(this,Wr,"f")}get uuid(){return Ji(this,Wr,"f").address.uuid}get address(){return Ji(this,Wr,"f").address}get indexField(){return Ji(this,Wr,"f").index}get labelField(){return Ji(this,Wr,"f").label}get enabledField(){return Ji(this,Wr,"f").enabled}get minimizedField(){return Ji(this,Wr,"f").minimized}get host(){return Ji(this,Wr,"f").host}get commentField(){return Ji(this,Wr,"f").comment}deviceHost(){return Ji(this,kg,"f").boxAdapters.adapterFor(Ji(this,Wr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};kg=new WeakMap,Wr=new WeakMap;var sa=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ee=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},xw,ww,Sp,Pr,$g,Vu,Qi,vi,zu,s1,bw,Uu=class{constructor(e,t){xw.add(this),this.type="instrument",this.accepts="midi",ww.set(this,new z),Sp.set(this,void 0),Pr.set(this,void 0),$g.set(this,void 0),Vu.set(this,void 0),Qi.set(this,void 0),vi.set(this,void 0),zu.set(this,L.Empty),bw.set(this,i=>i.match({none:()=>{Ee(this,vi,"f").clear(),Ee(this,Qi,"f").clear()},some:n=>n.soundfont.match({none:()=>{Ee(this,vi,"f").clear(),Ee(this,Qi,"f").clear(),Ee(this,zu,"f").terminate(),sa(this,zu,n.subscribe(o=>{if(o.type==="loaded"){let a=n.soundfont.unwrap();Ee(this,vi,"f").wrap(a.presets[this.presetIndex]??a.presets[0]),Ee(this,Qi,"f").wrap(a)}else o.type==="error"?(Ee(this,vi,"f").clear(),Ee(this,Qi,"f").clear()):o.type==="idle"&&(Ee(this,vi,"f").clear(),Ee(this,Qi,"f").clear())}),"f")},some:o=>{Ee(this,Qi,"f").wrap(o),Ee(this,vi,"f").wrap(o.presets[this.presetIndex]??o.presets[0])}})})),sa(this,Sp,e,"f"),sa(this,Pr,t,"f"),sa(this,$g,new pe(Ee(this,Sp,"f")),"f"),this.namedParameter=Ee(this,xw,"m",s1).call(this,t),sa(this,Vu,new Qr,"f"),sa(this,Qi,new Qr,"f"),sa(this,vi,new Qr,"f"),Ee(this,ww,"f").ownAll(Ee(this,Vu,"f").subscribe(Ee(this,bw,"f")),Ee(this,Pr,"f").file.catchupAndSubscribe(({targetVertex:i})=>Ee(this,Vu,"f").wrapOption(i.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid)))),Ee(this,Pr,"f").presetIndex.catchupAndSubscribe(i=>Ee(this,Qi,"f").match({none:()=>Ee(this,vi,"f").clear(),some:n=>Ee(this,vi,"f").wrap(n.presets[i.getValue()]??n.presets[0])})))}get loader(){return Ee(this,Vu,"f")}get soundfont(){return Ee(this,Qi,"f")}get preset(){return Ee(this,vi,"f")}get presetIndex(){return Ee(this,Pr,"f").presetIndex.getValue()}get box(){return Ee(this,Pr,"f")}get uuid(){return Ee(this,Pr,"f").address.uuid}get address(){return Ee(this,Pr,"f").address}get labelField(){return Ee(this,Pr,"f").label}get iconField(){return Ee(this,Pr,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Ee(this,Pr,"f").enabled}get minimizedField(){return Ee(this,Pr,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ee(this,Sp,"f").boxAdapters.adapterFor(Ee(this,Pr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ee(this,zu,"f").terminate(),sa(this,zu,L.Empty,"f"),Ee(this,$g,"f").terminate()}};ww=new WeakMap,Sp=new WeakMap,Pr=new WeakMap,$g=new WeakMap,Vu=new WeakMap,Qi=new WeakMap,vi=new WeakMap,zu=new WeakMap,bw=new WeakMap,xw=new WeakSet,s1=function(e){return{}};var l1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ep=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Mg,ks,Ig=class{constructor(e,t){Mg.set(this,void 0),ks.set(this,void 0),l1(this,Mg,e,"f"),l1(this,ks,t,"f")}get box(){return Ep(this,ks,"f")}get uuid(){return Ep(this,ks,"f").address.uuid}get address(){return Ep(this,ks,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Ep(this,Mg,"f").soundfontManager.getOrCreate(Ep(this,ks,"f").address.uuid)}terminate(){}};Mg=new WeakMap,ks=new WeakMap;var Aw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},tt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},_w,Bp,yi,Jt,u1,ju=class{constructor(e,t){_w.add(this),this.type="audio-effect",this.accepts="audio",Bp.set(this,void 0),yi.set(this,void 0),Jt.set(this,void 0),Aw(this,Bp,e,"f"),Aw(this,yi,t,"f"),Aw(this,Jt,new pe(tt(this,Bp,"f")),"f"),this.namedParameter=tt(this,_w,"m",u1).call(this,t)}get box(){return tt(this,yi,"f")}get uuid(){return tt(this,yi,"f").address.uuid}get address(){return tt(this,yi,"f").address}get indexField(){return tt(this,yi,"f").index}get labelField(){return tt(this,yi,"f").label}get enabledField(){return tt(this,yi,"f").enabled}get minimizedField(){return tt(this,yi,"f").minimized}get host(){return tt(this,yi,"f").host}deviceHost(){return tt(this,Bp,"f").boxAdapters.adapterFor(tt(this,yi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){tt(this,Jt,"f").terminate()}};Bp=new WeakMap,yi=new WeakMap,Jt=new WeakMap,_w=new WeakSet,u1=function(e){return{lookahead:tt(this,Jt,"f").createParameter(e.lookahead,S.bool,P.bool,"Lookahead"),automakeup:tt(this,Jt,"f").createParameter(e.automakeup,S.bool,P.bool,"Auto Makeup"),autoattack:tt(this,Jt,"f").createParameter(e.autoattack,S.bool,P.bool,"Auto Attack"),autorelease:tt(this,Jt,"f").createParameter(e.autorelease,S.bool,P.bool,"Auto Release"),inputgain:tt(this,Jt,"f").createParameter(e.inputgain,S.linear(-30,30),P.decible,"Input Gain"),threshold:tt(this,Jt,"f").createParameter(e.threshold,S.linear(-60,0),P.decible,"Threshold"),ratio:tt(this,Jt,"f").createParameter(e.ratio,S.exponential(1,24),P.numeric({fractionDigits:1}),"Ratio"),knee:tt(this,Jt,"f").createParameter(e.knee,S.linear(0,24),P.decible,"Knee"),attack:tt(this,Jt,"f").createParameter(e.attack,S.linear(0,100),P.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:tt(this,Jt,"f").createParameter(e.release,S.linear(5,1500),P.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:tt(this,Jt,"f").createParameter(e.makeup,S.linear(-40,40),P.decible,"Makeup Gain"),mix:tt(this,Jt,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Dry/Wet")}};var Pw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Lt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Sw,Fp,xi,la,c1,Lu=class{constructor(e,t){Sw.add(this),this.type="audio-effect",this.accepts="audio",Fp.set(this,void 0),xi.set(this,void 0),la.set(this,void 0),Pw(this,Fp,e,"f"),Pw(this,xi,t,"f"),Pw(this,la,new pe(Lt(this,Fp,"f")),"f"),this.namedParameter=Lt(this,Sw,"m",c1).call(this,t)}get box(){return Lt(this,xi,"f")}get uuid(){return Lt(this,xi,"f").address.uuid}get address(){return Lt(this,xi,"f").address}get indexField(){return Lt(this,xi,"f").index}get labelField(){return Lt(this,xi,"f").label}get enabledField(){return Lt(this,xi,"f").enabled}get minimizedField(){return Lt(this,xi,"f").minimized}get host(){return Lt(this,xi,"f").host}deviceHost(){return Lt(this,Fp,"f").boxAdapters.adapterFor(Lt(this,xi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Lt(this,la,"f").terminate()}};Fp=new WeakMap,xi=new WeakMap,la=new WeakMap,Sw=new WeakSet,c1=function(e){return{crush:Lt(this,la,"f").createParameter(e.crush,S.unipolar(),P.percent(),"Crush"),bits:Lt(this,la,"f").createParameter(e.bits,S.linearInteger(1,16),P.numeric(),"Bits"),boost:Lt(this,la,"f").createParameter(e.boost,S.linear(0,24),P.decible,"Boost"),mix:Lt(this,la,"f").createParameter(e.mix,S.exponential(.001,1),P.percent(),"Mix")}};var Ew=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},cr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Bw,Np,wi,Ku,d1,Wu=class{constructor(e,t){Bw.add(this),this.type="audio-effect",this.accepts="audio",Np.set(this,void 0),wi.set(this,void 0),Ku.set(this,void 0),Ew(this,Np,e,"f"),Ew(this,wi,t,"f"),Ew(this,Ku,new pe(cr(this,Np,"f")),"f"),this.namedParameter=cr(this,Bw,"m",d1).call(this,t)}get box(){return cr(this,wi,"f")}get uuid(){return cr(this,wi,"f").address.uuid}get address(){return cr(this,wi,"f").address}get indexField(){return cr(this,wi,"f").index}get labelField(){return cr(this,wi,"f").label}get enabledField(){return cr(this,wi,"f").enabled}get minimizedField(){return cr(this,wi,"f").minimized}get host(){return cr(this,wi,"f").host}deviceHost(){return cr(this,Np,"f").boxAdapters.adapterFor(cr(this,wi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){cr(this,Ku,"f").terminate()}};Np=new WeakMap,wi=new WeakMap,Ku=new WeakMap,Bw=new WeakSet,d1=function(e){return{drive:cr(this,Ku,"f").createParameter(e.drive,S.linear(0,30),P.decible,"Drive"),volume:cr(this,Ku,"f").createParameter(e.volume,S.linear(-18,0),P.decible,"Volume")}};var Dg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},kp,$p,bi,Zu,Gu,qu=class{constructor(e,t){kp.set(this,new z),this.type="instrument",this.accepts="midi",$p.set(this,void 0),bi.set(this,void 0),Zu.set(this,void 0),Gu.set(this,void 0),Dg(this,$p,e,"f"),Dg(this,bi,t,"f"),Dg(this,Zu,new Qr,"f"),Dg(this,Gu,Pt(this,kp,"f").own(new pe(Pt(this,$p,"f"))),"f"),Pt(this,kp,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:i})=>Pt(this,Gu,"f").createParameter(Be(i,Ci).value,S.unipolar(),P.percent({fractionDigits:1}),"",0)),onRemoved:(({box:i})=>Pt(this,Gu,"f").removeParameter(Be(i,Ci).value.address))}),Pt(this,bi,"f").device.catchupAndSubscribe(({targetVertex:i})=>i.match({none:()=>Pt(this,Zu,"f").clear(),some:({box:n})=>Pt(this,Zu,"f").wrap(Be(n,Di))})))}get box(){return Pt(this,bi,"f")}get uuid(){return Pt(this,bi,"f").address.uuid}get address(){return Pt(this,bi,"f").address}get labelField(){return Pt(this,bi,"f").label}get iconField(){return Pt(this,bi,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Pt(this,bi,"f").enabled}get minimizedField(){return Pt(this,bi,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Pt(this,Gu,"f")}get midiDevice(){return Pt(this,Zu,"f")}deviceHost(){return Pt(this,$p,"f").boxAdapters.adapterFor(Pt(this,bi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pt(this,kp,"f").terminate()}};kp=new WeakMap,$p=new WeakMap,bi=new WeakMap,Zu=new WeakMap,Gu=new WeakMap;var Cg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},vt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Fw,Mp,Ai,$n,Ip,p1,Hu=class{constructor(e,t){Fw.add(this),this.type="midi-effect",this.accepts="midi",Mp.set(this,void 0),Ai.set(this,void 0),$n.set(this,void 0),Ip.set(this,void 0),Cg(this,Mp,e,"f"),Cg(this,Ai,t,"f"),Cg(this,$n,new pe(vt(this,Mp,"f")),"f"),Cg(this,Ip,qs.create(),"f"),this.namedParameter=vt(this,Fw,"m",p1).call(this,t)}computeVelocity(e,t){let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:l}=this.namedParameter;vt(this,Ip,"f").setSeed(o.valueAt(e)+e);let u=t+(i.valueAt(e)-t)*n.valueAt(e),p=(vt(this,Ip,"f").uniform()*2-1)*a.valueAt(e),d=s.valueAt(e),f=l.valueAt(e);return t*(1-f)+Hr(u+p+d)*f}get box(){return vt(this,Ai,"f")}get uuid(){return vt(this,Ai,"f").address.uuid}get address(){return vt(this,Ai,"f").address}get indexField(){return vt(this,Ai,"f").index}get labelField(){return vt(this,Ai,"f").label}get enabledField(){return vt(this,Ai,"f").enabled}get minimizedField(){return vt(this,Ai,"f").minimized}get host(){return vt(this,Ai,"f").host}deviceHost(){return vt(this,Mp,"f").boxAdapters.adapterFor(vt(this,Ai,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){vt(this,$n,"f").terminate()}};Mp=new WeakMap,Ai=new WeakMap,$n=new WeakMap,Ip=new WeakMap,Fw=new WeakSet,p1=function(e){return{magnetPosition:vt(this,$n,"f").createParameter(e.magnetPosition,S.unipolar(),P.percent(),"Position"),magnetStrength:vt(this,$n,"f").createParameter(e.magnetStrength,S.unipolar(),P.percent(),"Strength"),randomSeed:vt(this,$n,"f").createParameter(e.randomSeed,S.linearInteger(0,65535),P.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:vt(this,$n,"f").createParameter(e.randomAmount,S.unipolar(),P.percent(),"Amount"),offset:vt(this,$n,"f").createParameter(e.offset,S.bipolar(),P.percent(),"Offset"),mix:vt(this,$n,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Mix")}};var Nw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Dt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},kw,$w,Dp,_i,Mn,h1,Yi=class{constructor(e,t){kw.add(this),this.type="audio-effect",this.accepts="audio",Dp.set(this,void 0),_i.set(this,void 0),Mn.set(this,void 0),Nw(this,Dp,e,"f"),Nw(this,_i,t,"f"),Nw(this,Mn,new pe(Dt(this,Dp,"f")),"f"),this.namedParameter=Dt(this,kw,"m",h1).call(this,t)}get box(){return Dt(this,_i,"f")}get uuid(){return Dt(this,_i,"f").address.uuid}get address(){return Dt(this,_i,"f").address}get indexField(){return Dt(this,_i,"f").index}get labelField(){return Dt(this,_i,"f").label}get enabledField(){return Dt(this,_i,"f").enabled}get minimizedField(){return Dt(this,_i,"f").minimized}get host(){return Dt(this,_i,"f").host}deviceHost(){return Dt(this,Dp,"f").boxAdapters.adapterFor(Dt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Dt(this,Mn,"f").terminate()}};$w=Yi,Dp=new WeakMap,_i=new WeakMap,Mn=new WeakMap,kw=new WeakSet,h1=function(e){let{RateFractions:t,RateStringMapping:i}=$w;return{slope:Dt(this,Mn,"f").createParameter(e.slope,S.bipolar(),P.percent({fractionDigits:1}),"Slope",.5),symmetry:Dt(this,Mn,"f").createParameter(e.symmetry,S.unipolar(),P.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Dt(this,Mn,"f").createParameter(e.rate,S.values(t.map((n,o)=>o)),i,"Rate",0),depth:Dt(this,Mn,"f").createParameter(e.depth,S.unipolar(),P.percent({fractionDigits:1}),"Depth",0),offset:Dt(this,Mn,"f").createParameter(e.offset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Dt(this,Mn,"f").createParameter(e.channelOffset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Yi.RateFractions=er.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();Yi.RateStringMapping=P.indices("",$w.RateFractions.map(([r,e])=>`${r}/${e}`));var Mw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},rt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Iw,Cp,Pi,Qt,f1,Ju=class{constructor(e,t){Iw.add(this),this.type="audio-effect",this.accepts="audio",Cp.set(this,void 0),Pi.set(this,void 0),Qt.set(this,void 0),Mw(this,Cp,e,"f"),Mw(this,Pi,t,"f"),Mw(this,Qt,new pe(rt(this,Cp,"f")),"f"),this.namedParameter=rt(this,Iw,"m",f1).call(this,t)}get box(){return rt(this,Pi,"f")}get uuid(){return rt(this,Pi,"f").address.uuid}get address(){return rt(this,Pi,"f").address}get indexField(){return rt(this,Pi,"f").index}get labelField(){return rt(this,Pi,"f").label}get enabledField(){return rt(this,Pi,"f").enabled}get minimizedField(){return rt(this,Pi,"f").minimized}get host(){return rt(this,Pi,"f").host}deviceHost(){return rt(this,Cp,"f").boxAdapters.adapterFor(rt(this,Pi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){rt(this,Qt,"f").terminate()}};Cp=new WeakMap,Pi=new WeakMap,Qt=new WeakMap,Iw=new WeakSet,f1=function(e){return{preDelay:rt(this,Qt,"f").createParameter(e.preDelay,S.linear(0,1e3),P.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:rt(this,Qt,"f").createParameter(e.bandwidth,S.unipolar(),P.percent(),"Bandwidth"),inputDiffusion1:rt(this,Qt,"f").createParameter(e.inputDiffusion1,S.unipolar(),P.percent(),"Tank 1"),inputDiffusion2:rt(this,Qt,"f").createParameter(e.inputDiffusion2,S.unipolar(),P.percent(),"Tank 2"),decay:rt(this,Qt,"f").createParameter(e.decay,S.unipolar(),P.percent(),"Decay"),decayDiffusion1:rt(this,Qt,"f").createParameter(e.decayDiffusion1,S.unipolar(),P.percent(),"Tank 1"),decayDiffusion2:rt(this,Qt,"f").createParameter(e.decayDiffusion2,S.unipolar(),P.percent(),"Tank 2"),damping:rt(this,Qt,"f").createParameter(e.damping,S.unipolar(),P.percent(),"Damping"),excursionRate:rt(this,Qt,"f").createParameter(e.excursionRate,S.unipolar(),P.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:rt(this,Qt,"f").createParameter(e.excursionDepth,S.unipolar(),P.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:rt(this,Qt,"f").createParameter(e.wet,S.DefaultDecibel,P.decible,"Wet"),dry:rt(this,Qt,"f").createParameter(e.dry,S.DefaultDecibel,P.decible,"Dry")}};var Tg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},H=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Dw,ee,lo,Tp,Rg,m1,Og=class{constructor(e){Dw.add(this),ee.set(this,void 0),lo.set(this,void 0),Tp.set(this,void 0),Rg.set(this,void 0),Tg(this,ee,e,"f"),Tg(this,lo,A.newSet(t=>t.uuid),"f"),Tg(this,Tp,new Set,"f"),Tg(this,Rg,H(this,ee,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let i=H(this,lo,"f").getOrNull(t.uuid);Z(i)&&(H(this,Tp,"f").add(i.box),H(this,lo,"f").removeByValue(i).terminate())}}}),"f")}terminate(){H(this,lo,"f").values().forEach(e=>e.terminate()),H(this,lo,"f").clear(),H(this,Rg,"f").terminate()}adapterFor(e,t){if(H(this,Tp,"f").has(e))return N(`Cannot resolve adapter for already deleted box: ${e}`);let i=H(this,lo,"f").getOrNull(e.address.uuid);if(i===null){i=H(this,Dw,"m",m1).call(this,e);let n=H(this,lo,"f").add(i);I(n,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?i instanceof t?i:N(`${i} is not instance of ${t}`):t(i)?i:N(`${i} did not pass custom type guard`):N("Unknown checkType method")}};ee=new WeakMap,lo=new WeakMap,Tp=new WeakMap,Rg=new WeakMap,Dw=new WeakSet,m1=function(e){return X(e.accept({visitArpeggioDeviceBox:t=>new Zi(H(this,ee,"f"),t),visitAudioBusBox:t=>new sr(H(this,ee,"f"),t),visitAudioClipBox:t=>new Jn(H(this,ee,"f"),t),visitAudioFileBox:t=>new Ti(H(this,ee,"f"),t),visitAudioPitchBox:t=>new pn(H(this,ee,"f"),t),visitAudioTimeStretchBox:t=>new hn(H(this,ee,"f"),t),visitTransientMarkerBox:t=>new _l(t),visitWarpMarkerBox:t=>new To(H(this,ee,"f"),t),visitAudioRegionBox:t=>new Uo(H(this,ee,"f"),t),visitAudioUnitBox:t=>new ai(H(this,ee,"f"),t),visitAuxSendBox:t=>new Xl(H(this,ee,"f"),t),visitCompressorDeviceBox:t=>new ju(H(this,ee,"f"),t),visitCrusherDeviceBox:t=>new Lu(H(this,ee,"f"),t),visitDattorroReverbDeviceBox:t=>new Ju(H(this,ee,"f"),t),visitDelayDeviceBox:t=>new li(H(this,ee,"f"),t),visitDeviceInterfaceKnobBox:t=>new fu(H(this,ee,"f"),t),visitTidalDeviceBox:t=>new Yi(H(this,ee,"f"),t),visitFoldDeviceBox:t=>new Wu(H(this,ee,"f"),t),visitGrooveShuffleBox:t=>new Sn(H(this,ee,"f"),t),visitMarkerBox:t=>new Ho(H(this,ee,"f"),t),visitMIDIOutputDeviceBox:t=>new qu(H(this,ee,"f"),t),visitModularAudioInputBox:t=>new pu(H(this,ee,"f"),t),visitModularAudioOutputBox:t=>new uu(H(this,ee,"f"),t),visitModularBox:t=>new Yo(H(this,ee,"f"),t),visitModularDeviceBox:t=>new ea(H(this,ee,"f"),t),visitModuleConnectionBox:t=>new Qo(H(this,ee,"f"),t),visitModuleDelayBox:t=>new lu(H(this,ee,"f"),t),visitModuleGainBox:t=>new cu(H(this,ee,"f"),t),visitModuleMultiplierBox:t=>new du(H(this,ee,"f"),t),visitNanoDeviceBox:t=>new Nu(H(this,ee,"f"),t),visitNoteClipBox:t=>new Tl(H(this,ee,"f"),t),visitNoteEventBox:t=>new Ja(H(this,ee,"f"),t),visitNoteEventCollectionBox:t=>new ti(H(this,ee,"f"),t),visitNoteRegionBox:t=>new jo(H(this,ee,"f"),t),visitPitchDeviceBox:t=>new Bu(H(this,ee,"f"),t),visitPlayfieldDeviceBox:t=>new aa(H(this,ee,"f"),t),visitPlayfieldSampleBox:t=>new Mu(H(this,ee,"f"),t),visitRevampDeviceBox:t=>new au(H(this,ee,"f"),t),visitReverbDeviceBox:t=>new ou(H(this,ee,"f"),t),visitRootBox:t=>new Pu(H(this,ee,"f"),t),visitSoundfontDeviceBox:t=>new Uu(H(this,ee,"f"),t),visitSoundfontFileBox:t=>new Ig(H(this,ee,"f"),t),visitStereoToolDeviceBox:t=>new Du(H(this,ee,"f"),t),visitTapeDeviceBox:t=>new Su(H(this,ee,"f"),t),visitTimelineBox:t=>new Pn(H(this,ee,"f"),t),visitTrackBox:t=>new pt(H(this,ee,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new Ru(H(this,ee,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new Ou(H(this,ee,"f"),t),visitValueClipBox:t=>new Co(H(this,ee,"f"),t),visitValueEventBox:t=>new Gn(H(this,ee,"f"),t),visitValueEventCollectionBox:t=>new nr(H(this,ee,"f"),t),visitValueRegionBox:t=>new to(H(this,ee,"f"),t),visitVaporisateurDeviceBox:t=>new Eu(H(this,ee,"f"),t),visitVelocityDeviceBox:t=>new Hu(H(this,ee,"f"),t),visitZeitgeistDeviceBox:t=>new Tu(H(this,ee,"f"),t)}),`Could not find factory for ${e}`)};var Qu;(function(r){r.PEAKS=we.compose(A.Lowest).append(0),r.SPECTRUM=we.compose(A.Lowest).append(1),r.WAVEFORM=we.compose(A.Lowest).append(2)})(Qu||(Qu={}));var g1;(function(r){r.countStems=e=>e.match({none:()=>1,some:t=>Object.keys(t).length}),r.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),r.sanitizeExportNamesInPlace=e=>{let t=new Map,i=n=>{let o=t.get(n)??0,a=n;for(;t.has(a);)o++,a=`${n} ${o}`;return t.set(n,o),t.set(a,1),a};Object.keys(e).forEach(n=>{let o=e[n];o.fileName=i(r.sanitizeFileName(o.fileName))})}})(g1||(g1={}));var v1=fr.createBuilder({position:fr.float,playbackTimestamp:fr.float,countInBeatsRemaining:fr.float,isPlaying:fr.bool,isCountingIn:fr.bool,isRecording:fr.bool});var Cw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ua=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vg,zg,Ug,$s,Si=class{constructor(e,t){Vg.set(this,new z),zg.set(this,void 0),Ug.set(this,void 0),$s.set(this,void 0),Cw(this,zg,e,"f"),Cw(this,Ug,t,"f"),Cw(this,$s,new nt(128),"f"),ua(this,Vg,"f").own(ua(this,zg,"f").broadcastIntegers(ua(this,Ug,"f"),new Int32Array(ua(this,$s,"f").buffer),Ni))}noteOn(e){e>=0&&e<128&&ua(this,$s,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&ua(this,$s,"f").setBit(e,!1)}reset(){}clear(){ua(this,$s,"f").clear()}terminate(){ua(this,Vg,"f").terminate()}toString(){return`{${this.constructor.name}}`}};Vg=new WeakMap,zg=new WeakMap,Ug=new WeakMap,$s=new WeakMap;var it;(function(r){let e;(function(t){t[t.NoteOn=144]="NoteOn",t[t.NoteOff=128]="NoteOff",t[t.PitchBend=224]="PitchBend",t[t.Controller=176]="Controller",t[t.Start=250]="Start",t[t.Continue=251]="Continue",t[t.Stop=252]="Stop",t[t.Clock=248]="Clock",t[t.Position=242]="Position"})(e=r.Command||(r.Command={})),r.readCommand=t=>t[0]&240,r.readChannel=t=>t[0]&15,r.readParam1=t=>t.length>1?t[1]&255:0,r.readParam2=t=>t.length>2?t[2]&255:0,r.readPitch=t=>t[1],r.readVelocity=t=>t[2]/127,r.isNoteOn=t=>r.readCommand(t)===e.NoteOn&&r.readVelocity(t)>0,r.isNoteOff=t=>r.readCommand(t)===e.NoteOff||r.readCommand(t)===e.NoteOn&&r.readVelocity(t)===0,r.isPitchWheel=t=>r.readCommand(t)===e.PitchBend,r.isController=t=>r.readCommand(t)===e.Controller,r.isClock=t=>t[0]===e.Clock,r.isStart=t=>t[0]===e.Start,r.isContinue=t=>t[0]===e.Continue,r.isStop=t=>t[0]===e.Stop,r.isPosition=t=>t[0]===e.Position,r.asPitchBend=t=>{let i=r.readParam1(t)&127,n=r.readParam2(t)&127,o=i|n<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.asValue=t=>{let i=r.readParam2(t);return i>64?.5+(i-63)/128:i<64?i/128:.5},r.Clock=new Uint8Array([e.Clock]),r.Start=new Uint8Array([e.Start]),r.Continue=new Uint8Array([e.Continue]),r.Stop=new Uint8Array([e.Stop]),r.noteOn=(t,i,n)=>new Uint8Array([e.NoteOn|t,i,n]),r.noteOff=(t,i)=>new Uint8Array([e.NoteOff|t,i,0]),r.control=(t,i,n)=>new Uint8Array([e.Controller|t,i&127,n&127]),r.position=(t,i)=>new Uint8Array([e.Position,t&127,i&127]),r.positionInPPQN=t=>{let i=Math.floor(t/96),n=i&127,o=i>>7&127;return new Uint8Array([e.Position,n,o])},r.accept=(t,i)=>{Tn(t)||(r.isNoteOn(t)?_(i.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?_(i.noteOff,r.readPitch(t)):r.isPitchWheel(t)?_(i.pitchBend,r.asPitchBend(t)):r.isController(t)?_(i.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?_(i.clock):r.isStart(t)?_(i.start):r.isContinue(t)?_(i.continue):r.isStop(t)?_(i.stop):r.isPosition(t)&&_(i.songPos,r.readParam1(t)|r.readParam2(t)<<7))},r.debug=t=>t===null?"null":r.isNoteOn(t)?`NoteOn #${r.readChannel(t)} ${r.readPitch(t)} : ${r.readVelocity(t).toFixed(2)}`:r.isNoteOff(t)?`NoteOff #${r.readChannel(t)} ${r.readPitch(t)}`:r.isPitchWheel(t)?`PitchWheel #${r.readChannel(t)} ${r.asPitchBend(t)}`:r.isController(t)?`Control #${r.readChannel(t)} ${r.asValue(t)}`:r.isClock(t)?"Clock":r.isStart(t)?"Start":r.isContinue(t)?"Continue":r.isStop(t)?"Stop":r.isPosition(t)?`SongPosition ${r.readParam1(t)|r.readParam2(t)<<7}`:"Unknown"})(it||(it={}));var ca;(function(r){r.on=(e,t,i)=>({type:"note-on",uuid:e,pitch:t,velocity:i}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.fromEvent=(e,t)=>{let i=e.data;if(it.isNoteOn(i)){let n=it.readPitch(i),o=it.readVelocity(i);return{type:"note-on",uuid:t,pitch:n,velocity:o}}else if(it.isNoteOff(i)){let n=it.readPitch(i);return{type:"note-off",uuid:t,pitch:n}}return N("Unknown MIDI event")}})(ca||(ca={}));var y1;(function(r){r.start=(e,t,i,n=1)=>{let o=!0;return e(ca.on(t,i,n)),{terminate:()=>{o&&(e(ca.off(t,i)),o=!1)}}}})(y1||(y1={}));var hB,fB,mB,gB,vB;hB=new WeakMap,fB=new WeakMap,mB=new WeakMap,gB=new WeakMap,vB=new WeakMap;var yB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},jg=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ms,Lg=class{constructor(){Ms.set(this,void 0),yB(this,Ms,we.newSet(e=>e.field.address),"f")}register(e){return jg(this,Ms,"f").add(e),{terminate:()=>jg(this,Ms,"f").removeByValue(e)}}get(e){return jg(this,Ms,"f").get(e)}opt(e){return jg(this,Ms,"f").opt(e)}};Ms=new WeakMap;var da={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})??N("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var Kg;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?Rn.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||(t&t-1)!==0?Rn.err("Denominator must be a power of two between 1 and 32"):Rn.ok([e,t]),r.MIN_BPM=30,r.MAX_BPM=1e3,r.clampBpm=e=>Number.isFinite(e)?ce(e,r.MIN_BPM,r.MAX_BPM):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:i=>{for(let[n,o]of O.iterateAdjacent(i.regions.pointerHub.incoming().map(({box:a})=>da.asRegionBox(a)).sort(({position:a},{position:s})=>a.getValue()-s.getValue()))){if(n instanceof Eo&&n.timeBase.getValue()===rr.Seconds)return!1;if(n.position.getValue()+n.duration.getValue()>o.position.getValue())return!0}return!1}})??!1)})(Kg||(Kg={}));var x1;(function(r){r.parseTimeSignature=e=>{let[t,i]=e.split("/"),n=parseInt(t,10),o=parseInt(i,10);return Kg.isTimeSignatureValid(n,o)}})(x1||(x1={}));var Wg;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n},o)=>{let a=!0,s=new Int32Array(e,0,2),l=new Float32Array(e,8),u=new Float32Array(i*n),p=typeof document>"u",d=()=>{if(!a)return;let f=Atomics.load(s,1),v=Atomics.load(s,0);if(f===v){if(p)Atomics.wait(s,0,v);else{setTimeout(d,1);return}v=Atomics.load(s,0)}for(;f!==v;){let m=f*i*n;u.set(l.subarray(m,m+i*n));let y=[];for(let x=0;x<i;x++){let F=x*n,D=F+n;y.push(u.slice(F,D))}if(f=(f+1)%t,Atomics.store(s,1,f),!a)return;o(y)}d()};return d(),{stop:()=>a=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n})=>{let o=new Int32Array(e,0,2),a=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==i)return;for(let p of s)if(p.length!==n)return N("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(o,0),u=l*i*n;s.forEach((p,d)=>a.set(p,u+d*n)),Atomics.store(o,0,(l+1)%t),Atomics.notify(o,0)}})}})(Wg||(Wg={}));var Tw={isRegion:r=>da.isRegionBox(r.box),isLoopableRegion:r=>da.isLoopableRegionBox(r.box)};var In;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(In||(In={}));var xB,wB,bB,AB;xB=new WeakMap,wB=new WeakMap,bB=new WeakMap,AB=new WeakMap;var _B,PB,SB,EB;_B=new WeakMap,PB=new WeakMap,SB=new WeakMap,EB=new WeakMap;var Yu={[bt.Instrument]:0,[bt.Aux]:1,[bt.Bus]:2,[bt.Output]:3};var Zg;(function(r){r.create=({boxGraph:e,mandatoryBoxes:{rootBox:t,primaryAudioBus:i}},n,o,a)=>{let s=a??r.orderAndGetIndex(t,n);return console.debug(`createAudioUnit type: ${n}, insertIndex: ${s}`),Xe.create(e,A.generate(),l=>{l.collection.refer(t.audioUnits),l.output.refer(i.input),l.index.setValue(s),l.type.setValue(n),o.ifSome(u=>l.capture.refer(u))})},r.orderAndGetIndex=(e,t)=>{let i=nl.collectIndexedBoxes(e.audioUnits,Xe),n=Yu[t],o=0;for(;o<i.length&&!(Yu[i[o].type.getValue()]>n);o++);let a=o;for(;o<i.length;)i[o].index.setValue(++o);return a},r.trackTypeToCapture=(e,t)=>{switch(t){case re.Audio:return g.wrap(Bo.create(e,A.generate()));case re.Notes:return g.wrap(Fo.create(e,A.generate()));default:return g.None}}})(Zg||(Zg={}));var w1;(function(r){r.create=(e,t,i,n,o)=>{console.debug(`createAudioBus '${t}', type: ${n}, color: ${o}`);let{boxGraph:a,mandatoryBoxes:{rootBox:s}}=e;I(s.isAttached(),"rootBox not attached");let l=A.generate(),u=Ii.create(a,l,d=>{d.collection.refer(s.audioBusses),d.label.setValue(t),d.icon.setValue($e.toName(i)),d.color.setValue(o.toString())}),p=Zg.create(e,n,g.None);return ir.create(a,A.generate(),d=>{d.tracks.refer(p.tracks),d.target.refer(p),d.index.setValue(0),d.type.setValue(re.Undefined)}),u.output.refer(p.input),u}})(w1||(w1={}));var b1;(function(r){r.forAudioType=e=>{switch(e){case bt.Output:return ol.blue;case bt.Aux:return ol.purple;case bt.Bus:return ol.orange;case bt.Instrument:return ol.green;default:return ol.dark}},r.forTrackType=e=>{switch(e){case re.Audio:return 200;case re.Notes:return 45;case re.Value:return 156;default:return 0}}})(b1||(b1={}));var A1;(function(r){r.Tape={defaultName:"Tape",defaultIcon:$e.Tape,description:"Plays audio regions & clips",trackType:re.Audio,create:(i,n,o,a,s)=>yl.create(i,A.generate(),l=>{l.label.setValue(o),l.icon.setValue($e.toName(a)),l.flutter.setValue(.2),l.wow.setValue(.05),l.noise.setValue(.02),l.saturation.setValue(.5),l.host.refer(n)})},r.Nano={defaultName:"Nano",defaultIcon:$e.NanoWave,description:"Simple sampler",trackType:re.Notes,create:(i,n,o,a,s)=>{let l;if(Z(s))l=s;else{let u=A.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),p=5.34;l=i.findBox(u).unwrapOrElse(()=>Dr.create(i,u,d=>{d.fileName.setValue("Rhode"),d.endInSeconds.setValue(p)}))}return gl.create(i,A.generate(),u=>{u.label.setValue(o),u.icon.setValue($e.toName(a)),u.file.refer(l),u.host.refer(n)})}},r.Playfield={defaultName:"Playfield",defaultIcon:$e.Playfield,description:"Drum computer",trackType:re.Notes,create:(i,n,o,a,s)=>{let l=vl.create(i,A.generate(),u=>{u.label.setValue(o),u.icon.setValue($e.toName(a)),u.host.refer(n)});return Z(s)&&s.filter(({note:u,uuid:p,name:d,durationInSeconds:f,exclude:v})=>{let m=e(i,p,d,f);No.create(i,A.generate(),y=>{y.device.refer(l.samples),y.file.refer(m),y.index.setValue(u),y.exclude.setValue(v)})}),l}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:$e.Piano,description:"Classic subtractive synthesizer",trackType:re.Notes,create:(i,n,o,a,s)=>hl.create(i,A.generate(),l=>{l.label.setValue(o),l.icon.setValue($e.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(sn.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(n),l.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:$e.Midi,description:"MIDI Output",trackType:re.Notes,create:(i,n,o,a,s)=>fl.create(i,A.generate(),l=>{l.label.setValue(o),l.icon.setValue($e.toName(a)),l.host.refer(n)})},r.Soundfont={defaultName:"Soundfont",defaultIcon:$e.SoundFont,description:"Soundfont Player",trackType:re.Notes,create:(i,n,o,a,s)=>{s??(s={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let l=s.uuid,u=A.parse(l),p=t(i,u,s.name);return ml.create(i,A.generate(),d=>{d.label.setValue(o),d.icon.setValue($e.toName(a)),d.host.refer(n),d.file.refer(p)})}},r.Named={Vaporisateur:r.Vaporisateur,Playfield:r.Playfield,Nano:r.Nano,Tape:r.Tape,Soundfont:r.Soundfont,MIDIOutput:r.MIDIOutput};let e=(i,n,o,a)=>i.findBox(n).unwrapOrElse(()=>Dr.create(i,n,s=>{s.fileName.setValue(o),s.endInSeconds.setValue(a)})),t=(i,n,o)=>i.findBox(n).unwrapOrElse(()=>Yr.create(i,n,a=>a.fileName.setValue(o)))})(A1||(A1={}));var pa;(function(r){r.empty=i=>{let n=new $a(g.wrap(Ma.create)),o=new Date().toISOString();console.debug(`New Project created on ${o}`),n.beginTransaction();let a=dl.create(n,A.generate(),f=>{f.label.setValue("Groove Shuffle")}),s=al.create(n,A.generate(),f=>{f.groove.refer(a),f.created.setValue(o)}),l=Ii.create(n,A.generate(),f=>{f.collection.refer(s.audioBusses),f.label.setValue("Output"),f.icon.setValue($e.toName($e.SpeakerHeadphone)),f.color.setValue("hsl(189, 100%, 65%)")}),u=Xe.create(n,A.generate(),f=>{f.type.setValue(bt.Output),f.collection.refer(s.audioUnits),f.output.refer(s.outputDevice),f.index.setValue(0)});i.createOutputCompressor&&pl.create(n,A.generate(),f=>{f.label.setValue("Compressor"),f.index.setValue(0),f.host.refer(u.audioEffects),f.threshold.setValue(0),f.ratio.setValue(24)});let p=Da.create(n,A.generate());s.timeline.refer(p.root),l.output.refer(u.input);let d=[];if(i.createDefaultUser){let f=Ia.create(n,A.generate());f.root.refer(s.users),d.push(f)}return n.endTransaction(),{boxGraph:n,mandatoryBoxes:{rootBox:s,primaryAudioBus:l,primaryAudioOutputUnit:u,timelineBox:p,userInterfaceBoxes:d}}},r.encode=i=>{let n=Et.create();n.writeInt(1330660686),n.writeInt(2);let o=i.toArrayBuffer();return n.writeInt(o.byteLength),n.writeBytes(new Int8Array(o)),n.toArrayBuffer()},r.decode=i=>{let n=new ot(i);I(n.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),I(n.readInt()===2,"Deprecated Format");let o=n.readInt(),a=new Int8Array(o);n.readBytes(a);let s=new $a(g.wrap(Ma.create));return s.fromArrayBuffer(a.buffer),{boxGraph:s,mandatoryBoxes:r.findMandatoryBoxes(s)}},r.findMandatoryBoxes=i=>{let n=i.boxes().find(o=>o.accept({visitRootBox:()=>!0}));if(Z(n)){let o=Be(n.outputDevice.pointerHub.incoming().at(0)?.box,Xe),a=Be(o.input.pointerHub.incoming().at(0)?.box,Ii),s=Be(n.timeline.targetVertex.unwrap("TimelineBox not found").box,Da),l=n.users.pointerHub.incoming().map(({box:u})=>Be(u,Ia));return{rootBox:n,primaryAudioBus:a,primaryAudioOutputUnit:o,timelineBox:s,userInterfaceBoxes:l}}return N("Could not find mandatory boxes")}})(pa||(pa={}));var Xu;(function(r){let e=({graph:s},{graph:l})=>s===l,t=(s,l)=>s.index.getValue()-l.index.getValue(),i=s=>s.accept({visitTrackBox:l=>!0})===!0;r.extractAudioUnits=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:u,rootBox:p}},d={})=>{I(O.satisfy(s,e),"AudioUnits must share the same BoxGraph"),I(!d.includeAux&&!d.includeBus,"Options are not yet implemented");let f=d?.excludeTimeline===!0?i:mo.alwaysFalse,v=s.flatMap(y=>Array.from(y.graph.dependenciesOf(y,{alwaysFollowMandatory:!0,excludeBox:f}).boxes)).filter(y=>y.name!==ln.ClassName&&y.name!==Ra.ClassName),m=n(s,v,p.audioUnits.address.uuid,u.address.uuid);return o(m,l,s,v),a(m,s,p),console.debug("inTransaction",l.inTransaction()),s.map(y=>Be(p.graph.findBox(m.get(y.address.uuid).target).unwrap("Target Track has not been copied"),Xe))},r.extractRegions=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:u,rootBox:p}},d=0)=>{I(O.satisfy(s,e),"Region smust be from the same BoxGraph");let f=new Set(s),v=new Set,m=new Gs;s.forEach(W=>{let ne=Be(W.regions.targetVertex.unwrap().box,ir);v.add(ne);let se=Be(ne.tracks.targetVertex.unwrap().box,Xe);m.add(se,ne)}),console.debug(`Found ${m.keyCount()} audioUnits`),console.debug(`Found ${v.size} tracks`);let y=[...m.keys()],x=W=>De(W,ir)&&!v.has(W)||da.isRegionBox(W)&&!f.has(W),F=y.flatMap(W=>Array.from(W.graph.dependenciesOf(W,{excludeBox:x,alwaysFollowMandatory:!0}).boxes)).filter(W=>W.name!==ln.ClassName&&W.name!==Ra.ClassName),D=n(y,F,p.audioUnits.address.uuid,u.address.uuid);o(D,l,y,F),a(D,y,p),m.forEach((W,ne)=>[...ne].sort(t).forEach((se,J)=>{let fe=l.findBox(D.get(se.address.uuid).target).unwrap("Target Track has not been copied");Be(fe,ir).index.setValue(J)}));let R=s.reduce((W,ne)=>Math.min(W,ne.position.getValue()),Number.MAX_VALUE),T=d-R;s.forEach(W=>{let ne=l.findBox(D.get(W.address.uuid).target).unwrap("Target Track has not been copied"),se=da.asRegionBox(ne).position;se.setValue(se.getValue()+T)})};let n=(s,l,u,p)=>{let d=A.newSet(({source:f})=>f);return d.addMany([...s.filter(({output:{targetAddress:f}})=>f.nonEmpty()).map(f=>({source:f.output.targetAddress.unwrap().uuid,target:p})),...s.map(f=>({source:f.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:u})),...s.map(f=>({source:f.address.uuid,target:A.generate()})),...l.map(({address:{uuid:f},name:v})=>({source:f,target:v===Dr.ClassName||v===Yr.ClassName?f:A.generate()}))]),d},o=(s,l,u,p)=>{B.decodeWith({map:(d,f)=>f.map(v=>s.opt(v.uuid).match({none:()=>v,some:({target:m})=>v.moveTo(m)}))},()=>{u.forEach(d=>{let f=new ot(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;l.createBox(v,m,y=>y.read(f))}),p.forEach(d=>{let f=new ot(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;if((d instanceof Dr||d instanceof Yr)&&l.findBox(d.address.uuid).nonEmpty()){d.read(f);return}l.createBox(v,m,y=>y.read(f))})})},a=(s,l,u)=>l.toSorted(t).map(p=>Be(u.graph.findBox(s.get(p.address.uuid).target).unwrap("Target Track has not been copied"),Xe)).forEach(p=>nl.collectIndexedBoxes(u.audioUnits,Xe).toSorted((d,f)=>{let v=Yu[d.type.getValue()],m=Yu[f.type.getValue()],y=v-m;return y===0?f===p?-1:1:y}).forEach((d,f)=>d.index.setValue(f)))})(Xu||(Xu={}));var ha;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(ha||(ha={}));var _1;(function(r){r.decode=(e,t)=>{let i=new ot(e.slice(0,8));if(i.readInt()!==ha.MAGIC_HEADER_OPEN){Js.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(i.readInt()!==ha.FORMAT_VERSION){Js.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let n=new $a(g.wrap(Ma.create));try{n.fromArrayBuffer(e.slice(8))}catch(a){Js.info({headline:"Could Not Import Preset",message:String(a)}).then();return}let o=n.boxes().filter(a=>De(a,Xe)).filter(a=>a.type.getValue()!==bt.Output);Xu.extractAudioUnits(o,t,{excludeTimeline:!0}).filter(a=>a.type.getValue()!==bt.Output).forEach(a=>{let s=a.input.pointerHub.incoming().at(0)?.box;Z(s)&&a.capture.targetVertex.ifSome(({box:l})=>{l instanceof Fo?ir.create(t.boxGraph,A.generate(),u=>{u.index.setValue(0),u.type.setValue(re.Notes),u.target.refer(a),u.tracks.refer(a.tracks)}):l instanceof Bo&&ir.create(t.boxGraph,A.generate(),u=>{u.index.setValue(0),u.type.setValue(re.Audio),u.target.refer(a),u.tracks.refer(a.tracks)})})})},r.replaceAudioUnit=(e,t,i)=>{console.debug("ReplaceAudioUnit with preset...");let n=pa.empty({createDefaultUser:!1,createOutputCompressor:!1}),o=n.boxGraph,a=t.graph;o.beginTransaction(),r.decode(e,n),o.endTransaction();let s=X(n.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:y})=>Be(y,Xe)).find(y=>y.type.getValue()!==bt.Output),"Source has no audioUnitBox"),l=s.capture.targetVertex.mapOr(({box:y})=>y.name,""),u=t.capture.targetVertex.mapOr(({box:y})=>y.name,"");if(l!==u)return Rn.err("Cannot replace incompatible instruments");let p=i?.keepMIDIEffects!==!0,d=i?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",p),console.debug("replaceAudioEffects",d),X(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),p?t.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction()),d?t.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction());let f=y=>y.accept({visitTrackBox:x=>!0,visitCaptureMidiBox:x=>!0,visitCaptureAudioBox:x=>!0})===!0,v=A.newSet(({source:y})=>y),m=Array.from(o.dependenciesOf(s,{excludeBox:f,alwaysFollowMandatory:!1}).boxes);return v.addMany([{source:s.address.uuid,target:t.address.uuid},...m.map(({address:{uuid:y},name:x})=>({source:y,target:x===Dr.ClassName||x===Yr.ClassName?y:A.generate()}))]),B.decodeWith({map:(y,x)=>x.map(F=>v.opt(F.uuid).match({none:()=>F,some:({target:D})=>F.moveTo(D)}))},()=>{m.forEach(y=>{let x=new ot(y.toArrayBuffer()),F=y.name,D=v.get(y.address.uuid).target;if((y instanceof Dr||y instanceof Yr)&&a.findBox(y.address.uuid).nonEmpty()){y.read(x);return}a.createBox(F,D,R=>R.read(x))})}),Rn.Ok}})(_1||(_1={}));var P1;(function(r){r.encode=e=>{let t=Et.create();t.writeInt(ha.MAGIC_HEADER_OPEN),t.writeInt(ha.FORMAT_VERSION);let i=pa.empty({createOutputCompressor:!1,createDefaultUser:!1});return i.boxGraph.beginTransaction(),Xu.extractAudioUnits([e],i,{excludeTimeline:!0}),i.boxGraph.endTransaction(),console.debug("SAVING..."),i.boxGraph.debugBoxes(),O.concatArrayBuffers(t.toArrayBuffer(),i.boxGraph.toArrayBuffer())}})(P1||(P1={}));var S1;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let i=X(Be(t,Xe).input.pointerHub.incoming().at(0)).box;return"label"in i&&i.label instanceof C?i.label.getValue():"N/A"})})(S1||(S1={}));var St={};Aa(St,{$brand:()=>Gg,$input:()=>rA,$output:()=>tA,NEVER:()=>Rw,TimePrecision:()=>aA,ZodAny:()=>iE,ZodArray:()=>sE,ZodBase64:()=>S_,ZodBase64URL:()=>E_,ZodBigInt:()=>Ah,ZodBigIntFormat:()=>N_,ZodBoolean:()=>bh,ZodCIDRv4:()=>__,ZodCIDRv6:()=>P_,ZodCUID:()=>g_,ZodCUID2:()=>v_,ZodCatch:()=>EE,ZodCodec:()=>V_,ZodCustom:()=>ty,ZodCustomStringFormat:()=>xh,ZodDate:()=>Yv,ZodDefault:()=>wE,ZodDiscriminatedUnion:()=>lE,ZodE164:()=>B_,ZodEmail:()=>h_,ZodEmoji:()=>f_,ZodEnum:()=>vh,ZodError:()=>ik,ZodFile:()=>vE,ZodFirstPartyTypeKind:()=>z_,ZodFunction:()=>CE,ZodGUID:()=>Gv,ZodIPv4:()=>b_,ZodIPv6:()=>A_,ZodISODate:()=>Lv,ZodISODateTime:()=>jv,ZodISODuration:()=>Wv,ZodISOTime:()=>Kv,ZodIntersection:()=>uE,ZodIssueCode:()=>v$,ZodJWT:()=>F_,ZodKSUID:()=>w_,ZodLazy:()=>ME,ZodLiteral:()=>gE,ZodMAC:()=>JS,ZodMap:()=>fE,ZodNaN:()=>FE,ZodNanoID:()=>m_,ZodNever:()=>oE,ZodNonOptional:()=>R_,ZodNull:()=>tE,ZodNullable:()=>xE,ZodNumber:()=>wh,ZodNumberFormat:()=>fc,ZodObject:()=>ey,ZodOptional:()=>T_,ZodPipe:()=>O_,ZodPrefault:()=>AE,ZodPromise:()=>DE,ZodReadonly:()=>NE,ZodRealError:()=>Br,ZodRecord:()=>I_,ZodSet:()=>mE,ZodString:()=>yh,ZodStringFormat:()=>qe,ZodSuccess:()=>SE,ZodSymbol:()=>XS,ZodTemplateLiteral:()=>$E,ZodTransform:()=>yE,ZodTuple:()=>dE,ZodType:()=>Ae,ZodULID:()=>y_,ZodURL:()=>Qv,ZodUUID:()=>ho,ZodUndefined:()=>eE,ZodUnion:()=>$_,ZodUnknown:()=>nE,ZodVoid:()=>aE,ZodXID:()=>x_,_ZodString:()=>p_,_default:()=>bE,_function:()=>l$,any:()=>jk,array:()=>Xv,base64:()=>Sk,base64url:()=>Ek,bigint:()=>Rk,boolean:()=>YS,catch:()=>BE,check:()=>u$,cidrv4:()=>_k,cidrv6:()=>Pk,clone:()=>dr,codec:()=>o$,coerce:()=>U_,config:()=>yt,core:()=>po,cuid:()=>mk,cuid2:()=>gk,custom:()=>c$,date:()=>Kk,decode:()=>i_,decodeAsync:()=>o_,describe:()=>d$,discriminatedUnion:()=>Hk,e164:()=>Bk,email:()=>ok,emoji:()=>hk,encode:()=>r_,encodeAsync:()=>n_,endsWith:()=>uh,enum:()=>D_,file:()=>t$,flattenError:()=>Wp,float32:()=>Ik,float64:()=>Dk,formatError:()=>Zp,function:()=>l$,getErrorMap:()=>x$,globalRegistry:()=>pr,gt:()=>co,gte:()=>Er,guid:()=>ak,hash:()=>Mk,hex:()=>$k,hostname:()=>kk,httpUrl:()=>pk,includes:()=>sh,instanceof:()=>h$,int:()=>d_,int32:()=>Ck,int64:()=>Ok,intersection:()=>cE,ipv4:()=>wk,ipv6:()=>Ak,iso:()=>Zv,json:()=>m$,jwt:()=>Fk,keyof:()=>Wk,ksuid:()=>xk,lazy:()=>IE,length:()=>dc,literal:()=>e$,locales:()=>eh,looseObject:()=>qk,lowercase:()=>oh,lt:()=>uo,lte:()=>Fi,mac:()=>bk,map:()=>Qk,maxLength:()=>cc,maxSize:()=>uc,meta:()=>p$,mime:()=>ch,minLength:()=>wa,minSize:()=>Rs,multipleOf:()=>Ts,nan:()=>n$,nanoid:()=>fk,nativeEnum:()=>Xk,negative:()=>CA,never:()=>k_,nonnegative:()=>RA,nonoptional:()=>PE,nonpositive:()=>TA,normalize:()=>dh,null:()=>rE,nullable:()=>Hv,nullish:()=>r$,number:()=>QS,object:()=>Zk,optional:()=>qv,overwrite:()=>Dn,parse:()=>YA,parseAsync:()=>XA,partialRecord:()=>Jk,pipe:()=>Jv,positive:()=>DA,prefault:()=>_E,preprocess:()=>g$,prettifyError:()=>Hw,promise:()=>s$,property:()=>OA,readonly:()=>kE,record:()=>hE,refine:()=>TE,regex:()=>nh,regexes:()=>Bi,registry:()=>bv,safeDecode:()=>s_,safeDecodeAsync:()=>u_,safeEncode:()=>a_,safeEncodeAsync:()=>l_,safeParse:()=>e_,safeParseAsync:()=>t_,set:()=>Yk,setErrorMap:()=>y$,size:()=>ih,slugify:()=>mh,startsWith:()=>lh,strictObject:()=>Gk,string:()=>c_,stringFormat:()=>Nk,stringbool:()=>f$,success:()=>i$,superRefine:()=>RE,symbol:()=>zk,templateLiteral:()=>a$,toJSONSchema:()=>GA,toLowerCase:()=>hh,toUpperCase:()=>fh,transform:()=>C_,treeifyError:()=>qw,trim:()=>ph,tuple:()=>pE,uint32:()=>Tk,uint64:()=>Vk,ulid:()=>vk,undefined:()=>Uk,union:()=>M_,unknown:()=>hc,uppercase:()=>ah,url:()=>dk,util:()=>j,uuid:()=>sk,uuidv4:()=>lk,uuidv6:()=>uk,uuidv7:()=>ck,void:()=>Lk,xid:()=>yk});var po={};Aa(po,{$ZodAny:()=>P0,$ZodArray:()=>N0,$ZodAsyncError:()=>Xi,$ZodBase64:()=>f0,$ZodBase64URL:()=>m0,$ZodBigInt:()=>mv,$ZodBigIntFormat:()=>w0,$ZodBoolean:()=>Jp,$ZodCIDRv4:()=>d0,$ZodCIDRv6:()=>p0,$ZodCUID:()=>Xb,$ZodCUID2:()=>e0,$ZodCatch:()=>Z0,$ZodCheck:()=>Ge,$ZodCheckBigIntFormat:()=>Nb,$ZodCheckEndsWith:()=>Ub,$ZodCheckGreaterThan:()=>lv,$ZodCheckIncludes:()=>Vb,$ZodCheckLengthEquals:()=>Cb,$ZodCheckLessThan:()=>sv,$ZodCheckLowerCase:()=>Rb,$ZodCheckMaxLength:()=>Ib,$ZodCheckMaxSize:()=>kb,$ZodCheckMimeType:()=>Lb,$ZodCheckMinLength:()=>Db,$ZodCheckMinSize:()=>$b,$ZodCheckMultipleOf:()=>Bb,$ZodCheckNumberFormat:()=>Fb,$ZodCheckOverwrite:()=>Kb,$ZodCheckProperty:()=>jb,$ZodCheckRegex:()=>Tb,$ZodCheckSizeEquals:()=>Mb,$ZodCheckStartsWith:()=>zb,$ZodCheckStringFormat:()=>sc,$ZodCheckUpperCase:()=>Ob,$ZodCodec:()=>Qp,$ZodCustom:()=>eA,$ZodCustomStringFormat:()=>y0,$ZodDate:()=>F0,$ZodDefault:()=>j0,$ZodDiscriminatedUnion:()=>$0,$ZodE164:()=>g0,$ZodEmail:()=>Hb,$ZodEmoji:()=>Qb,$ZodEncodeError:()=>fa,$ZodEnum:()=>T0,$ZodError:()=>Kp,$ZodFile:()=>O0,$ZodFunction:()=>Q0,$ZodGUID:()=>Gb,$ZodIPv4:()=>l0,$ZodIPv6:()=>u0,$ZodISODate:()=>o0,$ZodISODateTime:()=>n0,$ZodISODuration:()=>s0,$ZodISOTime:()=>a0,$ZodIntersection:()=>M0,$ZodJWT:()=>v0,$ZodKSUID:()=>i0,$ZodLazy:()=>X0,$ZodLiteral:()=>R0,$ZodMAC:()=>c0,$ZodMap:()=>D0,$ZodNaN:()=>G0,$ZodNanoID:()=>Yb,$ZodNever:()=>E0,$ZodNonOptional:()=>K0,$ZodNull:()=>_0,$ZodNullable:()=>U0,$ZodNumber:()=>fv,$ZodNumberFormat:()=>x0,$ZodObject:()=>Q1,$ZodObjectJIT:()=>k0,$ZodOptional:()=>z0,$ZodPipe:()=>q0,$ZodPrefault:()=>L0,$ZodPromise:()=>Y0,$ZodReadonly:()=>H0,$ZodRealError:()=>Sr,$ZodRecord:()=>I0,$ZodRegistry:()=>lc,$ZodSet:()=>C0,$ZodString:()=>Cs,$ZodStringFormat:()=>We,$ZodSuccess:()=>W0,$ZodSymbol:()=>b0,$ZodTemplateLiteral:()=>J0,$ZodTransform:()=>V0,$ZodTuple:()=>vv,$ZodType:()=>he,$ZodULID:()=>t0,$ZodURL:()=>Jb,$ZodUUID:()=>qb,$ZodUndefined:()=>A0,$ZodUnion:()=>gv,$ZodUnknown:()=>S0,$ZodVoid:()=>B0,$ZodXID:()=>r0,$brand:()=>Gg,$constructor:()=>b,$input:()=>rA,$output:()=>tA,Doc:()=>Hp,JSONSchema:()=>GS,JSONSchemaGenerator:()=>gh,NEVER:()=>Rw,TimePrecision:()=>aA,_any:()=>BA,_array:()=>VA,_base64:()=>Ov,_base64url:()=>Vv,_bigint:()=>wA,_boolean:()=>yA,_catch:()=>JN,_check:()=>ZS,_cidrv4:()=>Tv,_cidrv6:()=>Rv,_coercedBigint:()=>bA,_coercedBoolean:()=>xA,_coercedDate:()=>MA,_coercedNumber:()=>pA,_coercedString:()=>nA,_cuid:()=>Nv,_cuid2:()=>kv,_custom:()=>UA,_date:()=>$A,_decode:()=>Xg,_decodeAsync:()=>tv,_default:()=>GN,_discriminatedUnion:()=>CN,_e164:()=>zv,_email:()=>Av,_emoji:()=>Bv,_encode:()=>Yg,_encodeAsync:()=>ev,_endsWith:()=>uh,_enum:()=>UN,_file:()=>zA,_float32:()=>fA,_float64:()=>mA,_gt:()=>co,_gte:()=>Er,_guid:()=>th,_includes:()=>sh,_int:()=>hA,_int32:()=>gA,_int64:()=>AA,_intersection:()=>TN,_ipv4:()=>Dv,_ipv6:()=>Cv,_isoDate:()=>lA,_isoDateTime:()=>sA,_isoDuration:()=>cA,_isoTime:()=>uA,_jwt:()=>Uv,_ksuid:()=>Iv,_lazy:()=>ek,_length:()=>dc,_literal:()=>LN,_lowercase:()=>oh,_lt:()=>uo,_lte:()=>Fi,_mac:()=>oA,_map:()=>VN,_max:()=>Fi,_maxLength:()=>cc,_maxSize:()=>uc,_mime:()=>ch,_min:()=>Er,_minLength:()=>wa,_minSize:()=>Rs,_multipleOf:()=>Ts,_nan:()=>IA,_nanoid:()=>Fv,_nativeEnum:()=>jN,_negative:()=>CA,_never:()=>NA,_nonnegative:()=>RA,_nonoptional:()=>qN,_nonpositive:()=>TA,_normalize:()=>dh,_null:()=>EA,_nullable:()=>ZN,_number:()=>dA,_optional:()=>WN,_overwrite:()=>Dn,_parse:()=>ic,_parseAsync:()=>nc,_pipe:()=>QN,_positive:()=>DA,_promise:()=>tk,_property:()=>OA,_readonly:()=>YN,_record:()=>ON,_refine:()=>jA,_regex:()=>nh,_safeDecode:()=>iv,_safeDecodeAsync:()=>ov,_safeEncode:()=>rv,_safeEncodeAsync:()=>nv,_safeParse:()=>oc,_safeParseAsync:()=>ac,_set:()=>zN,_size:()=>ih,_slugify:()=>mh,_startsWith:()=>lh,_string:()=>iA,_stringFormat:()=>pc,_stringbool:()=>ZA,_success:()=>HN,_superRefine:()=>LA,_symbol:()=>PA,_templateLiteral:()=>XN,_toLowerCase:()=>hh,_toUpperCase:()=>fh,_transform:()=>KN,_trim:()=>ph,_tuple:()=>RN,_uint32:()=>vA,_uint64:()=>_A,_ulid:()=>$v,_undefined:()=>SA,_union:()=>DN,_unknown:()=>FA,_uppercase:()=>ah,_url:()=>rh,_uuid:()=>_v,_uuidv4:()=>Pv,_uuidv6:()=>Sv,_uuidv7:()=>Ev,_void:()=>kA,_xid:()=>Mv,clone:()=>dr,config:()=>yt,decode:()=>eF,decodeAsync:()=>rF,describe:()=>KA,encode:()=>XB,encodeAsync:()=>tF,flattenError:()=>Wp,formatError:()=>Zp,globalConfig:()=>Rp,globalRegistry:()=>pr,isValidBase64:()=>h0,isValidBase64URL:()=>G1,isValidJWT:()=>q1,locales:()=>eh,meta:()=>WA,parse:()=>Jg,parseAsync:()=>Qg,prettifyError:()=>Hw,regexes:()=>Bi,registry:()=>bv,safeDecode:()=>nF,safeDecodeAsync:()=>aF,safeEncode:()=>iF,safeEncodeAsync:()=>oF,safeParse:()=>Jw,safeParseAsync:()=>Qw,toDotPath:()=>k1,toJSONSchema:()=>GA,treeifyError:()=>qw,util:()=>j,version:()=>Wb});var Rw=Object.freeze({status:"aborted"});function b(r,e,t){function i(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(r))return;s._zod.traits.add(r),e(s,l);let u=a.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let f=p[d];f in s||(s[f]=u[f].bind(s))}}let n=t?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:r});function a(s){var l;let u=t?.Parent?new o:this;i(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(r)}),Object.defineProperty(a,"name",{value:r}),a}var Gg=Symbol("zod_brand"),Xi=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},fa=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Rp={};function yt(r){return r&&Object.assign(Rp,r),Rp}var j={};Aa(j,{BIGINT_FORMAT_RANGES:()=>Gw,Class:()=>Vw,NUMBER_FORMAT_RANGES:()=>Zw,aborted:()=>xa,allowsEval:()=>jw,assert:()=>$B,assertEqual:()=>BB,assertIs:()=>NB,assertNever:()=>kB,assertNotEqual:()=>FB,assignProp:()=>ga,base64ToUint8Array:()=>B1,base64urlToUint8Array:()=>qB,cached:()=>tc,captureStackTrace:()=>Hg,cleanEnum:()=>GB,cleanRegex:()=>zp,clone:()=>dr,cloneDef:()=>IB,createTransparentProxy:()=>VB,defineLazy:()=>ke,esc:()=>qg,escapeRegex:()=>Ei,extend:()=>jB,finalizeIssue:()=>Gr,floatSafeRemainder:()=>zw,getElementAtPath:()=>DB,getEnumValues:()=>Vp,getLengthableOrigin:()=>Lp,getParsedType:()=>OB,getSizableOrigin:()=>jp,hexToUint8Array:()=>JB,isObject:()=>Is,isPlainObject:()=>ya,issue:()=>rc,joinValues:()=>k,jsonStringifyReplacer:()=>ec,merge:()=>KB,mergeDefs:()=>va,normalizeParams:()=>U,nullish:()=>ma,numKeys:()=>RB,objectClone:()=>MB,omit:()=>UB,optionalKeys:()=>Ww,partial:()=>WB,pick:()=>zB,prefixIssues:()=>Zr,primitiveTypes:()=>Kw,promiseAllObject:()=>CB,propertyKeyTypes:()=>Up,randomString:()=>TB,required:()=>ZB,safeExtend:()=>LB,shallowClone:()=>Lw,slugify:()=>Uw,stringifyPrimitive:()=>V,uint8ArrayToBase64:()=>F1,uint8ArrayToBase64url:()=>HB,uint8ArrayToHex:()=>QB,unwrapMessage:()=>Op});function BB(r){return r}function FB(r){return r}function NB(r){}function kB(r){throw new Error}function $B(r){}function Vp(r){let e=Object.values(r).filter(i=>typeof i=="number");return Object.entries(r).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function k(r,e="|"){return r.map(t=>V(t)).join(e)}function ec(r,e){return typeof e=="bigint"?e.toString():e}function tc(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function ma(r){return r==null}function zp(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function zw(r,e){let t=(r.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let l=i.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let o=t>n?t:n,a=Number.parseInt(r.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var E1=Symbol("evaluating");function ke(r,e,t){let i;Object.defineProperty(r,e,{get(){if(i!==E1)return i===void 0&&(i=E1,i=t()),i},set(n){Object.defineProperty(r,e,{value:n})},configurable:!0})}function MB(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function ga(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function va(...r){let e={};for(let t of r){let i=Object.getOwnPropertyDescriptors(t);Object.assign(e,i)}return Object.defineProperties({},e)}function IB(r){return va(r._zod.def)}function DB(r,e){return e?e.reduce((t,i)=>t?.[i],r):r}function CB(r){let e=Object.keys(r),t=e.map(i=>r[i]);return Promise.all(t).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function TB(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let i=0;i<r;i++)t+=e[Math.floor(Math.random()*e.length)];return t}function qg(r){return JSON.stringify(r)}function Uw(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Hg="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Is(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var jw=tc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function ya(r){if(Is(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(Is(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Lw(r){return ya(r)?{...r}:Array.isArray(r)?[...r]:r}function RB(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var OB=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}`)}},Up=new Set(["string","number","symbol"]),Kw=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ei(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(r,e,t){let i=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(i._zod.parent=r),i}function U(r){let e=r;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function VB(r){let e;return new Proxy({},{get(t,i,n){return e??(e=r()),Reflect.get(e,i,n)},set(t,i,n,o){return e??(e=r()),Reflect.set(e,i,n,o)},has(t,i){return e??(e=r()),Reflect.has(e,i)},deleteProperty(t,i){return e??(e=r()),Reflect.deleteProperty(e,i)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,i){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(t,i,n){return e??(e=r()),Reflect.defineProperty(e,i,n)}})}function V(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function Ww(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var Zw={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]},Gw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zB(r,e){let t=r._zod.def,i=va(r._zod.def,{get shape(){let n={};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=t.shape[o])}return ga(this,"shape",n),n},checks:[]});return dr(r,i)}function UB(r,e){let t=r._zod.def,i=va(r._zod.def,{get shape(){let n={...r._zod.def.shape};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return ga(this,"shape",n),n},checks:[]});return dr(r,i)}function jB(r,e){if(!ya(e))throw new Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let n=va(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return ga(this,"shape",o),o},checks:[]});return dr(r,n)}function LB(r,e){if(!ya(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let i={...r._zod.def.shape,...e};return ga(this,"shape",i),i},checks:r._zod.def.checks};return dr(r,t)}function KB(r,e){let t=va(r._zod.def,{get shape(){let i={...r._zod.def.shape,...e._zod.def.shape};return ga(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return dr(r,t)}function WB(r,e,t){let i=va(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=r?new r({type:"optional",innerType:n[a]}):n[a])}else for(let a in n)o[a]=r?new r({type:"optional",innerType:n[a]}):n[a];return ga(this,"shape",o),o},checks:[]});return dr(e,i)}function ZB(r,e,t){let i=va(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new r({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new r({type:"nonoptional",innerType:n[a]});return ga(this,"shape",o),o},checks:[]});return dr(e,i)}function xa(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 Zr(r,e){return e.map(t=>{var i;return(i=t).path??(i.path=[]),t.path.unshift(r),t})}function Op(r){return typeof r=="string"?r:r?.message}function Gr(r,e,t){let i={...r,path:r.path??[]};if(!r.message){let n=Op(r.inst?._zod.def?.error?.(r))??Op(e?.error?.(r))??Op(t.customError?.(r))??Op(t.localeError?.(r))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function jp(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function Lp(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function rc(...r){let[e,t,i]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}function GB(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function B1(r){let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function F1(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function qB(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return B1(e+t)}function HB(r){return F1(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JB(r){let e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=Number.parseInt(e.slice(i,i+2),16);return t}function QB(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var Vw=class{constructor(...e){}};var N1=(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,ec,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Kp=b("$ZodError",N1),Sr=b("$ZodError",N1,{Parent:Error});function Wp(r,e=t=>t.message){let t={},i=[];for(let n of r.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}function Zp(r,e=t=>t.message){let t={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let a=t,s=0;for(;s<o.path.length;){let l=o.path[s];s===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(e(o))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return i(r),t}function qw(r,e=t=>t.message){let t={errors:[]},i=(n,o=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>i({issues:u},l.path));else if(l.code==="invalid_key")i({issues:l.issues},l.path);else if(l.code==="invalid_element")i({issues:l.issues},l.path);else{let u=[...o,...l.path];if(u.length===0){t.errors.push(e(l));continue}let p=t,d=0;for(;d<u.length;){let f=u[d],v=d===u.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),v&&p.errors.push(e(l)),d++}}};return i(r),t}function k1(r){let e=[],t=r.map(i=>typeof i=="object"?i.key:i);for(let i of t)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Hw(r){let e=[],t=[...r.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of t)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${k1(i.path)}`);return e.join(`
|
|
4
|
+
`)}var ic=r=>(e,t,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new Xi;if(a.issues.length){let s=new(n?.Err??r)(a.issues.map(l=>Gr(l,o,yt())));throw Hg(s,n?.callee),s}return a.value},Jg=ic(Sr),nc=r=>async(e,t,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??r)(a.issues.map(l=>Gr(l,o,yt())));throw Hg(s,n?.callee),s}return a.value},Qg=nc(Sr),oc=r=>(e,t,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)throw new Xi;return o.issues.length?{success:!1,error:new(r??Kp)(o.issues.map(a=>Gr(a,n,yt())))}:{success:!0,data:o.value}},Jw=oc(Sr),ac=r=>async(e,t,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(a=>Gr(a,n,yt())))}:{success:!0,data:o.value}},Qw=ac(Sr),Yg=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ic(r)(e,t,n)},XB=Yg(Sr),Xg=r=>(e,t,i)=>ic(r)(e,t,i),eF=Xg(Sr),ev=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nc(r)(e,t,n)},tF=ev(Sr),tv=r=>async(e,t,i)=>nc(r)(e,t,i),rF=tv(Sr),rv=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return oc(r)(e,t,n)},iF=rv(Sr),iv=r=>(e,t,i)=>oc(r)(e,t,i),nF=iv(Sr),nv=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ac(r)(e,t,n)},oF=nv(Sr),ov=r=>async(e,t,i)=>ac(r)(e,t,i),aF=ov(Sr);var Bi={};Aa(Bi,{base64:()=>hb,base64url:()=>av,bigint:()=>xb,boolean:()=>Ab,browserEmail:()=>fF,cidrv4:()=>db,cidrv6:()=>pb,cuid:()=>Yw,cuid2:()=>Xw,date:()=>mb,datetime:()=>vb,domain:()=>vF,duration:()=>nb,e164:()=>fb,email:()=>ab,emoji:()=>sb,extendedDuration:()=>sF,guid:()=>ob,hex:()=>yF,hostname:()=>gF,html5Email:()=>dF,idnEmail:()=>hF,integer:()=>wb,ipv4:()=>lb,ipv6:()=>ub,ksuid:()=>rb,lowercase:()=>Sb,mac:()=>cb,md5_base64:()=>wF,md5_base64url:()=>bF,md5_hex:()=>xF,nanoid:()=>ib,null:()=>_b,number:()=>bb,rfc5322Email:()=>pF,sha1_base64:()=>_F,sha1_base64url:()=>PF,sha1_hex:()=>AF,sha256_base64:()=>EF,sha256_base64url:()=>BF,sha256_hex:()=>SF,sha384_base64:()=>NF,sha384_base64url:()=>kF,sha384_hex:()=>FF,sha512_base64:()=>MF,sha512_base64url:()=>IF,sha512_hex:()=>$F,string:()=>yb,time:()=>gb,ulid:()=>eb,undefined:()=>Pb,unicodeEmail:()=>$1,uppercase:()=>Eb,uuid:()=>Ds,uuid4:()=>lF,uuid6:()=>uF,uuid7:()=>cF,xid:()=>tb});var Yw=/^[cC][^\s-]{8,}$/,Xw=/^[0-9a-z]+$/,eb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tb=/^[0-9a-vA-V]{20}$/,rb=/^[A-Za-z0-9]{27}$/,ib=/^[a-zA-Z0-9_-]{21}$/,nb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sF=/^[-+]?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)?)??$/,ob=/^([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})$/,Ds=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)$/,lF=Ds(4),uF=Ds(6),cF=Ds(7),ab=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dF=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,pF=/^(([^<>()\[\]\\.,;:\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,}))$/,$1=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,hF=$1,fF=/^[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])?)*$/,mF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sb(){return new RegExp(mF,"u")}var lb=/^(?:(?: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])$/,ub=/^(([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}|:))$/,cb=r=>{let e=Ei(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},db=/^((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])$/,pb=/^(([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])$/,hb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,av=/^[A-Za-z0-9_-]*$/,gF=/^(?=.{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])?)*\.?$/,vF=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,fb=/^\+(?:[0-9]){6,14}[0-9]$/,M1="(?:(?:\\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])))",mb=new RegExp(`^${M1}$`);function I1(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 gb(r){return new RegExp(`^${I1(r)}$`)}function vb(r){let e=I1({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${t.join("|")})`;return new RegExp(`^${M1}T(?:${i})$`)}var yb=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},xb=/^-?\d+n?$/,wb=/^-?\d+$/,bb=/^-?\d+(?:\.\d+)?/,Ab=/^(?:true|false)$/i,_b=/^null$/i;var Pb=/^undefined$/i;var Sb=/^[^A-Z]*$/,Eb=/^[^a-z]*$/,yF=/^[0-9a-fA-F]*$/;function Gp(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function qp(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var xF=/^[0-9a-fA-F]{32}$/,wF=Gp(22,"=="),bF=qp(22),AF=/^[0-9a-fA-F]{40}$/,_F=Gp(27,"="),PF=qp(27),SF=/^[0-9a-fA-F]{64}$/,EF=Gp(43,"="),BF=qp(43),FF=/^[0-9a-fA-F]{96}$/,NF=Gp(64,""),kF=qp(64),$F=/^[0-9a-fA-F]{128}$/,MF=Gp(86,"=="),IF=qp(86);var Ge=b("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),C1={number:"number",bigint:"bigint",object:"date"},sv=b("$ZodCheckLessThan",(r,e)=>{Ge.init(r,e);let t=C1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:t,code:"too_big",maximum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),lv=b("$ZodCheckGreaterThan",(r,e)=>{Ge.init(r,e);let t=C1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Bb=b("$ZodCheckMultipleOf",(r,e)=>{Ge.init(r,e),r._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.multipleOf=e.value)}),r._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):zw(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})}}),Fb=b("$ZodCheckNumberFormat",(r,e)=>{Ge.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),i=t?"int":"number",[n,o]=Zw[e.format];r._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=n,s.maximum=o,t&&(s.pattern=wb)}),r._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:s,inst:r});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:i,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:i,continue:!e.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:r,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inst:r})}}),Nb=b("$ZodCheckBigIntFormat",(r,e)=>{Ge.init(r,e);let[t,i]=Gw[e.format];r._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=t,o.maximum=i}),r._zod.check=n=>{let o=n.value;o<t&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:r})}}),kb=b("$ZodCheckMaxSize",(r,e)=>{var t;Ge.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!ma(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:jp(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),$b=b("$ZodCheckMinSize",(r,e)=>{var t;Ge.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!ma(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:jp(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Mb=b("$ZodCheckSizeEquals",(r,e)=>{var t;Ge.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!ma(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),r._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let a=o>e.size;i.issues.push({origin:jp(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),Ib=b("$ZodCheckMaxLength",(r,e)=>{var t;Ge.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!ma(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let a=Lp(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Db=b("$ZodCheckMinLength",(r,e)=>{var t;Ge.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!ma(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let a=Lp(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Cb=b("$ZodCheckLengthEquals",(r,e)=>{var t;Ge.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!ma(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),r._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let a=Lp(n),s=o>e.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),sc=b("$ZodCheckStringFormat",(r,e)=>{var t,i;Ge.init(r,e),r._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(i=r._zod).check??(i.check=()=>{})}),Tb=b("$ZodCheckRegex",(r,e)=>{sc.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})}}),Rb=b("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=Sb),sc.init(r,e)}),Ob=b("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=Eb),sc.init(r,e)}),Vb=b("$ZodCheckIncludes",(r,e)=>{Ge.init(r,e);let t=Ei(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,r._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),r._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:r,continue:!e.abort})}}),zb=b("$ZodCheckStartsWith",(r,e)=>{Ge.init(r,e);let t=new RegExp(`^${Ei(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:r,continue:!e.abort})}}),Ub=b("$ZodCheckEndsWith",(r,e)=>{Ge.init(r,e);let t=new RegExp(`.*${Ei(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:r,continue:!e.abort})}});function D1(r,e,t){r.issues.length&&e.issues.push(...Zr(t,r.issues))}var jb=b("$ZodCheckProperty",(r,e)=>{Ge.init(r,e),r._zod.check=t=>{let i=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>D1(n,t,e.property));D1(i,t,e.property)}}),Lb=b("$ZodCheckMimeType",(r,e)=>{Ge.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),r._zod.check=i=>{t.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:r,continue:!e.abort})}}),Kb=b("$ZodCheckOverwrite",(r,e)=>{Ge.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var Hp=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
5
|
+
`).filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...t,n.join(`
|
|
6
|
+
`))}};var Wb={major:4,minor:1,patch:13};var he=b("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=Wb;let i=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&i.unshift(r);for(let n of i)for(let o of n._zod.onattach)o(r);if(i.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let n=(a,s,l)=>{let u=xa(a),p;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,v=d._zod.check(a);if(v instanceof Promise&&l?.async===!1)throw new Xi;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,a.issues.length!==f&&(u||(u=xa(a,f)))});else{if(a.issues.length===f)continue;u||(u=xa(a,f))}}return p?p.then(()=>a):a},o=(a,s,l)=>{if(xa(a))return a.aborted=!0,a;let u=n(s,i,l);if(u instanceof Promise){if(l.async===!1)throw new Xi;return u.then(p=>r._zod.parse(p,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(p=>o(p,a,s)):o(u,a,s)}let l=r._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Xi;return l.then(u=>n(u,i,s))}return n(l,i,s)}}r["~standard"]={validate:n=>{try{let o=Jw(r,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Qw(r,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Cs=b("$ZodString",(r,e)=>{he.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??yb(r._zod.bag),r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),We=b("$ZodStringFormat",(r,e)=>{sc.init(r,e),Cs.init(r,e)}),Gb=b("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=ob),We.init(r,e)}),qb=b("$ZodUUID",(r,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Ds(i))}else e.pattern??(e.pattern=Ds());We.init(r,e)}),Hb=b("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=ab),We.init(r,e)}),Jb=b("$ZodURL",(r,e)=>{We.init(r,e),r._zod.check=t=>{try{let i=t.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=n.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),Qb=b("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=sb()),We.init(r,e)}),Yb=b("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=ib),We.init(r,e)}),Xb=b("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=Yw),We.init(r,e)}),e0=b("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=Xw),We.init(r,e)}),t0=b("$ZodULID",(r,e)=>{e.pattern??(e.pattern=eb),We.init(r,e)}),r0=b("$ZodXID",(r,e)=>{e.pattern??(e.pattern=tb),We.init(r,e)}),i0=b("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=rb),We.init(r,e)}),n0=b("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=vb(e)),We.init(r,e)}),o0=b("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=mb),We.init(r,e)}),a0=b("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=gb(e)),We.init(r,e)}),s0=b("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=nb),We.init(r,e)}),l0=b("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=lb),We.init(r,e),r._zod.bag.format="ipv4"}),u0=b("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=ub),We.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})}}}),c0=b("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=cb(e.delimiter)),We.init(r,e),r._zod.bag.format="mac"}),d0=b("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=db),We.init(r,e)}),p0=b("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=pb),We.init(r,e),r._zod.check=t=>{let i=t.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function h0(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var f0=b("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=hb),We.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{h0(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function G1(r){if(!av.test(r))return!1;let e=r.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return h0(t)}var m0=b("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=av),We.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{G1(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),g0=b("$ZodE164",(r,e)=>{e.pattern??(e.pattern=fb),We.init(r,e)});function q1(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[i]=t;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var v0=b("$ZodJWT",(r,e)=>{We.init(r,e),r._zod.check=t=>{q1(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),y0=b("$ZodCustomStringFormat",(r,e)=>{We.init(r,e),r._zod.check=t=>{e.fn(t.value)||t.issues.push({code:"invalid_format",format:e.format,input:t.value,inst:r,continue:!e.abort})}}),fv=b("$ZodNumber",(r,e)=>{he.init(r,e),r._zod.pattern=r._zod.bag.pattern??bb,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let n=t.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return t;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:n,inst:r,...o?{received:o}:{}}),t}}),x0=b("$ZodNumberFormat",(r,e)=>{Fb.init(r,e),fv.init(r,e)}),Jp=b("$ZodBoolean",(r,e)=>{he.init(r,e),r._zod.pattern=Ab,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}let n=t.value;return typeof n=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:r}),t}}),mv=b("$ZodBigInt",(r,e)=>{he.init(r,e),r._zod.pattern=xb,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:r}),t}}),w0=b("$ZodBigIntFormat",(r,e)=>{Nb.init(r,e),mv.init(r,e)}),b0=b("$ZodSymbol",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:r}),t}}),A0=b("$ZodUndefined",(r,e)=>{he.init(r,e),r._zod.pattern=Pb,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:r}),t}}),_0=b("$ZodNull",(r,e)=>{he.init(r,e),r._zod.pattern=_b,r._zod.values=new Set([null]),r._zod.parse=(t,i)=>{let n=t.value;return n===null||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:r}),t}}),P0=b("$ZodAny",(r,e)=>{he.init(r,e),r._zod.parse=t=>t}),S0=b("$ZodUnknown",(r,e)=>{he.init(r,e),r._zod.parse=t=>t}),E0=b("$ZodNever",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),B0=b("$ZodVoid",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:r}),t}}),F0=b("$ZodDate",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let n=t.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:r}),t}});function R1(r,e,t){r.issues.length&&e.issues.push(...Zr(t,r.issues)),e.value[t]=r.value}var N0=b("$ZodArray",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!Array.isArray(n))return t.issues.push({expected:"array",code:"invalid_type",input:n,inst:r}),t;t.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let s=n[a],l=e.element._zod.run({value:s,issues:[]},i);l instanceof Promise?o.push(l.then(u=>R1(u,t,a))):R1(l,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function hv(r,e,t,i){r.issues.length&&e.issues.push(...Zr(t,r.issues)),r.value===void 0?t in i&&(e.value[t]=void 0):e.value[t]=r.value}function H1(r){let e=Object.keys(r.shape);for(let i of e)if(!r.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let t=Ww(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function J1(r,e,t,i,n,o){let a=[],s=n.keySet,l=n.catchall._zod,u=l.def.type;for(let p in e){if(s.has(p))continue;if(u==="never"){a.push(p);continue}let d=l.run({value:e[p],issues:[]},i);d instanceof Promise?r.push(d.then(f=>hv(f,t,p,e))):hv(d,t,p,e)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var Q1=b("$ZodObject",(r,e)=>{if(he.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let l={...s};return Object.defineProperty(e,"shape",{value:l}),l}})}let i=tc(()=>H1(e));ke(r._zod,"propValues",()=>{let s=e.shape,l={};for(let u in s){let p=s[u]._zod;if(p.values){l[u]??(l[u]=new Set);for(let d of p.values)l[u].add(d)}}return l});let n=Is,o=e.catchall,a;r._zod.parse=(s,l)=>{a??(a=i.value);let u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:r}),s;s.value={};let p=[],d=a.shape;for(let f of a.keys){let m=d[f]._zod.run({value:u[f],issues:[]},l);m instanceof Promise?p.push(m.then(y=>hv(y,s,f,u))):hv(m,s,f,u)}return o?J1(p,u,s,l,i.value,r):p.length?Promise.all(p).then(()=>s):s}}),k0=b("$ZodObjectJIT",(r,e)=>{Q1.init(r,e);let t=r._zod.parse,i=tc(()=>H1(e)),n=f=>{let v=new Hp(["shape","payload","ctx"]),m=i.value,y=R=>{let T=qg(R);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};v.write("const input = payload.value;");let x=Object.create(null),F=0;for(let R of m.keys)x[R]=`key_${F++}`;v.write("const newResult = {};");for(let R of m.keys){let T=x[R],W=qg(R);v.write(`const ${T} = ${y(R)};`),v.write(`
|
|
7
|
+
if (${T}.issues.length) {
|
|
8
|
+
payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
|
|
11
9
|
...iss,
|
|
12
|
-
path: iss.path ? [${
|
|
10
|
+
path: iss.path ? [${W}, ...iss.path] : [${W}]
|
|
13
11
|
})));
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
|
|
17
|
-
if (${
|
|
18
|
-
if (${
|
|
19
|
-
newResult[${
|
|
15
|
+
if (${T}.value === undefined) {
|
|
16
|
+
if (${W} in input) {
|
|
17
|
+
newResult[${W}] = undefined;
|
|
20
18
|
}
|
|
21
19
|
} else {
|
|
22
|
-
newResult[${
|
|
20
|
+
newResult[${W}] = ${T}.value;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");let D=v.compile();return(V,K)=>D(f,V,K)},n,s=Ba,a=!ih.jitless,c=a&&Kx.value,d=e.catchall,h;r._zod.parse=(f,v)=>{h??(h=o.value);let g=f.value;return s(g)?a&&c&&v?.async===!1&&v.jitless!==!0?(n||(n=i(e.shape)),f=n(f,v),d?d1([],g,f,v,h,r):f):t(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:r}),f)}});function XP(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=>!gs(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=>Rr(s,o,mt())))}),e)}var Eg=w("$ZodUnion",(r,e)=>{de.init(r,e),Fe(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Fe(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Fe(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Fe(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=>sh(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 c=l._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(l=>XP(l,i,r,n)):XP(a,i,r,n)}}),Ib=w("$ZodDiscriminatedUnion",(r,e)=>{Eg.init(r,e);let t=r._zod.parse;Fe(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 c of l)i[a].add(c)}}return i});let o=Vc(()=>{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(!Ba(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)}}),Tb=w("$ZodIntersection",(r,e)=>{de.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,c])=>e1(t,l,c)):e1(t,n,s)}});function qw(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(ms(r)&&ms(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=qw(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=qw(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 e1(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),gs(r))return r;let o=qw(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 Sg=w("$ZodTuple",(r,e)=>{de.init(r,e);let t=e.items,o=t.length-[...t].reverse().findIndex(i=>i._zod.optin!=="optional");r._zod.parse=(i,n)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[];if(!e.rest){let c=s.length>t.length,d=s.length<o-1;if(c||d)return i.issues.push({...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:s,inst:r,origin:"array"}),i}let l=-1;for(let c of t){if(l++,l>=s.length&&l>=o)continue;let d=c._zod.run({value:s[l],issues:[]},n);d instanceof Promise?a.push(d.then(h=>yg(h,i,l))):yg(d,i,l)}if(e.rest){let c=s.slice(t.length);for(let d of c){l++;let h=e.rest._zod.run({value:d,issues:[]},n);h instanceof Promise?a.push(h.then(f=>yg(f,i,l))):yg(h,i,l)}}return a.length?Promise.all(a).then(()=>i):i}});function yg(r,e,t){r.issues.length&&e.issues.push(...Dr(t,r.issues)),e.value[t]=r.value}var Mb=w("$ZodRecord",(r,e)=>{de.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!ms(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),t;let n=[];if(e.keyType._zod.values){let s=e.keyType._zod.values;t.value={};for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let c=e.valueType._zod.run({value:i[l],issues:[]},o);c instanceof Promise?n.push(c.then(d=>{d.issues.length&&t.issues.push(...Dr(l,d.issues)),t.value[l]=d.value})):(c.issues.length&&t.issues.push(...Dr(l,c.issues)),t.value[l]=c.value)}let a;for(let l in i)s.has(l)||(a=a??[],a.push(l));a&&a.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:a})}else{t.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let a=e.keyType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(c=>Rr(c,o,mt())),input:s,path:[s],inst:r}),t.value[a.value]=a.value;continue}let l=e.valueType._zod.run({value:i[s],issues:[]},o);l instanceof Promise?n.push(l.then(c=>{c.issues.length&&t.issues.push(...Dr(s,c.issues)),t.value[a.value]=c.value})):(l.issues.length&&t.issues.push(...Dr(s,l.issues)),t.value[a.value]=l.value)}}return n.length?Promise.all(n).then(()=>t):t}}),Cb=w("$ZodMap",(r,e)=>{de.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),c=e.valueType._zod.run({value:a,issues:[]},o);l instanceof Promise||c instanceof Promise?n.push(Promise.all([l,c]).then(([d,h])=>{t1(d,h,t,s,i,r,o)})):t1(l,c,t,s,i,r,o)}return n.length?Promise.all(n).then(()=>t):t}});function t1(r,e,t,o,i,n,s){r.issues.length&&(ah.has(typeof o)?t.issues.push(...Dr(o,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:i,inst:n,issues:r.issues.map(a=>Rr(a,s,mt()))})),e.issues.length&&(ah.has(typeof o)?t.issues.push(...Dr(o,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:i,inst:n,key:o,issues:e.issues.map(a=>Rr(a,s,mt()))})),t.value.set(r.value,e.value)}var Db=w("$ZodSet",(r,e)=>{de.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=>r1(l,t))):r1(a,t)}return n.length?Promise.all(n).then(()=>t):t}});function r1(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var Rb=w("$ZodEnum",(r,e)=>{de.init(r,e);let t=nh(e.entries),o=new Set(t);r._zod.values=o,r._zod.pattern=new RegExp(`^(${t.filter(i=>ah.has(typeof i)).map(i=>typeof i=="string"?yo(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}}),Ob=w("$ZodLiteral",(r,e)=>{if(de.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");r._zod.values=new Set(e.values),r._zod.pattern=new RegExp(`^(${e.values.map(t=>typeof t=="string"?yo(t):t?yo(t.toString()):String(t)).join("|")})$`),r._zod.parse=(t,o)=>{let i=t.value;return r._zod.values.has(i)||t.issues.push({code:"invalid_value",values:e.values,input:i,inst:r}),t}}),Vb=w("$ZodFile",(r,e)=>{de.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}}),zb=w("$ZodTransform",(r,e)=>{de.init(r,e),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new ds(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 ji;return t.value=i,t}});function i1(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var Ub=w("$ZodOptional",(r,e)=>{de.init(r,e),r._zod.optin="optional",r._zod.optout="optional",Fe(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Fe(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${sh(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=>i1(n,t.value)):i1(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,o)}}),jb=w("$ZodNullable",(r,e)=>{de.init(r,e),Fe(r._zod,"optin",()=>e.innerType._zod.optin),Fe(r._zod,"optout",()=>e.innerType._zod.optout),Fe(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${sh(t.source)}|null)$`):void 0}),Fe(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)}),Lb=w("$ZodDefault",(r,e)=>{de.init(r,e),r._zod.optin="optional",Fe(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=>o1(n,e)):o1(i,e)}});function o1(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var Kb=w("$ZodPrefault",(r,e)=>{de.init(r,e),r._zod.optin="optional",Fe(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))}),Wb=w("$ZodNonOptional",(r,e)=>{de.init(r,e),Fe(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=>n1(n,r)):n1(i,r)}});function n1(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 Zb=w("$ZodSuccess",(r,e)=>{de.init(r,e),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new ds("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)}}),Gb=w("$ZodCatch",(r,e)=>{de.init(r,e),Fe(r._zod,"optin",()=>e.innerType._zod.optin),Fe(r._zod,"optout",()=>e.innerType._zod.optout),Fe(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=>Rr(s,o,mt()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(n=>Rr(n,o,mt()))},input:t.value}),t.issues=[]),t)}}),qb=w("$ZodNaN",(r,e)=>{de.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)}),Hb=w("$ZodPipe",(r,e)=>{de.init(r,e),Fe(r._zod,"values",()=>e.in._zod.values),Fe(r._zod,"optin",()=>e.in._zod.optin),Fe(r._zod,"optout",()=>e.out._zod.optout),Fe(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=>xg(s,e.in,o)):xg(n,e.in,o)}let i=e.in._zod.run(t,o);return i instanceof Promise?i.then(n=>xg(n,e.out,o)):xg(i,e.out,o)}});function xg(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var vh=w("$ZodCodec",(r,e)=>{de.init(r,e),Fe(r._zod,"values",()=>e.in._zod.values),Fe(r._zod,"optin",()=>e.in._zod.optin),Fe(r._zod,"optout",()=>e.out._zod.optout),Fe(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=>wg(s,e,o)):wg(n,e,o)}else{let n=e.out._zod.run(t,o);return n instanceof Promise?n.then(s=>wg(s,e,o)):wg(n,e,o)}}});function wg(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=>bg(r,n,e.out,t)):bg(r,i,e.out,t)}else{let i=e.reverseTransform(r.value,r);return i instanceof Promise?i.then(n=>bg(r,n,e.in,t)):bg(r,i,e.in,t)}}function bg(r,e,t,o){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},o)}var Jb=w("$ZodReadonly",(r,e)=>{de.init(r,e),Fe(r._zod,"propValues",()=>e.innerType._zod.propValues),Fe(r._zod,"values",()=>e.innerType._zod.values),Fe(r._zod,"optin",()=>e.innerType._zod.optin),Fe(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(s1):s1(i)}});function s1(r){return r.value=Object.freeze(r.value),r}var Qb=w("$ZodTemplateLiteral",(r,e)=>{de.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||Zx.has(typeof o))t.push(yo(`${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)}),Yb=w("$ZodFunction",(r,e)=>(de.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?ng(r._def.input,o):o,n=Reflect.apply(t,this,i);return r._def.output?ng(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 sg(r._def.input,o):o,n=await Reflect.apply(t,this,i);return r._def.output?await sg(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 Sg({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)),Xb=w("$ZodPromise",(r,e)=>{de.init(r,e),r._zod.parse=(t,o)=>Promise.resolve(t.value).then(i=>e.innerType._zod.run({value:i,issues:[]},o))}),e0=w("$ZodLazy",(r,e)=>{de.init(r,e),Fe(r._zod,"innerType",()=>e.getter()),Fe(r._zod,"pattern",()=>r._zod.innerType._zod.pattern),Fe(r._zod,"propValues",()=>r._zod.innerType._zod.propValues),Fe(r._zod,"optin",()=>r._zod.innerType._zod.optin??void 0),Fe(r._zod,"optout",()=>r._zod.innerType._zod.optout??void 0),r._zod.parse=(t,o)=>r._zod.innerType._zod.run(t,o)}),t0=w("$ZodCustom",(r,e)=>{it.init(r,e),de.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=>a1(n,t,o,r));a1(i,t,o,r)}});function a1(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(zc(i))}}var wh={};As(wh,{ar:()=>p1,az:()=>f1,be:()=>g1,bg:()=>v1,ca:()=>y1,cs:()=>x1,da:()=>w1,de:()=>b1,en:()=>Ng,eo:()=>A1,es:()=>_1,fa:()=>P1,fi:()=>E1,fr:()=>S1,frCA:()=>N1,he:()=>F1,hu:()=>B1,id:()=>$1,is:()=>k1,it:()=>I1,ja:()=>T1,ka:()=>M1,kh:()=>C1,km:()=>Fg,ko:()=>D1,lt:()=>O1,mk:()=>V1,ms:()=>z1,nl:()=>U1,no:()=>j1,ota:()=>L1,pl:()=>W1,ps:()=>K1,pt:()=>Z1,ru:()=>q1,sl:()=>H1,sv:()=>J1,ta:()=>Q1,th:()=>Y1,tr:()=>X1,ua:()=>eE,uk:()=>Bg,ur:()=>tE,vi:()=>rE,yo:()=>nE,zhCN:()=>iE,zhTW:()=>oE});var oF=()=>{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 ${O(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: ${$(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":""}: ${$(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 p1(){return{localeError:oF()}}var nF=()=>{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 ${O(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$(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":""}: ${$(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 f1(){return{localeError:nF()}}function m1(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 sF=()=>{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 ${O(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 ${$(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),l=m1(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=m1(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"}: ${$(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 g1(){return{localeError:sF()}}var aF=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},lF=()=>{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 ${aF(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 ${O(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 ${$(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":""}: ${$(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 v1(){return{localeError:lF()}}var cF=()=>{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 ${O(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$(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":""}: ${$(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 y1(){return{localeError:cF()}}var uF=()=>{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 ${O(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$(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: ${$(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 x1(){return{localeError:uF()}}var dF=()=>{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 ${O(s.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${$(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=t(s.origin),c=o(s.origin);return l?`For stor: forventede ${c??"value"} ${l.verb} ${a} ${s.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=t(s.origin),c=o(s.origin);return l?`For lille: forventede ${c} ${l.verb} ${a} ${s.minimum.toString()} ${l.unit}`:`For lille: forventede ${c} 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"}: ${$(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 w1(){return{localeError:dF()}}var hF=()=>{let r={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(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 ${O(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$(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"}: ${$(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 b1(){return{localeError:hF()}}var pF=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},fF=()=>{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",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 ${pF(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${O(o.values[0])}`:`Invalid option: expected one of ${$(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":""}: ${$(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 Ng(){return{localeError:fF()}}var mF=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},gF=()=>{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 ${mF(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${O(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$(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":""}: ${$(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 A1(){return{localeError:gF()}}var vF=()=>{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 ${O(s.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=t(s.origin),c=o(s.origin);return l?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${a}${s.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=t(s.origin),c=o(s.origin);return l?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${a}${s.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} 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":""}: ${$(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 _1(){return{localeError:vF()}}var yF=()=>{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 ${O(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 ${$(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: ${$(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 P1(){return{localeError:yF()}}var xF=()=>{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 ${O(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$(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"}: ${$(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 E1(){return{localeError:xF()}}var wF=()=>{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 : ${O(i.values[0])} attendu`:`Option invalide : une valeur parmi ${$(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":""} : ${$(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 S1(){return{localeError:wF()}}var bF=()=>{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 ${O(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$(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":""} : ${$(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 N1(){return{localeError:bF()}}var AF=()=>{let r={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};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:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return i=>{switch(i.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${i.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${O(i.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${$(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${n}${i.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${n}${i.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${n.prefix}"`:n.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${n.suffix}"`:n.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${n.includes}"`:n.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${n.pattern}`:`${o[n.format]??i.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}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 ${i.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${i.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${i.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${$(i.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i.origin}`;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.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function F1(){return{localeError:AF()}}var _F=()=>{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 ${O(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$(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":""}: ${$(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 B1(){return{localeError:_F()}}var PF=()=>{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 ${O(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$(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":""}: ${$(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 $1(){return{localeError:PF()}}var EF=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},SF=()=>{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 ${EF(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 ${O(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${$(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"}: ${$(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 k1(){return{localeError:SF()}}var NF=()=>{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 ${O(i.values[0])}`:`Opzione non valida: atteso uno tra ${$(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"}: ${$(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 I1(){return{localeError:NF()}}var FF=()=>{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: ${O(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$(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":""}: ${$(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 T1(){return{localeError:FF()}}var BF=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},$F=()=>{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 ${BF(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 ${O(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 ${$(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"}: ${$(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 M1(){return{localeError:$F()}}var kF=()=>{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 ${O(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 ${$(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 ${$(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 Fg(){return{localeError:kF()}}function C1(){return Fg()}var IF=()=>{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 ${O(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$(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: ${$(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 D1(){return{localeError:IF()}}var TF=r=>xh(typeof r,r),xh=(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},yh=r=>r.charAt(0).toUpperCase()+r.slice(1);function R1(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 MF=()=>{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 ${TF(o.input)}, o tik\u0117tasi - ${xh(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${O(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${$(o.values,"|")} pasirinkim\u0173`;case"too_big":{let i=xh(o.origin),n=e(o.origin,R1(Number(o.maximum)),o.inclusive??!1,"smaller");if(n?.verb)return`${yh(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`${yh(i??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${o.maximum.toString()} ${n?.unit}`}case"too_small":{let i=xh(o.origin),n=e(o.origin,R1(Number(o.minimum)),o.inclusive??!1,"bigger");if(n?.verb)return`${yh(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`${yh(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"}: ${$(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=xh(o.origin);return`${yh(i??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function O1(){return{localeError:MF()}}var CF=()=>{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 ${O(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 ${$(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"}: ${$(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 V1(){return{localeError:CF()}}var DF=()=>{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 ${O(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$(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: ${$(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 z1(){return{localeError:DF()}}var RF=()=>{let r={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};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 ${O(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Te lang: verwacht dat ${i.origin??"waarde"} ${n}${i.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${i.origin??"waarde"} ${n}${i.maximum.toString()} is`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Te kort: verwacht dat ${i.origin} ${n}${i.minimum.toString()} ${s.unit} bevat`:`Te kort: 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":""}: ${$(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 U1(){return{localeError:RF()}}var OF=()=>{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 ${O(i.values[0])}`:`Ugyldig valg: forventet en av ${$(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"}: ${$(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 j1(){return{localeError:OF()}}var VF=()=>{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 ${O(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$(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":""}: ${$(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 L1(){return{localeError:VF()}}var zF=()=>{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 ${O(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${$(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"}: ${$(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 K1(){return{localeError:zF()}}var UF=()=>{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 ${O(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$(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":""}: ${$(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 W1(){return{localeError:UF()}}var jF=()=>{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 ${O(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$(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":""}: ${$(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 Z1(){return{localeError:jF()}}function G1(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 LF=()=>{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 ${O(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 ${$(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),l=G1(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=G1(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":""}: ${$(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 q1(){return{localeError:LF()}}var KF=()=>{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 ${O(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$(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"}: ${$(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 H1(){return{localeError:KF()}}var WF=()=>{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 ${O(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$(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"}: ${$(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 J1(){return{localeError:WF()}}var ZF=()=>{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 ${O(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 ${$(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":""}: ${$(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 Q1(){return{localeError:ZF()}}var GF=()=>{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 ${O(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 ${$(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: ${$(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 Y1(){return{localeError:GF()}}var qF=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},HF=()=>{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 ${qF(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${O(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$(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":""}: ${$(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 X1(){return{localeError:HF()}}var JF=()=>{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 ${O(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 ${$(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":""}: ${$(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 Bg(){return{localeError:JF()}}function eE(){return Bg()}var QF=()=>{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: ${O(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$(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":""}: ${$(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 tE(){return{localeError:QF()}}var YF=()=>{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 ${O(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 ${$(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: ${$(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 rE(){return{localeError:YF()}}var XF=()=>{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 ${O(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$(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): ${$(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 iE(){return{localeError:XF()}}var eB=()=>{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 ${O(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$(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${$(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 oE(){return{localeError:eB()}}var tB=()=>{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 ${O(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${$(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: ${$(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 nE(){return{localeError:tB()}}var r0=Symbol("ZodOutput"),i0=Symbol("ZodInput"),Zc=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 $g(){return new Zc}var xo=$g();function o0(r,e){return new r({type:"string",...z(e)})}function n0(r,e){return new r({type:"string",coerce:!0,...z(e)})}function kg(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...z(e)})}function bh(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...z(e)})}function Ig(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...z(e)})}function Tg(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(e)})}function Mg(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(e)})}function Cg(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(e)})}function Ah(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...z(e)})}function Dg(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...z(e)})}function Rg(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(e)})}function Og(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...z(e)})}function Vg(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(e)})}function zg(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...z(e)})}function Ug(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...z(e)})}function jg(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(e)})}function Lg(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(e)})}function Kg(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(e)})}function Wg(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(e)})}function Zg(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(e)})}function Gg(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...z(e)})}function qg(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...z(e)})}function Hg(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...z(e)})}function Jg(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...z(e)})}var s0={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function a0(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(e)})}function l0(r,e){return new r({type:"string",format:"date",check:"string_format",...z(e)})}function c0(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...z(e)})}function u0(r,e){return new r({type:"string",format:"duration",check:"string_format",...z(e)})}function d0(r,e){return new r({type:"number",checks:[],...z(e)})}function h0(r,e){return new r({type:"number",coerce:!0,checks:[],...z(e)})}function p0(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...z(e)})}function f0(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...z(e)})}function m0(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...z(e)})}function g0(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...z(e)})}function v0(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...z(e)})}function y0(r,e){return new r({type:"boolean",...z(e)})}function x0(r,e){return new r({type:"boolean",coerce:!0,...z(e)})}function w0(r,e){return new r({type:"bigint",...z(e)})}function b0(r,e){return new r({type:"bigint",coerce:!0,...z(e)})}function A0(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(e)})}function _0(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(e)})}function P0(r,e){return new r({type:"symbol",...z(e)})}function E0(r,e){return new r({type:"undefined",...z(e)})}function S0(r,e){return new r({type:"null",...z(e)})}function N0(r){return new r({type:"any"})}function F0(r){return new r({type:"unknown"})}function B0(r,e){return new r({type:"never",...z(e)})}function $0(r,e){return new r({type:"void",...z(e)})}function k0(r,e){return new r({type:"date",...z(e)})}function I0(r,e){return new r({type:"date",coerce:!0,...z(e)})}function T0(r,e){return new r({type:"nan",...z(e)})}function Qo(r,e){return new gg({check:"less_than",...z(e),value:r,inclusive:!1})}function xi(r,e){return new gg({check:"less_than",...z(e),value:r,inclusive:!0})}function Yo(r,e){return new vg({check:"greater_than",...z(e),value:r,inclusive:!1})}function wr(r,e){return new vg({check:"greater_than",...z(e),value:r,inclusive:!0})}function M0(r){return Yo(0,r)}function C0(r){return Qo(0,r)}function D0(r){return xi(0,r)}function R0(r){return wr(0,r)}function Ia(r,e){return new Bw({check:"multiple_of",...z(e),value:r})}function Gc(r,e){return new Iw({check:"max_size",...z(e),maximum:r})}function Ta(r,e){return new Tw({check:"min_size",...z(e),minimum:r})}function _h(r,e){return new Mw({check:"size_equals",...z(e),size:r})}function qc(r,e){return new Cw({check:"max_length",...z(e),maximum:r})}function vs(r,e){return new Dw({check:"min_length",...z(e),minimum:r})}function Hc(r,e){return new Rw({check:"length_equals",...z(e),length:r})}function Ph(r,e){return new Ow({check:"string_format",format:"regex",...z(e),pattern:r})}function Eh(r){return new Vw({check:"string_format",format:"lowercase",...z(r)})}function Sh(r){return new zw({check:"string_format",format:"uppercase",...z(r)})}function Nh(r,e){return new Uw({check:"string_format",format:"includes",...z(e),includes:r})}function Fh(r,e){return new jw({check:"string_format",format:"starts_with",...z(e),prefix:r})}function Bh(r,e){return new Lw({check:"string_format",format:"ends_with",...z(e),suffix:r})}function O0(r,e,t){return new Kw({check:"property",property:r,schema:e,...z(t)})}function $h(r,e){return new Ww({check:"mime_type",mime:r,...z(e)})}function Xo(r){return new Zw({check:"overwrite",tx:r})}function kh(r){return Xo(e=>e.normalize(r))}function Ih(){return Xo(r=>r.trim())}function Th(){return Xo(r=>r.toLowerCase())}function Mh(){return Xo(r=>r.toUpperCase())}function V0(r,e,t){return new r({type:"array",element:e,...z(t)})}function rB(r,e,t){return new r({type:"union",options:e,...z(t)})}function iB(r,e,t,o){return new r({type:"union",options:t,discriminator:e,...z(o)})}function oB(r,e,t){return new r({type:"intersection",left:e,right:t})}function nB(r,e,t,o){let i=t instanceof de,n=i?o:t,s=i?t:null;return new r({type:"tuple",items:e,rest:s,...z(n)})}function sB(r,e,t,o){return new r({type:"record",keyType:e,valueType:t,...z(o)})}function aB(r,e,t,o){return new r({type:"map",keyType:e,valueType:t,...z(o)})}function lB(r,e,t){return new r({type:"set",valueType:e,...z(t)})}function cB(r,e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new r({type:"enum",entries:o,...z(t)})}function uB(r,e,t){return new r({type:"enum",entries:e,...z(t)})}function dB(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...z(t)})}function z0(r,e){return new r({type:"file",...z(e)})}function hB(r,e){return new r({type:"transform",transform:e})}function pB(r,e){return new r({type:"optional",innerType:e})}function fB(r,e){return new r({type:"nullable",innerType:e})}function mB(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Wx(t)}})}function gB(r,e,t){return new r({type:"nonoptional",innerType:e,...z(t)})}function vB(r,e){return new r({type:"success",innerType:e})}function yB(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function xB(r,e,t){return new r({type:"pipe",in:e,out:t})}function wB(r,e){return new r({type:"readonly",innerType:e})}function bB(r,e,t){return new r({type:"template_literal",parts:e,...z(t)})}function AB(r,e){return new r({type:"lazy",getter:e})}function _B(r,e){return new r({type:"promise",innerType:e})}function U0(r,e,t){let o=z(t);return o.abort??(o.abort=!0),new r({type:"custom",check:"custom",fn:e,...o})}function j0(r,e,t){return new r({type:"custom",check:"custom",fn:e,...z(t)})}function L0(r){let e=sE(t=>(t.addIssue=o=>{if(typeof o=="string")t.issues.push(zc(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(zc(i))}},r(t.value,t)));return e}function sE(r,e){let t=new it({check:"custom",...z(e)});return t._zod.check=r,t}function K0(r,e){let t=z(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(v=>typeof v=="string"?v.toLowerCase():v),i=i.map(v=>typeof v=="string"?v.toLowerCase():v));let n=new Set(o),s=new Set(i),a=r.Codec??vh,l=r.Boolean??gh,c=r.String??ka,d=new c({type:"string",error:t.error}),h=new l({type:"boolean",error:t.error}),f=new a({type:"pipe",in:d,out:h,transform:((v,g)=>{let y=v;return t.case!=="sensitive"&&(y=y.toLowerCase()),n.has(y)?!0:s.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...s],input:g.value,inst:f,continue:!1}),{})}),reverseTransform:((v,g)=>v===!0?o[0]||"true":i[0]||"false"),error:t.error});return f}function Jc(r,e,t,o={}){let i=z(o),n={...z(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)}var Ch=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??xo,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var o;let i=e._zod.def,n={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(e);if(s)return s.count++,t.schemaPath.includes(e)&&(s.cycle=t.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,a);let l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{let h={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)a.ref=f,this.process(f,h),this.seen.get(f).isParent=!0;else{let v=a.schema;switch(i.type){case"string":{let g=v;g.type="string";let{minimum:y,maximum:x,format:_,patterns:D,contentEncoding:V}=e._zod.bag;if(typeof y=="number"&&(g.minLength=y),typeof x=="number"&&(g.maxLength=x),_&&(g.format=n[_]??_,g.format===""&&delete g.format),V&&(g.contentEncoding=V),D&&D.size>0){let K=[...D];K.length===1?g.pattern=K[0].source:K.length>1&&(a.schema.allOf=[...K.map(H=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:H.source}))])}break}case"number":{let g=v,{minimum:y,maximum:x,format:_,multipleOf:D,exclusiveMaximum:V,exclusiveMinimum:K}=e._zod.bag;typeof _=="string"&&_.includes("int")?g.type="integer":g.type="number",typeof K=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(g.minimum=K,g.exclusiveMinimum=!0):g.exclusiveMinimum=K),typeof y=="number"&&(g.minimum=y,typeof K=="number"&&this.target!=="draft-4"&&(K>=y?delete g.minimum:delete g.exclusiveMinimum)),typeof V=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(g.maximum=V,g.exclusiveMaximum=!0):g.exclusiveMaximum=V),typeof x=="number"&&(g.maximum=x,typeof V=="number"&&this.target!=="draft-4"&&(V<=x?delete g.maximum:delete g.exclusiveMaximum)),typeof D=="number"&&(g.multipleOf=D);break}case"boolean":{let g=v;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(v.type="string",v.nullable=!0,v.enum=[null]):v.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{v.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let g=v,{minimum:y,maximum:x}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof x=="number"&&(g.maxItems=x),g.type="array",g.items=this.process(i.element,{...h,path:[...h.path,"items"]});break}case"object":{let g=v;g.type="object",g.properties={};let y=i.shape;for(let D in y)g.properties[D]=this.process(y[D],{...h,path:[...h.path,"properties",D]});let x=new Set(Object.keys(y)),_=new Set([...x].filter(D=>{let V=i.shape[D]._zod;return this.io==="input"?V.optin===void 0:V.optout===void 0}));_.size>0&&(g.required=Array.from(_)),i.catchall?._zod.def.type==="never"?g.additionalProperties=!1:i.catchall?i.catchall&&(g.additionalProperties=this.process(i.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=v,y=i.options.map((x,_)=>this.process(x,{...h,path:[...h.path,"anyOf",_]}));g.anyOf=y;break}case"intersection":{let g=v,y=this.process(i.left,{...h,path:[...h.path,"allOf",0]}),x=this.process(i.right,{...h,path:[...h.path,"allOf",1]}),_=V=>"allOf"in V&&Object.keys(V).length===1,D=[..._(y)?y.allOf:[y],..._(x)?x.allOf:[x]];g.allOf=D;break}case"tuple":{let g=v;g.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",_=i.items.map((H,be)=>this.process(H,{...h,path:[...h.path,y,be]})),D=i.rest?this.process(i.rest,{...h,path:[...h.path,x,...this.target==="openapi-3.0"?[i.items.length]:[]]}):null;this.target==="draft-2020-12"?(g.prefixItems=_,D&&(g.items=D)):this.target==="openapi-3.0"?(g.items={anyOf:_},D&&g.items.anyOf.push(D),g.minItems=_.length,D||(g.maxItems=_.length)):(g.items=_,D&&(g.additionalItems=D));let{minimum:V,maximum:K}=e._zod.bag;typeof V=="number"&&(g.minItems=V),typeof K=="number"&&(g.maxItems=K);break}case"record":{let g=v;g.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(g.propertyNames=this.process(i.keyType,{...h,path:[...h.path,"propertyNames"]})),g.additionalProperties=this.process(i.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=v,y=nh(i.entries);y.every(x=>typeof x=="number")&&(g.type="number"),y.every(x=>typeof x=="string")&&(g.type="string"),g.enum=y;break}case"literal":{let g=v,y=[];for(let x of i.values)if(x===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(x))}else y.push(x);if(y.length!==0)if(y.length===1){let x=y[0];g.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0"?g.enum=[x]:g.const=x}else y.every(x=>typeof x=="number")&&(g.type="number"),y.every(x=>typeof x=="string")&&(g.type="string"),y.every(x=>typeof x=="boolean")&&(g.type="string"),y.every(x=>x===null)&&(g.type="null"),g.enum=y;break}case"file":{let g=v,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:_,mime:D}=e._zod.bag;x!==void 0&&(y.minLength=x),_!==void 0&&(y.maxLength=_),D?D.length===1?(y.contentMediaType=D[0],Object.assign(g,y)):g.anyOf=D.map(V=>({...y,contentMediaType:V})):Object.assign(g,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(i.innerType,h);this.target==="openapi-3.0"?(a.ref=i.innerType,v.nullable=!0):v.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,h),a.ref=i.innerType;break}case"success":{let g=v;g.type="boolean";break}case"default":{this.process(i.innerType,h),a.ref=i.innerType,v.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,h),a.ref=i.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,h),a.ref=i.innerType;let g;try{g=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=v,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=y.source;break}case"pipe":{let g=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(g,h),a.ref=g;break}case"readonly":{this.process(i.innerType,h),a.ref=i.innerType,v.readOnly=!0;break}case"promise":{this.process(i.innerType,h),a.ref=i.innerType;break}case"optional":{this.process(i.innerType,h),a.ref=i.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,h),a.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),this.io==="input"&&It(e)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(e).schema}emit(e,t){let o={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},i=this.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=d=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){let y=o.external.registry.get(d[0])?.id,x=o.external.uri??(D=>D);if(y)return{ref:x(y)};let _=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=_,{defId:_,ref:`${x("__shared")}#/${h}/${_}`}}if(d[1]===i)return{ref:"#"};let v=`#/${h}/`,g=d[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:v+g}},s=d=>{if(d[1].schema.$ref)return;let h=d[1],{ref:f,defId:v}=n(d);h.def={...h.schema},v&&(h.defId=v);let g=h.schema;for(let y in g)delete g[y];g.$ref=f};if(o.cycles==="throw")for(let d of this.seen.entries()){let h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
23
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");let D=v.compile();return(R,T)=>D(f,R,T)},o,a=Is,s=!Rp.jitless,u=s&&jw.value,p=e.catchall,d;r._zod.parse=(f,v)=>{d??(d=i.value);let m=f.value;return a(m)?s&&u&&v?.async===!1&&v.jitless!==!0?(o||(o=n(e.shape)),f=o(f,v),p?J1([],m,f,v,d,r):f):t(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:r}),f)}});function O1(r,e,t,i){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let n=r.filter(o=>!xa(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(o=>o.issues.map(a=>Gr(a,i,yt())))}),e)}var gv=b("$ZodUnion",(r,e)=>{he.init(r,e),ke(r._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ke(r._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ke(r._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ke(r._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>zp(o.source)).join("|")})$`)}});let t=e.options.length===1,i=e.options[0]._zod.run;r._zod.parse=(n,o)=>{if(t)return i(n,o);let a=!1,s=[];for(let l of e.options){let u=l._zod.run({value:n.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=>O1(l,n,r,o)):O1(s,n,r,o)}}),$0=b("$ZodDiscriminatedUnion",(r,e)=>{gv.init(r,e);let t=r._zod.parse;ke(r._zod,"propValues",()=>{let n={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let u of l)n[s].add(u)}}return n});let i=tc(()=>{let n=e.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});r._zod.parse=(n,o)=>{let a=n.value;if(!Is(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:r}),n;let s=i.value.get(a?.[e.discriminator]);return s?s._zod.run(n,o):e.unionFallback?t(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:r}),n)}}),M0=b("$ZodIntersection",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,u])=>V1(t,l,u)):V1(t,o,a)}});function Zb(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(ya(r)&&ya(e)){let t=Object.keys(e),i=Object.keys(r).filter(o=>t.indexOf(o)!==-1),n={...r,...e};for(let o of i){let a=Zb(r[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let i=0;i<r.length;i++){let n=r[i],o=e[i],a=Zb(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function V1(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),xa(r))return r;let i=Zb(e.value,t.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return r.value=i.data,r}var vv=b("$ZodTuple",(r,e)=>{he.init(r,e);let t=e.items;r._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=[...t].reverse().findIndex(p=>p._zod.optin!=="optional"),l=s===-1?0:t.length-s;if(!e.rest){let p=o.length>t.length,d=o.length<l-1;if(p||d)return i.issues.push({...p?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:o,inst:r,origin:"array"}),i}let u=-1;for(let p of t){if(u++,u>=o.length&&u>=l)continue;let d=p._zod.run({value:o[u],issues:[]},n);d instanceof Promise?a.push(d.then(f=>uv(f,i,u))):uv(d,i,u)}if(e.rest){let p=o.slice(t.length);for(let d of p){u++;let f=e.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?a.push(f.then(v=>uv(v,i,u))):uv(f,i,u)}}return a.length?Promise.all(a).then(()=>i):i}});function uv(r,e,t){r.issues.length&&e.issues.push(...Zr(t,r.issues)),e.value[t]=r.value}var I0=b("$ZodRecord",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!ya(n))return t.issues.push({expected:"record",code:"invalid_type",input:n,inst:r}),t;let o=[],a=e.keyType._zod.values;if(a){t.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let p=e.valueType._zod.run({value:n[u],issues:[]},i);p instanceof Promise?o.push(p.then(d=>{d.issues.length&&t.issues.push(...Zr(u,d.issues)),t.value[u]=d.value})):(p.issues.length&&t.issues.push(...Zr(u,p.issues)),t.value[u]=p.value)}let l;for(let u in n)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:n,inst:r,keys:l})}else{t.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let l=e.keyType._zod.run({value:s,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Gr(p,i,yt())),input:s,path:[s],inst:r}),t.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:n[s],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&t.issues.push(...Zr(s,p.issues)),t.value[l.value]=p.value})):(u.issues.length&&t.issues.push(...Zr(s,u.issues)),t.value[l.value]=u.value)}}return o.length?Promise.all(o).then(()=>t):t}}),D0=b("$ZodMap",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:n,inst:r}),t;let o=[];t.value=new Map;for(let[a,s]of n){let l=e.keyType._zod.run({value:a,issues:[]},i),u=e.valueType._zod.run({value:s,issues:[]},i);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([p,d])=>{z1(p,d,t,a,n,r,i)})):z1(l,u,t,a,n,r,i)}return o.length?Promise.all(o).then(()=>t):t}});function z1(r,e,t,i,n,o,a){r.issues.length&&(Up.has(typeof i)?t.issues.push(...Zr(i,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:r.issues.map(s=>Gr(s,a,yt()))})),e.issues.length&&(Up.has(typeof i)?t.issues.push(...Zr(i,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(s=>Gr(s,a,yt()))})),t.value.set(r.value,e.value)}var C0=b("$ZodSet",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Set))return t.issues.push({input:n,inst:r,expected:"set",code:"invalid_type"}),t;let o=[];t.value=new Set;for(let a of n){let s=e.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(l=>U1(l,t))):U1(s,t)}return o.length?Promise.all(o).then(()=>t):t}});function U1(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var T0=b("$ZodEnum",(r,e)=>{he.init(r,e);let t=Vp(e.entries),i=new Set(t);r._zod.values=i,r._zod.pattern=new RegExp(`^(${t.filter(n=>Up.has(typeof n)).map(n=>typeof n=="string"?Ei(n):n.toString()).join("|")})$`),r._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:t,input:a,inst:r}),n}}),R0=b("$ZodLiteral",(r,e)=>{if(he.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let t=new Set(e.values);r._zod.values=t,r._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ei(i):i?Ei(i.toString()):String(i)).join("|")})$`),r._zod.parse=(i,n)=>{let o=i.value;return t.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:r}),i}}),O0=b("$ZodFile",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:r}),t}}),V0=b("$ZodTransform",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new fa(r.constructor.name);let n=e.transform(t.value,t);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(t.value=a,t));if(n instanceof Promise)throw new Xi;return t.value=n,t}});function j1(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var z0=b("$ZodOptional",(r,e)=>{he.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(`^(${zp(t.source)})?$`):void 0}),r._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>j1(o,t.value)):j1(n,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),U0=b("$ZodNullable",(r,e)=>{he.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(`^(${zp(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,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),j0=b("$ZodDefault",(r,e)=>{he.init(r,e),r._zod.optin="optional",ke(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>L1(o,e)):L1(n,e)}});function L1(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var L0=b("$ZodPrefault",(r,e)=>{he.init(r,e),r._zod.optin="optional",ke(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),K0=b("$ZodNonOptional",(r,e)=>{he.init(r,e),ke(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),r._zod.parse=(t,i)=>{let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>K1(o,r)):K1(n,r)}});function K1(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 W0=b("$ZodSuccess",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new fa("ZodSuccess");let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.issues.length===0,t)):(t.value=n.issues.length===0,t)}}),Z0=b("$ZodCatch",(r,e)=>{he.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,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>Gr(a,i,yt()))},input:t.value}),t.issues=[]),t)):(t.value=n.value,n.issues.length&&(t.value=e.catchValue({...t,error:{issues:n.issues.map(o=>Gr(o,i,yt()))},input:t.value}),t.issues=[]),t)}}),G0=b("$ZodNaN",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),q0=b("$ZodPipe",(r,e)=>{he.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,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>cv(a,e.in,i)):cv(o,e.in,i)}let n=e.in._zod.run(t,i);return n instanceof Promise?n.then(o=>cv(o,e.out,i)):cv(n,e.out,i)}});function cv(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var Qp=b("$ZodCodec",(r,e)=>{he.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,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(t,i);return o instanceof Promise?o.then(a=>dv(a,e,i)):dv(o,e,i)}else{let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>dv(a,e,i)):dv(o,e,i)}}});function dv(r,e,t){if(r.issues.length)return r.aborted=!0,r;if((t.direction||"forward")==="forward"){let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>pv(r,o,e.out,t)):pv(r,n,e.out,t)}else{let n=e.reverseTransform(r.value,r);return n instanceof Promise?n.then(o=>pv(r,o,e.in,t)):pv(r,n,e.in,t)}}function pv(r,e,t,i){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},i)}var H0=b("$ZodReadonly",(r,e)=>{he.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,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(W1):W1(n)}});function W1(r){return r.value=Object.freeze(r.value),r}var J0=b("$ZodTemplateLiteral",(r,e)=>{he.init(r,e);let t=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;t.push(n.slice(o,a))}else if(i===null||Kw.has(typeof i))t.push(Ei(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:r,expected:"template_literal",code:"invalid_type"}),i):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),i)}),Q0=b("$ZodFunction",(r,e)=>(he.init(r,e),r._def=e,r._zod.def=e,r.implement=t=>{if(typeof t!="function")throw new Error("implement() must be called with a function");return function(...i){let n=r._def.input?Jg(r._def.input,i):i,o=Reflect.apply(t,this,n);return r._def.output?Jg(r._def.output,o):o}},r.implementAsync=t=>{if(typeof t!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=r._def.input?await Qg(r._def.input,i):i,o=await Reflect.apply(t,this,n);return r._def.output?await Qg(r._def.output,o):o}},r._zod.parse=(t,i)=>typeof t.value!="function"?(t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:r}),t):(r._def.output&&r._def.output._zod.def.type==="promise"?t.value=r.implementAsync(t.value):t.value=r.implement(t.value),t),r.input=(...t)=>{let i=r.constructor;return Array.isArray(t[0])?new i({type:"function",input:new vv({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new i({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let i=r.constructor;return new i({type:"function",input:r._def.input,output:t})},r)),Y0=b("$ZodPromise",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>Promise.resolve(t.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),X0=b("$ZodLazy",(r,e)=>{he.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,i)=>r._zod.innerType._zod.run(t,i)}),eA=b("$ZodCustom",(r,e)=>{Ge.init(r,e),he.init(r,e),r._zod.parse=(t,i)=>t,r._zod.check=t=>{let i=t.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>Z1(o,t,i,r));Z1(n,t,i,r)}});function Z1(r,e,t,i){if(!r){let n={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(rc(n))}}var eh={};Aa(eh,{ar:()=>Y1,az:()=>X1,be:()=>tS,bg:()=>rS,ca:()=>iS,cs:()=>nS,da:()=>oS,de:()=>aS,en:()=>yv,eo:()=>sS,es:()=>lS,fa:()=>uS,fi:()=>cS,fr:()=>dS,frCA:()=>pS,he:()=>hS,hu:()=>fS,id:()=>mS,is:()=>gS,it:()=>vS,ja:()=>yS,ka:()=>xS,kh:()=>wS,km:()=>xv,ko:()=>bS,lt:()=>_S,mk:()=>PS,ms:()=>SS,nl:()=>ES,no:()=>BS,ota:()=>FS,pl:()=>kS,ps:()=>NS,pt:()=>$S,ru:()=>IS,sl:()=>DS,sv:()=>CS,ta:()=>TS,th:()=>RS,tr:()=>OS,ua:()=>VS,uk:()=>wv,ur:()=>zS,vi:()=>US,yo:()=>KS,zhCN:()=>jS,zhTW:()=>LS});var CF=()=>{let r={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return n=>{switch(n.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${V(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${i[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Y1(){return{localeError:CF()}}var TF=()=>{let r={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n.expected}, daxil olan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function X1(){return{localeError:TF()}}function eS(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var RF=()=>{let r={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=eS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=eS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function tS(){return{localeError:RF()}}var OF=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},VF=()=>{let r={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return r[i]??null}let t={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${OF(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${i.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${n.prefix}"`;if(n.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${n.suffix}"`;if(n.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${n.includes}"`;if(n.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${n.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return n.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),n.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${t[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${k(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function rS(){return{localeError:VF()}}var zF=()=>{let r={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${n.expected}, s'ha rebut ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${V(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${k(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=e(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function iS(){return{localeError:zF()}}var UF=()=>{let r={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n.expected}, obdr\u017Eeno ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${k(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function nS(){return{localeError:UF()}}var jF=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},e={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return s},o={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${i(a.expected)}, fik ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",l=t(a.origin),u=i(a.origin);return l?`For stor: forventede ${u??"value"} ${l.verb} ${s} ${a.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${u??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",l=t(a.origin),u=i(a.origin);return l?`For lille: forventede ${u} ${l.verb} ${s} ${a.minimum.toString()} ${l.unit}`:`For lille: forventede ${u} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${o[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${k(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function oS(){return{localeError:jF()}}var LF=()=>{let r={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${n.expected}, erhalten ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function aS(){return{localeError:LF()}}var KF=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},WF=()=>{let r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(i){return r[i]??null}let t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${KF(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${V(i.values[0])}`:`Invalid option: expected one of ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${t[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function yv(){return{localeError:WF()}}var ZF=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},GF=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return r[i]??null}let t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${i.expected}, ricevi\u011Dis ${ZF(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${t[n.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function sS(){return{localeError:GF()}}var qF=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},e={string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return s},o={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${i(a.expected)}, recibido ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(a.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",l=t(a.origin),u=i(a.origin);return l?`Demasiado grande: se esperaba que ${u??"valor"} tuviera ${s}${a.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${u??"valor"} fuera ${s}${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",l=t(a.origin),u=i(a.origin);return l?`Demasiado peque\xF1o: se esperaba que ${u} tuviera ${s}${a.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${u} fuera ${s}${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${o[s.format]??a.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${k(a.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i(a.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i(a.origin)}`;default:return"Entrada inv\xE1lida"}}};function lS(){return{localeError:qF()}}var HF=()=>{let r={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return n=>{switch(n.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${t(n.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${k(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${k(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function uS(){return{localeError:HF()}}var JF=()=>{let r={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${k(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function cS(){return{localeError:JF()}}var QF=()=>{let r={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : ${n.expected} attendu, ${t(n.input)} re\xE7u`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${V(n.values[0])} attendu`:`Option invalide : une valeur parmi ${k(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function dS(){return{localeError:QF()}}var YF=()=>{let r={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${n.expected}, re\xE7u ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${V(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=e(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=e(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function pS(){return{localeError:YF()}}var XF=()=>{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,i=u=>{let p=t(u);return p?p.label:u??r.unknown.label},n=u=>`\u05D4${i(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=u=>{let p=typeof u;switch(p){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 p}},l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}};return u=>{switch(u.code){case"invalid_type":{let p=u.expected,d=i(p),f=s(u.input),v=r[f]?.label??f;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${v}`}case"invalid_value":{if(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 ${V(u.values[0])}`;let p=u.values.map(v=>V(v));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 ${p[0]} \u05D0\u05D5 ${p[1]}`;let d=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let p=a(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${p?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let m=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: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=u.inclusive?"<=":"<",v=o(u.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${u.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${u.maximum.toString()}`}case"too_small":{let p=a(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${p?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let m=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: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=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: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let y=u.inclusive?`${u.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=u.inclusive?">=":">",v=o(u.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${u.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${u.minimum.toString()}`}case"invalid_format":{let p=u;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let d=l[p.format],f=d?.label??p.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${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${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function hS(){return{localeError:XF()}}var eN=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n.expected}, a kapott \xE9rt\xE9k ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function fS(){return{localeError:eN()}}var tN=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${V(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function mS(){return{localeError:tN()}}var rN=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},iN=()=>{let r={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return r[i]??null}let t={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return i=>{switch(i.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${rN(i.input)} \xFEar sem \xE1 a\xF0 vera ${i.expected}`;case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${n}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${n}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${t[n.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${k(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function gS(){return{localeError:iN()}}var nN=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${V(n.values[0])}`:`Opzione non valida: atteso uno tra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${k(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function vS(){return{localeError:nN()}}var oN=()=>{let r={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${t(n.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${k(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function yS(){return{localeError:oN()}}var aN=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},sN=()=>{let r={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return r[i]??null}let t={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return i=>{switch(i.code){case"invalid_type":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${aN(i.input)}`;case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${V(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${k(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${n}${i.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${o.verb} ${n}${i.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.prefix}"-\u10D8\u10D7`:n.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.suffix}"-\u10D8\u10D7`:n.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${n.includes}"-\u10E1`:n.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${n.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[n.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${k(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function xS(){return{localeError:sN()}}var lN=()=>{let r={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return n=>{switch(n.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${V(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${k(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function xv(){return{localeError:lN()}}function wS(){return xv()}var uN=()=>{let r={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return n=>{switch(n.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${t(n.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${k(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${k(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function bS(){return{localeError:uN()}}var cN=r=>Xp(typeof r,r),Xp=(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},Yp=r=>r.charAt(0).toUpperCase()+r.slice(1);function AS(r){let e=Math.abs(r),t=e%10,i=e%100;return i>=11&&i<=19||t===0?"many":t===1?"one":"few"}var dN=()=>{let r={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,n,o,a){let s=r[i]??null;return s===null?s:{unit:s.unit[n],verb:s.verb[a][o?"inclusive":"notInclusive"]}}let t={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"};return i=>{switch(i.code){case"invalid_type":return`Gautas tipas ${cN(i.input)}, o tik\u0117tasi - ${Xp(i.expected)}`;case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${V(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${k(i.values,"|")} pasirinkim\u0173`;case"too_big":{let n=Xp(i.origin),o=e(i.origin,AS(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${Yp(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Yp(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let n=Xp(i.origin),o=e(i.origin,AS(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${Yp(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Yp(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${n.prefix}"`:n.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${n.includes}"`:n.format==="regex"?`Eilut\u0117 privalo atitikti ${n.pattern}`:`Neteisingas ${t[n.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${k(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let n=Xp(i.origin);return`${Yp(n??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function _S(){return{localeError:dN()}}var pN=()=>{let r={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return n=>{switch(n.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${V(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function PS(){return{localeError:pN()}}var hN=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${V(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function SS(){return{localeError:hN()}}var fN=()=>{let r={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${V(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Te groot: verwacht dat ${n.origin??"waarde"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elementen"}`:`Te groot: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Te klein: verwacht dat ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Te klein: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function ES(){return{localeError:fN()}}var mN=()=>{let r={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${V(n.values[0])}`:`Ugyldig valg: forventet en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function BS(){return{localeError:mN()}}var gN=()=>{let r={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`F\xE2sit giren: umulan ${n.expected}, al\u0131nan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${V(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function FS(){return{localeError:gN()}}var vN=()=>{let r={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0627\u0631\u06D0";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return n=>{switch(n.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${t(n.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${k(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${i[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function NS(){return{localeError:vN()}}var yN=()=>{let r={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return n=>{switch(n.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n.expected}, otrzymano ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function kS(){return{localeError:yN()}}var xN=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${n.expected}, recebido ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${V(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${i[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function $S(){return{localeError:xN()}}function MS(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var wN=()=>{let r={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=MS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=MS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function IS(){return{localeError:wN()}}var bN=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${n.expected}, prejeto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${k(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function DS(){return{localeError:bN()}}var AN=()=>{let r={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${n.expected}, fick ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function CS(){return{localeError:AN()}}var _N=()=>{let r={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function TS(){return{localeError:_N()}}var PN=()=>{let r={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return n=>{switch(n.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${k(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function RS(){return{localeError:PN()}}var SN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},EN=()=>{let r={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return r[i]??null}let t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${SN(i.input)}`;case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[n.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${k(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function OS(){return{localeError:EN()}}var BN=()=>{let r={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${V(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function wv(){return{localeError:BN()}}function VS(){return wv()}var FN=()=>{let r={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return n=>{switch(n.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${t(n.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${k(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function zS(){return{localeError:FN()}}var NN=()=>{let r={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return n=>{switch(n.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${i[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${k(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function US(){return{localeError:NN()}}var kN=()=>{let r={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${i[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function jS(){return{localeError:kN()}}var $N=()=>{let r={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n.expected}\uFF0C\u4F46\u6536\u5230 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function LS(){return{localeError:$N()}}var MN=()=>{let r={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(n))return"akop\u1ECD";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return n=>{switch(n.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${i[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${k(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function KS(){return{localeError:MN()}}var WS,tA=Symbol("ZodOutput"),rA=Symbol("ZodInput"),lc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let i=t[0];if(this._map.set(e,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let i={...this.get(t)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function bv(){return new lc}(WS=globalThis).__zod_globalRegistry??(WS.__zod_globalRegistry=bv());var pr=globalThis.__zod_globalRegistry;function iA(r,e){return new r({type:"string",...U(e)})}function nA(r,e){return new r({type:"string",coerce:!0,...U(e)})}function Av(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...U(e)})}function th(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...U(e)})}function _v(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...U(e)})}function Pv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(e)})}function Sv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(e)})}function Ev(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(e)})}function rh(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...U(e)})}function Bv(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...U(e)})}function Fv(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(e)})}function Nv(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...U(e)})}function kv(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(e)})}function $v(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...U(e)})}function Mv(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...U(e)})}function Iv(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(e)})}function Dv(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(e)})}function Cv(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(e)})}function oA(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...U(e)})}function Tv(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(e)})}function Rv(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(e)})}function Ov(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...U(e)})}function Vv(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...U(e)})}function zv(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...U(e)})}function Uv(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...U(e)})}var aA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function sA(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(e)})}function lA(r,e){return new r({type:"string",format:"date",check:"string_format",...U(e)})}function uA(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...U(e)})}function cA(r,e){return new r({type:"string",format:"duration",check:"string_format",...U(e)})}function dA(r,e){return new r({type:"number",checks:[],...U(e)})}function pA(r,e){return new r({type:"number",coerce:!0,checks:[],...U(e)})}function hA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...U(e)})}function fA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...U(e)})}function mA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...U(e)})}function gA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...U(e)})}function vA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...U(e)})}function yA(r,e){return new r({type:"boolean",...U(e)})}function xA(r,e){return new r({type:"boolean",coerce:!0,...U(e)})}function wA(r,e){return new r({type:"bigint",...U(e)})}function bA(r,e){return new r({type:"bigint",coerce:!0,...U(e)})}function AA(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...U(e)})}function _A(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...U(e)})}function PA(r,e){return new r({type:"symbol",...U(e)})}function SA(r,e){return new r({type:"undefined",...U(e)})}function EA(r,e){return new r({type:"null",...U(e)})}function BA(r){return new r({type:"any"})}function FA(r){return new r({type:"unknown"})}function NA(r,e){return new r({type:"never",...U(e)})}function kA(r,e){return new r({type:"void",...U(e)})}function $A(r,e){return new r({type:"date",...U(e)})}function MA(r,e){return new r({type:"date",coerce:!0,...U(e)})}function IA(r,e){return new r({type:"nan",...U(e)})}function uo(r,e){return new sv({check:"less_than",...U(e),value:r,inclusive:!1})}function Fi(r,e){return new sv({check:"less_than",...U(e),value:r,inclusive:!0})}function co(r,e){return new lv({check:"greater_than",...U(e),value:r,inclusive:!1})}function Er(r,e){return new lv({check:"greater_than",...U(e),value:r,inclusive:!0})}function DA(r){return co(0,r)}function CA(r){return uo(0,r)}function TA(r){return Fi(0,r)}function RA(r){return Er(0,r)}function Ts(r,e){return new Bb({check:"multiple_of",...U(e),value:r})}function uc(r,e){return new kb({check:"max_size",...U(e),maximum:r})}function Rs(r,e){return new $b({check:"min_size",...U(e),minimum:r})}function ih(r,e){return new Mb({check:"size_equals",...U(e),size:r})}function cc(r,e){return new Ib({check:"max_length",...U(e),maximum:r})}function wa(r,e){return new Db({check:"min_length",...U(e),minimum:r})}function dc(r,e){return new Cb({check:"length_equals",...U(e),length:r})}function nh(r,e){return new Tb({check:"string_format",format:"regex",...U(e),pattern:r})}function oh(r){return new Rb({check:"string_format",format:"lowercase",...U(r)})}function ah(r){return new Ob({check:"string_format",format:"uppercase",...U(r)})}function sh(r,e){return new Vb({check:"string_format",format:"includes",...U(e),includes:r})}function lh(r,e){return new zb({check:"string_format",format:"starts_with",...U(e),prefix:r})}function uh(r,e){return new Ub({check:"string_format",format:"ends_with",...U(e),suffix:r})}function OA(r,e,t){return new jb({check:"property",property:r,schema:e,...U(t)})}function ch(r,e){return new Lb({check:"mime_type",mime:r,...U(e)})}function Dn(r){return new Kb({check:"overwrite",tx:r})}function dh(r){return Dn(e=>e.normalize(r))}function ph(){return Dn(r=>r.trim())}function hh(){return Dn(r=>r.toLowerCase())}function fh(){return Dn(r=>r.toUpperCase())}function mh(){return Dn(r=>Uw(r))}function VA(r,e,t){return new r({type:"array",element:e,...U(t)})}function DN(r,e,t){return new r({type:"union",options:e,...U(t)})}function CN(r,e,t,i){return new r({type:"union",options:t,discriminator:e,...U(i)})}function TN(r,e,t){return new r({type:"intersection",left:e,right:t})}function RN(r,e,t,i){let n=t instanceof he,o=n?i:t,a=n?t:null;return new r({type:"tuple",items:e,rest:a,...U(o)})}function ON(r,e,t,i){return new r({type:"record",keyType:e,valueType:t,...U(i)})}function VN(r,e,t,i){return new r({type:"map",keyType:e,valueType:t,...U(i)})}function zN(r,e,t){return new r({type:"set",valueType:e,...U(t)})}function UN(r,e,t){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new r({type:"enum",entries:i,...U(t)})}function jN(r,e,t){return new r({type:"enum",entries:e,...U(t)})}function LN(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...U(t)})}function zA(r,e){return new r({type:"file",...U(e)})}function KN(r,e){return new r({type:"transform",transform:e})}function WN(r,e){return new r({type:"optional",innerType:e})}function ZN(r,e){return new r({type:"nullable",innerType:e})}function GN(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Lw(t)}})}function qN(r,e,t){return new r({type:"nonoptional",innerType:e,...U(t)})}function HN(r,e){return new r({type:"success",innerType:e})}function JN(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function QN(r,e,t){return new r({type:"pipe",in:e,out:t})}function YN(r,e){return new r({type:"readonly",innerType:e})}function XN(r,e,t){return new r({type:"template_literal",parts:e,...U(t)})}function ek(r,e){return new r({type:"lazy",getter:e})}function tk(r,e){return new r({type:"promise",innerType:e})}function UA(r,e,t){let i=U(t);return i.abort??(i.abort=!0),new r({type:"custom",check:"custom",fn:e,...i})}function jA(r,e,t){return new r({type:"custom",check:"custom",fn:e,...U(t)})}function LA(r){let e=ZS(t=>(t.addIssue=i=>{if(typeof i=="string")t.issues.push(rc(i,t.value,e._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),t.issues.push(rc(n))}},r(t.value,t)));return e}function ZS(r,e){let t=new Ge({check:"custom",...U(e)});return t._zod.check=r,t}function KA(r){let e=new Ge({check:"describe"});return e._zod.onattach=[t=>{let i=pr.get(t)??{};pr.add(t,{...i,description:r})}],e._zod.check=()=>{},e}function WA(r){let e=new Ge({check:"meta"});return e._zod.onattach=[t=>{let i=pr.get(t)??{};pr.add(t,{...i,...r})}],e._zod.check=()=>{},e}function ZA(r,e){let t=U(e),i=t.truthy??["true","1","yes","on","y","enabled"],n=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(i=i.map(v=>typeof v=="string"?v.toLowerCase():v),n=n.map(v=>typeof v=="string"?v.toLowerCase():v));let o=new Set(i),a=new Set(n),s=r.Codec??Qp,l=r.Boolean??Jp,u=r.String??Cs,p=new u({type:"string",error:t.error}),d=new l({type:"boolean",error:t.error}),f=new s({type:"pipe",in:p,out:d,transform:((v,m)=>{let y=v;return t.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:a.has(y)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((v,m)=>v===!0?i[0]||"true":n[0]||"false"),error:t.error});return f}function pc(r,e,t,i={}){let n=U(i),o={...U(i),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:s=>t.test(s),...n};return t instanceof RegExp&&(o.pattern=t),new r(o)}var gh=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??pr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var i;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let l=e._zod.toJSONSchema?.();if(l)s.schema=l;else{let d={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,d),this.seen.get(f).isParent=!0;else{let v=s.schema;switch(n.type){case"string":{let m=v;m.type="string";let{minimum:y,maximum:x,format:F,patterns:D,contentEncoding:R}=e._zod.bag;if(typeof y=="number"&&(m.minLength=y),typeof x=="number"&&(m.maxLength=x),F&&(m.format=o[F]??F,m.format===""&&delete m.format),R&&(m.contentEncoding=R),D&&D.size>0){let T=[...D];T.length===1?m.pattern=T[0].source:T.length>1&&(s.schema.allOf=[...T.map(W=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:W.source}))])}break}case"number":{let m=v,{minimum:y,maximum:x,format:F,multipleOf:D,exclusiveMaximum:R,exclusiveMinimum:T}=e._zod.bag;typeof F=="string"&&F.includes("int")?m.type="integer":m.type="number",typeof T=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.minimum=T,m.exclusiveMinimum=!0):m.exclusiveMinimum=T),typeof y=="number"&&(m.minimum=y,typeof T=="number"&&this.target!=="draft-4"&&(T>=y?delete m.minimum:delete m.exclusiveMinimum)),typeof R=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.maximum=R,m.exclusiveMaximum=!0):m.exclusiveMaximum=R),typeof x=="number"&&(m.maximum=x,typeof R=="number"&&this.target!=="draft-4"&&(R<=x?delete m.maximum:delete m.exclusiveMaximum)),typeof D=="number"&&(m.multipleOf=D);break}case"boolean":{let m=v;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(v.type="string",v.nullable=!0,v.enum=[null]):v.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{v.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let m=v,{minimum:y,maximum:x}=e._zod.bag;typeof y=="number"&&(m.minItems=y),typeof x=="number"&&(m.maxItems=x),m.type="array",m.items=this.process(n.element,{...d,path:[...d.path,"items"]});break}case"object":{let m=v;m.type="object",m.properties={};let y=n.shape;for(let D in y)m.properties[D]=this.process(y[D],{...d,path:[...d.path,"properties",D]});let x=new Set(Object.keys(y)),F=new Set([...x].filter(D=>{let R=n.shape[D]._zod;return this.io==="input"?R.optin===void 0:R.optout===void 0}));F.size>0&&(m.required=Array.from(F)),n.catchall?._zod.def.type==="never"?m.additionalProperties=!1:n.catchall?n.catchall&&(m.additionalProperties=this.process(n.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{let m=v,y=n.discriminator!==void 0,x=n.options.map((F,D)=>this.process(F,{...d,path:[...d.path,y?"oneOf":"anyOf",D]}));y?m.oneOf=x:m.anyOf=x;break}case"intersection":{let m=v,y=this.process(n.left,{...d,path:[...d.path,"allOf",0]}),x=this.process(n.right,{...d,path:[...d.path,"allOf",1]}),F=R=>"allOf"in R&&Object.keys(R).length===1,D=[...F(y)?y.allOf:[y],...F(x)?x.allOf:[x]];m.allOf=D;break}case"tuple":{let m=v;m.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",F=n.items.map((W,ne)=>this.process(W,{...d,path:[...d.path,y,ne]})),D=n.rest?this.process(n.rest,{...d,path:[...d.path,x,...this.target==="openapi-3.0"?[n.items.length]:[]]}):null;this.target==="draft-2020-12"?(m.prefixItems=F,D&&(m.items=D)):this.target==="openapi-3.0"?(m.items={anyOf:F},D&&m.items.anyOf.push(D),m.minItems=F.length,D||(m.maxItems=F.length)):(m.items=F,D&&(m.additionalItems=D));let{minimum:R,maximum:T}=e._zod.bag;typeof R=="number"&&(m.minItems=R),typeof T=="number"&&(m.maxItems=T);break}case"record":{let m=v;m.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(m.propertyNames=this.process(n.keyType,{...d,path:[...d.path,"propertyNames"]})),m.additionalProperties=this.process(n.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let m=v,y=Vp(n.entries);y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),m.enum=y;break}case"literal":{let m=v,y=[];for(let x of n.values)if(x===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(x))}else y.push(x);if(y.length!==0)if(y.length===1){let x=y[0];m.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0"?m.enum=[x]:m.const=x}else y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),y.every(x=>typeof x=="boolean")&&(m.type="string"),y.every(x=>x===null)&&(m.type="null"),m.enum=y;break}case"file":{let m=v,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:F,mime:D}=e._zod.bag;x!==void 0&&(y.minLength=x),F!==void 0&&(y.maxLength=F),D?D.length===1?(y.contentMediaType=D[0],Object.assign(m,y)):m.anyOf=D.map(R=>({...y,contentMediaType:R})):Object.assign(m,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(n.innerType,d);this.target==="openapi-3.0"?(s.ref=n.innerType,v.nullable=!0):v.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"success":{let m=v;m.type="boolean";break}case"default":{this.process(n.innerType,d),s.ref=n.innerType,v.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{this.process(n.innerType,d),s.ref=n.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break}case"catch":{this.process(n.innerType,d),s.ref=n.innerType;let m;try{m=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=v,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=y.source;break}case"pipe":{let m=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(m,d),s.ref=m;break}case"readonly":{this.process(n.innerType,d),s.ref=n.innerType,v.readOnly=!0;break}case"promise":{this.process(n.innerType,d),s.ref=n.innerType;break}case"optional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"lazy":{let m=e._zod.innerType;this.process(m,d),s.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),this.io==="input"&&hr(e)&&(delete s.schema.examples,delete s.schema.default),this.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let i={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=p=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let y=i.external.registry.get(p[0])?.id,x=i.external.uri??(D=>D);if(y)return{ref:x(y)};let F=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=F,{defId:F,ref:`${x("__shared")}#/${d}/${F}`}}if(p[1]===n)return{ref:"#"};let v=`#/${d}/`,m=p[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:v+m}},a=p=>{if(p[1].schema.$ref)return;let d=p[1],{ref:f,defId:v}=o(p);d.def={...d.schema},v&&(d.defId=v);let m=d.schema;for(let y in m)delete m[y];m.$ref=f};if(i.cycles==="throw")for(let p of this.seen.entries()){let d=p[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
26
24
|
|
|
27
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let h=d[1];if(e===d[0]){s(d);continue}if(o.external){let v=o.external.registry.get(d[0])?.id;if(e!==d[0]&&v){s(d);continue}}if(this.metadataRegistry.get(d[0])?.id){s(d);continue}if(h.cycle){s(d);continue}if(h.count>1&&o.reused==="ref"){s(d);continue}}let a=(d,h)=>{let f=this.seen.get(d),v=f.def??f.schema,g={...v};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){a(y,h);let x=this.seen.get(y).schema;x.$ref&&(h.target==="draft-7"||h.target==="draft-4"||h.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(x)):(Object.assign(v,x),Object.assign(v,g))}f.isParent||this.override({zodSchema:d,jsonSchema:v,path:f.path??[]})};for(let d of[...this.seen.entries()].reverse())a(d[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?l.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),o.external?.uri){let d=o.external.registry.get(e)?.id;if(!d)throw new Error("Schema is missing an `id` property");l.$id=o.external.uri(d)}Object.assign(l,i.def);let c=o.external?.defs??{};for(let d of this.seen.entries()){let h=d[1];h.def&&h.defId&&(c[h.defId]=h.def)}o.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}};function W0(r,e){if(r instanceof Zc){let o=new Ch(e),i={};for(let a of r._idmap.entries()){let[l,c]=a;o.process(c)}let n={},s={registry:r,uri:e?.uri,defs:i};for(let a of r._idmap.entries()){let[l,c]=a;n[l]=o.emit(c,{...e,external:s})}if(Object.keys(i).length>0){let a=o.target==="draft-2020-12"?"$defs":"definitions";n.__shared={[a]:i}}return{schemas:n}}let t=new Ch(e);return t.process(r),t.emit(r,e)}function It(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let i=r._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return It(i.element,t);case"object":{for(let n in i.shape)if(It(i.shape[n],t))return!0;return!1}case"union":{for(let n of i.options)if(It(n,t))return!0;return!1}case"intersection":return It(i.left,t)||It(i.right,t);case"tuple":{for(let n of i.items)if(It(n,t))return!0;return!!(i.rest&&It(i.rest,t))}case"record":return It(i.keyType,t)||It(i.valueType,t);case"map":return It(i.keyType,t)||It(i.valueType,t);case"set":return It(i.valueType,t);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return It(i.innerType,t);case"lazy":return It(i.getter(),t);case"default":return It(i.innerType,t);case"prefault":return It(i.innerType,t);case"custom":return!1;case"transform":return!0;case"pipe":return It(i.in,t)||It(i.out,t);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw new Error(`Unknown schema type: ${i.type}`)}var aE={};var tv={};As(tv,{ZodISODate:()=>Yg,ZodISODateTime:()=>Qg,ZodISODuration:()=>ev,ZodISOTime:()=>Xg,date:()=>G0,datetime:()=>Z0,duration:()=>H0,time:()=>q0});var Qg=w("ZodISODateTime",(r,e)=>{sb.init(r,e),Ye.init(r,e)});function Z0(r){return a0(Qg,r)}var Yg=w("ZodISODate",(r,e)=>{ab.init(r,e),Ye.init(r,e)});function G0(r){return l0(Yg,r)}var Xg=w("ZodISOTime",(r,e)=>{lb.init(r,e),Ye.init(r,e)});function q0(r){return c0(Xg,r)}var ev=w("ZodISODuration",(r,e)=>{cb.init(r,e),Ye.init(r,e)});function H0(r){return u0(ev,r)}var cE=(r,e)=>{uh.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>hh(r,t)},flatten:{value:t=>dh(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,Oc,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,Oc,2)}},isEmpty:{get(){return r.issues.length===0}}})},EB=w("ZodError",cE),br=w("ZodError",cE,{Parent:Error});var J0=Uc(br),Q0=jc(br),Y0=Lc(br),X0=Kc(br),eA=ag(br),tA=lg(br),rA=cg(br),iA=ug(br),oA=dg(br),nA=hg(br),sA=pg(br),aA=fg(br);var we=w("ZodType",(r,e)=>(de.init(r,e),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)=>J0(r,t,o,{callee:r.parse}),r.safeParse=(t,o)=>Y0(r,t,o),r.parseAsync=async(t,o)=>Q0(r,t,o,{callee:r.parseAsync}),r.safeParseAsync=async(t,o)=>X0(r,t,o),r.spa=r.safeParseAsync,r.encode=(t,o)=>eA(r,t,o),r.decode=(t,o)=>tA(r,t,o),r.encodeAsync=async(t,o)=>rA(r,t,o),r.decodeAsync=async(t,o)=>iA(r,t,o),r.safeEncode=(t,o)=>oA(r,t,o),r.safeDecode=(t,o)=>nA(r,t,o),r.safeEncodeAsync=async(t,o)=>sA(r,t,o),r.safeDecodeAsync=async(t,o)=>aA(r,t,o),r.refine=(t,o)=>r.check(HE(t,o)),r.superRefine=t=>r.check(JE(t)),r.overwrite=t=>r.check(Xo(t)),r.optional=()=>iv(r),r.nullable=()=>ov(r),r.nullish=()=>iv(ov(r)),r.nonoptional=t=>RE(r,t),r.array=()=>lv(r),r.or=t=>$A([r,t]),r.and=t=>_E(r,t),r.transform=t=>nv(r,TA(t)),r.default=t=>ME(r,t),r.prefault=t=>DE(r,t),r.catch=t=>zE(r,t),r.pipe=t=>nv(r,t),r.readonly=()=>LE(r),r.describe=t=>{let o=r.clone();return xo.add(o,{description:t}),o},Object.defineProperty(r,"description",{get(){return xo.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return xo.get(r);let o=r.clone();return xo.add(o,t[0]),o},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),uA=w("_ZodString",(r,e)=>{ka.init(r,e),we.init(r,e);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...o)=>r.check(Ph(...o)),r.includes=(...o)=>r.check(Nh(...o)),r.startsWith=(...o)=>r.check(Fh(...o)),r.endsWith=(...o)=>r.check(Bh(...o)),r.min=(...o)=>r.check(vs(...o)),r.max=(...o)=>r.check(qc(...o)),r.length=(...o)=>r.check(Hc(...o)),r.nonempty=(...o)=>r.check(vs(1,...o)),r.lowercase=o=>r.check(Eh(o)),r.uppercase=o=>r.check(Sh(o)),r.trim=()=>r.check(Ih()),r.normalize=(...o)=>r.check(kh(...o)),r.toLowerCase=()=>r.check(Th()),r.toUpperCase=()=>r.check(Mh())}),Rh=w("ZodString",(r,e)=>{ka.init(r,e),uA.init(r,e),r.email=t=>r.check(kg(dA,t)),r.url=t=>r.check(Ah(sv,t)),r.jwt=t=>r.check(Jg(SA,t)),r.emoji=t=>r.check(Dg(hA,t)),r.guid=t=>r.check(bh(rv,t)),r.uuid=t=>r.check(Ig(tn,t)),r.uuidv4=t=>r.check(Tg(tn,t)),r.uuidv6=t=>r.check(Mg(tn,t)),r.uuidv7=t=>r.check(Cg(tn,t)),r.nanoid=t=>r.check(Rg(pA,t)),r.guid=t=>r.check(bh(rv,t)),r.cuid=t=>r.check(Og(fA,t)),r.cuid2=t=>r.check(Vg(mA,t)),r.ulid=t=>r.check(zg(gA,t)),r.base64=t=>r.check(Gg(_A,t)),r.base64url=t=>r.check(qg(PA,t)),r.xid=t=>r.check(Ug(vA,t)),r.ksuid=t=>r.check(jg(yA,t)),r.ipv4=t=>r.check(Lg(xA,t)),r.ipv6=t=>r.check(Kg(wA,t)),r.cidrv4=t=>r.check(Wg(bA,t)),r.cidrv6=t=>r.check(Zg(AA,t)),r.e164=t=>r.check(Hg(EA,t)),r.datetime=t=>r.check(Z0(t)),r.date=t=>r.check(G0(t)),r.time=t=>r.check(q0(t)),r.duration=t=>r.check(H0(t))});function lA(r){return o0(Rh,r)}var Ye=w("ZodStringFormat",(r,e)=>{qe.init(r,e),uA.init(r,e)}),dA=w("ZodEmail",(r,e)=>{Qw.init(r,e),Ye.init(r,e)});function NB(r){return kg(dA,r)}var rv=w("ZodGUID",(r,e)=>{Hw.init(r,e),Ye.init(r,e)});function FB(r){return bh(rv,r)}var tn=w("ZodUUID",(r,e)=>{Jw.init(r,e),Ye.init(r,e)});function BB(r){return Ig(tn,r)}function $B(r){return Tg(tn,r)}function kB(r){return Mg(tn,r)}function IB(r){return Cg(tn,r)}var sv=w("ZodURL",(r,e)=>{Yw.init(r,e),Ye.init(r,e)});function TB(r){return Ah(sv,r)}function MB(r){return Ah(sv,{protocol:/^https?$/,hostname:yi.domain,...U.normalizeParams(r)})}var hA=w("ZodEmoji",(r,e)=>{Xw.init(r,e),Ye.init(r,e)});function CB(r){return Dg(hA,r)}var pA=w("ZodNanoID",(r,e)=>{eb.init(r,e),Ye.init(r,e)});function DB(r){return Rg(pA,r)}var fA=w("ZodCUID",(r,e)=>{tb.init(r,e),Ye.init(r,e)});function RB(r){return Og(fA,r)}var mA=w("ZodCUID2",(r,e)=>{rb.init(r,e),Ye.init(r,e)});function OB(r){return Vg(mA,r)}var gA=w("ZodULID",(r,e)=>{ib.init(r,e),Ye.init(r,e)});function VB(r){return zg(gA,r)}var vA=w("ZodXID",(r,e)=>{ob.init(r,e),Ye.init(r,e)});function zB(r){return Ug(vA,r)}var yA=w("ZodKSUID",(r,e)=>{nb.init(r,e),Ye.init(r,e)});function UB(r){return jg(yA,r)}var xA=w("ZodIPv4",(r,e)=>{ub.init(r,e),Ye.init(r,e)});function jB(r){return Lg(xA,r)}var wA=w("ZodIPv6",(r,e)=>{db.init(r,e),Ye.init(r,e)});function LB(r){return Kg(wA,r)}var bA=w("ZodCIDRv4",(r,e)=>{hb.init(r,e),Ye.init(r,e)});function KB(r){return Wg(bA,r)}var AA=w("ZodCIDRv6",(r,e)=>{pb.init(r,e),Ye.init(r,e)});function WB(r){return Zg(AA,r)}var _A=w("ZodBase64",(r,e)=>{mb.init(r,e),Ye.init(r,e)});function ZB(r){return Gg(_A,r)}var PA=w("ZodBase64URL",(r,e)=>{gb.init(r,e),Ye.init(r,e)});function GB(r){return qg(PA,r)}var EA=w("ZodE164",(r,e)=>{vb.init(r,e),Ye.init(r,e)});function qB(r){return Hg(EA,r)}var SA=w("ZodJWT",(r,e)=>{yb.init(r,e),Ye.init(r,e)});function HB(r){return Jg(SA,r)}var Oh=w("ZodCustomStringFormat",(r,e)=>{xb.init(r,e),Ye.init(r,e)});function JB(r,e,t={}){return Jc(Oh,r,e,t)}function QB(r){return Jc(Oh,"hostname",yi.hostname,r)}function YB(r){return Jc(Oh,"hex",yi.hex,r)}function XB(r,e){let t=e?.enc??"hex",o=`${r}_${t}`,i=yi[o];if(!i)throw new Error(`Unrecognized hash format: ${o}`);return Jc(Oh,o,i,e)}var Vh=w("ZodNumber",(r,e)=>{_g.init(r,e),we.init(r,e),r.gt=(o,i)=>r.check(Yo(o,i)),r.gte=(o,i)=>r.check(wr(o,i)),r.min=(o,i)=>r.check(wr(o,i)),r.lt=(o,i)=>r.check(Qo(o,i)),r.lte=(o,i)=>r.check(xi(o,i)),r.max=(o,i)=>r.check(xi(o,i)),r.int=o=>r.check(cA(o)),r.safe=o=>r.check(cA(o)),r.positive=o=>r.check(Yo(0,o)),r.nonnegative=o=>r.check(wr(0,o)),r.negative=o=>r.check(Qo(0,o)),r.nonpositive=o=>r.check(xi(0,o)),r.multipleOf=(o,i)=>r.check(Ia(o,i)),r.step=(o,i)=>r.check(Ia(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 uE(r){return d0(Vh,r)}var Yc=w("ZodNumberFormat",(r,e)=>{wb.init(r,e),Vh.init(r,e)});function cA(r){return p0(Yc,r)}function e$(r){return f0(Yc,r)}function t$(r){return m0(Yc,r)}function r$(r){return g0(Yc,r)}function i$(r){return v0(Yc,r)}var zh=w("ZodBoolean",(r,e)=>{gh.init(r,e),we.init(r,e)});function dE(r){return y0(zh,r)}var Uh=w("ZodBigInt",(r,e)=>{Pg.init(r,e),we.init(r,e),r.gte=(o,i)=>r.check(wr(o,i)),r.min=(o,i)=>r.check(wr(o,i)),r.gt=(o,i)=>r.check(Yo(o,i)),r.gte=(o,i)=>r.check(wr(o,i)),r.min=(o,i)=>r.check(wr(o,i)),r.lt=(o,i)=>r.check(Qo(o,i)),r.lte=(o,i)=>r.check(xi(o,i)),r.max=(o,i)=>r.check(xi(o,i)),r.positive=o=>r.check(Yo(BigInt(0),o)),r.negative=o=>r.check(Qo(BigInt(0),o)),r.nonpositive=o=>r.check(xi(BigInt(0),o)),r.nonnegative=o=>r.check(wr(BigInt(0),o)),r.multipleOf=(o,i)=>r.check(Ia(o,i));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function o$(r){return w0(Uh,r)}var NA=w("ZodBigIntFormat",(r,e)=>{bb.init(r,e),Uh.init(r,e)});function n$(r){return A0(NA,r)}function s$(r){return _0(NA,r)}var hE=w("ZodSymbol",(r,e)=>{Ab.init(r,e),we.init(r,e)});function a$(r){return P0(hE,r)}var pE=w("ZodUndefined",(r,e)=>{_b.init(r,e),we.init(r,e)});function l$(r){return E0(pE,r)}var fE=w("ZodNull",(r,e)=>{Pb.init(r,e),we.init(r,e)});function mE(r){return S0(fE,r)}var gE=w("ZodAny",(r,e)=>{Eb.init(r,e),we.init(r,e)});function c$(){return N0(gE)}var vE=w("ZodUnknown",(r,e)=>{Sb.init(r,e),we.init(r,e)});function Qc(){return F0(vE)}var yE=w("ZodNever",(r,e)=>{Nb.init(r,e),we.init(r,e)});function FA(r){return B0(yE,r)}var xE=w("ZodVoid",(r,e)=>{Fb.init(r,e),we.init(r,e)});function u$(r){return $0(xE,r)}var av=w("ZodDate",(r,e)=>{Bb.init(r,e),we.init(r,e),r.min=(o,i)=>r.check(wr(o,i)),r.max=(o,i)=>r.check(xi(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 d$(r){return k0(av,r)}var wE=w("ZodArray",(r,e)=>{$b.init(r,e),we.init(r,e),r.element=e.element,r.min=(t,o)=>r.check(vs(t,o)),r.nonempty=t=>r.check(vs(1,t)),r.max=(t,o)=>r.check(qc(t,o)),r.length=(t,o)=>r.check(Hc(t,o)),r.unwrap=()=>r.element});function lv(r,e){return V0(wE,r,e)}function h$(r){let e=r._zod.def.shape;return IA(Object.keys(e))}var cv=w("ZodObject",(r,e)=>{kb.init(r,e),we.init(r,e),U.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>IA(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:Qc()}),r.loose=()=>r.clone({...r._zod.def,catchall:Qc()}),r.strict=()=>r.clone({...r._zod.def,catchall:FA()}),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(MA,r,t[0]),r.required=(...t)=>U.required(CA,r,t[0])});function p$(r,e){let t={type:"object",shape:r??{},...U.normalizeParams(e)};return new cv(t)}function f$(r,e){return new cv({type:"object",shape:r,catchall:FA(),...U.normalizeParams(e)})}function m$(r,e){return new cv({type:"object",shape:r,catchall:Qc(),...U.normalizeParams(e)})}var BA=w("ZodUnion",(r,e)=>{Eg.init(r,e),we.init(r,e),r.options=e.options});function $A(r,e){return new BA({type:"union",options:r,...U.normalizeParams(e)})}var bE=w("ZodDiscriminatedUnion",(r,e)=>{BA.init(r,e),Ib.init(r,e)});function g$(r,e,t){return new bE({type:"union",options:e,discriminator:r,...U.normalizeParams(t)})}var AE=w("ZodIntersection",(r,e)=>{Tb.init(r,e),we.init(r,e)});function _E(r,e){return new AE({type:"intersection",left:r,right:e})}var PE=w("ZodTuple",(r,e)=>{Sg.init(r,e),we.init(r,e),r.rest=t=>r.clone({...r._zod.def,rest:t})});function EE(r,e,t){let o=e instanceof de,i=o?t:e,n=o?e:null;return new PE({type:"tuple",items:r,rest:n,...U.normalizeParams(i)})}var kA=w("ZodRecord",(r,e)=>{Mb.init(r,e),we.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function SE(r,e,t){return new kA({type:"record",keyType:r,valueType:e,...U.normalizeParams(t)})}function v$(r,e,t){let o=ar(r);return o._zod.values=void 0,new kA({type:"record",keyType:o,valueType:e,...U.normalizeParams(t)})}var NE=w("ZodMap",(r,e)=>{Cb.init(r,e),we.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function y$(r,e,t){return new NE({type:"map",keyType:r,valueType:e,...U.normalizeParams(t)})}var FE=w("ZodSet",(r,e)=>{Db.init(r,e),we.init(r,e),r.min=(...t)=>r.check(Ta(...t)),r.nonempty=t=>r.check(Ta(1,t)),r.max=(...t)=>r.check(Gc(...t)),r.size=(...t)=>r.check(_h(...t))});function x$(r,e){return new FE({type:"set",valueType:r,...U.normalizeParams(e)})}var Dh=w("ZodEnum",(r,e)=>{Rb.init(r,e),we.init(r,e),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 Dh({...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 Dh({...e,checks:[],...U.normalizeParams(i),entries:n})}});function IA(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(o=>[o,o])):r;return new Dh({type:"enum",entries:t,...U.normalizeParams(e)})}function w$(r,e){return new Dh({type:"enum",entries:r,...U.normalizeParams(e)})}var BE=w("ZodLiteral",(r,e)=>{Ob.init(r,e),we.init(r,e),r.values=new Set(e.values),Object.defineProperty(r,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function b$(r,e){return new BE({type:"literal",values:Array.isArray(r)?r:[r],...U.normalizeParams(e)})}var $E=w("ZodFile",(r,e)=>{Vb.init(r,e),we.init(r,e),r.min=(t,o)=>r.check(Ta(t,o)),r.max=(t,o)=>r.check(Gc(t,o)),r.mime=(t,o)=>r.check($h(Array.isArray(t)?t:[t],o))});function A$(r){return z0($E,r)}var kE=w("ZodTransform",(r,e)=>{zb.init(r,e),we.init(r,e),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new ds(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 TA(r){return new kE({type:"transform",transform:r})}var MA=w("ZodOptional",(r,e)=>{Ub.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType});function iv(r){return new MA({type:"optional",innerType:r})}var IE=w("ZodNullable",(r,e)=>{jb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType});function ov(r){return new IE({type:"nullable",innerType:r})}function _$(r){return iv(ov(r))}var TE=w("ZodDefault",(r,e)=>{Lb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function ME(r,e){return new TE({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var CE=w("ZodPrefault",(r,e)=>{Kb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType});function DE(r,e){return new CE({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var CA=w("ZodNonOptional",(r,e)=>{Wb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType});function RE(r,e){return new CA({type:"nonoptional",innerType:r,...U.normalizeParams(e)})}var OE=w("ZodSuccess",(r,e)=>{Zb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType});function P$(r){return new OE({type:"success",innerType:r})}var VE=w("ZodCatch",(r,e)=>{Gb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function zE(r,e){return new VE({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var UE=w("ZodNaN",(r,e)=>{qb.init(r,e),we.init(r,e)});function E$(r){return T0(UE,r)}var DA=w("ZodPipe",(r,e)=>{Hb.init(r,e),we.init(r,e),r.in=e.in,r.out=e.out});function nv(r,e){return new DA({type:"pipe",in:r,out:e})}var RA=w("ZodCodec",(r,e)=>{DA.init(r,e),vh.init(r,e)});function S$(r,e,t){return new RA({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var jE=w("ZodReadonly",(r,e)=>{Jb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType});function LE(r){return new jE({type:"readonly",innerType:r})}var KE=w("ZodTemplateLiteral",(r,e)=>{Qb.init(r,e),we.init(r,e)});function N$(r,e){return new KE({type:"template_literal",parts:r,...U.normalizeParams(e)})}var WE=w("ZodLazy",(r,e)=>{e0.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.getter()});function ZE(r){return new WE({type:"lazy",getter:r})}var GE=w("ZodPromise",(r,e)=>{Xb.init(r,e),we.init(r,e),r.unwrap=()=>r._zod.def.innerType});function F$(r){return new GE({type:"promise",innerType:r})}var qE=w("ZodFunction",(r,e)=>{Yb.init(r,e),we.init(r,e)});function B$(r){return new qE({type:"function",input:Array.isArray(r?.input)?EE(r?.input):r?.input??lv(Qc()),output:r?.output??Qc()})}var uv=w("ZodCustom",(r,e)=>{t0.init(r,e),we.init(r,e)});function $$(r){let e=new it({check:"custom"});return e._zod.check=r,e}function k$(r,e){return U0(uv,r??(()=>!0),e)}function HE(r,e={}){return j0(uv,r,e)}function JE(r){return L0(r)}function I$(r,e={error:`Input not instance of ${r.name}`}){let t=new uv({type:"custom",check:"custom",fn:o=>o instanceof r,abort:!0,...U.normalizeParams(e)});return t._zod.bag.Class=r,t}var T$=(...r)=>K0({Codec:RA,Boolean:zh,String:Rh},...r);function M$(r){let e=ZE(()=>$A([lA(r),uE(),dE(),mE(),lv(e),SE(lA(),e)]));return e}function C$(r,e){return nv(TA(r),e)}var D$={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 R$(r){mt({customError:r})}function O$(){return mt().customError}var OA;OA||(OA={});var VA={};As(VA,{bigint:()=>j$,boolean:()=>U$,date:()=>L$,number:()=>z$,string:()=>V$});function V$(r){return n0(Rh,r)}function z$(r){return h0(Vh,r)}function U$(r){return x0(zh,r)}function j$(r){return b0(Uh,r)}function L$(r){return I0(av,r)}mt(Ng());var QE=_t.object({name:_t.string(),bpm:_t.number(),duration:_t.number(),sample_rate:_t.number(),origin:_t.enum(["openDAW","recording","import"])});var IQ=QE.extend({uuid:b.zType(_t)});var K$,W$,Z$,G$,q$,H$;K$=new WeakMap,W$=new WeakMap,Z$=new WeakMap,G$=new WeakMap,q$=new WeakMap,H$=new WeakMap;var Xc=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)},J$,Q$,zA,UA,jA,Y$,X$;Q$=new WeakMap,zA=new WeakMap,UA=new WeakMap,jA=new WeakMap,Y$=new WeakMap,J$=new WeakSet,X$=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let o=Ee(t.box,qi);B(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};Xc(this,jA,"f").proxy.onSelected(i),B(Xc(this,zA,"f").add(n),"Could not add to entityMap"),B(Xc(this,UA,"f").add(n),"Could not add to selectableMap")},onRemoved:t=>{let o=Ee(t.box,qi),i=Xc(this,zA,"f").removeByKey(o.address.uuid);B(i.box===o,"Broken selection");let n=i.selectable;Xc(this,jA,"f").proxy.onDeselected(n),Xc(this,UA,"f").removeByKey(n.address)}},u.Selection)};var YE=_t.object({name:_t.string(),size:_t.number().int(),url:_t.string(),license:_t.string(),origin:_t.enum(["openDAW","import"])});var JQ=YE.extend({uuid:b.zType(_t)});var XE;(function(r){r.cut=(e,t,o)=>{if(!(e.position>=t||t>=e.complete))if(Vx.isLoopableRegion(e)){let{position:i,complete:n,loopOffset:s,loopDuration:a}=e;e.box.duration.setValue(t-i),e.copyTo({position:t,duration:n-t,loopOffset:au(s+(t-i),a),consolidate:o})}else return P("Not yet implemented")},r.clip=(e,t,o)=>{if(Vx.isLoopableRegion(e)){let{position:i,complete:n,loopOffset:s,loopDuration:a}=e;if(n-o<=0)return P(`duration will zero or negative(${n-o})`);e.box.duration.setValue(t-i),e.copyTo({position:o,duration:n-o,loopOffset:au(s+(o-i),a)})}else return P("Not yet implemented")}})(XE||(XE={}));var eu;(e=>e.create=(t,o,i,n)=>0|(t?1:0)|(o?2:0)|(i?4:0)|(n?8:0))(eu||={});var Ne=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;#a=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=I.create(()=>new Qa(r.RMS_WINDOW),2),this.#o=this.#e.broadcastFloats(this.#t,this.#r,()=>{this.#r[0]=this.#n,this.#r[1]=this.#s,this.#r[2]=this.#l,this.#r[3]=this.#a})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#n=0,this.#s=0}process(e,t,o=0,i=128){let[n,s]=this.#i;for(let a=o;a<i;a++){let l=e[a],c=t[a];this.#n<=l?this.#n=l:this.#n*=r.PEAK_DECAY,this.#s<=c?this.#s=c:this.#s*=r.PEAK_DECAY,this.#l=n.pushPop(l),this.#a=s.pushPop(c)}}processStereo([e,t],o=0,i=128){this.process(e,t,o,i)}terminate(){this.#o.terminate()}};var dv=class{#e=new j;#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(){B(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(){B(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 tu=class{#e;constructor(){this.#e=new Ns}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 Jt=class{#e=new j;#t;#r;#i;#o;#n=m.None;constructor(e){this.#t=e,this.#r=new tu,this.#i=[],this.#o=[]}parameterChanged(e,t){return P(`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 dv(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=>{I.remove(this.#o,t),this.#o.length===0&&(this.#n.ifSome(i=>i.terminate()),this.#n=m.None),t.onStopAutomation()}},u.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 jh;(e=>e.isOfType=t=>t.type==="update-event")(jh||={});var hv=class extends Jt{#e=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#e.push(e),{terminate:()=>I.remove(this.#e,e)}}process({blocks:e}){e.forEach(({p0:t,p1:o,flags:i},n)=>{if(ot.every(i,1))for(let s of Wi.iterate(t,o,yp)){let a={type:"update-event",position:s};this.#e.forEach(l=>l.add(n,a))}})}toString(){return`{${this.constructor.name}}`}};var Ie=class extends Jt{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,c=n;for(let d of this.eventInput.get(o)){let h=d.position-i,f=Math.abs(h)<1e-7?n:n+Math.floor(Q.pulsesToSamples(h,a,sampleRate));B(n<=f&&f<=s,()=>`${f} out of bounds. event: ${d.position} (${d.type}), p0: ${i}`),l?.forEach(v=>this.handleEvent(v)),l=null,c<f&&(this.processAudio(t,c,f),c=f),jh.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,c<s&&this.processAudio(t,c,s)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return P(`${this} received an event but has no accepting method.`)}finishProcess(){}};var pv=class r{static#e=F.exponential(20/sampleRate,2e4/sampleRate);#t;#r;#i;#o;#n;feedback=.7;cross=0;wet=.75;dry=.75;#s=0;#l=0;#a=0;#c=0;#u=0;#h=!1;#d=!1;constructor(e,t){let o=So(e);this.#t=o,this.#r=[new Float32Array(o),new Float32Array(o)],this.#i=[new vt,new vt],this.#o=new Ki,this.#n=t}reset(){this.#l=0,this.#h&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#h=!1,this.#d=!1),this.#m()}set offset(e){B(0<=e&&e<this.#t,"Out of bounds"),this.#c!==e&&(this.#c=e,this.#h?this.#v():this.#m())}get offset(){return this.#c}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.#d?this.#f(e,t,o,i):this.#p(e,t,o,i),this.#h=!0}#p(e,t,o,i){let n=this.#t-1,s=this.#r,a=this.feedback,l=this.wet,c=this.dry,d=this.#l,h=d-Math.floor(this.#a);h<0&&(h+=this.#t);let f=e[0],v=e[1],g=t[0],y=t[1],x=this.#i[0],_=this.#i[1],D=s[0],V=s[1];for(let K=o;K<i;++K){let H=f[K],be=v[K],Te=x.processFrame(this.#o,D[h]*.96),ne=_.processFrame(this.#o,V[h]*.96),Me=this.cross*(ne-Te),J=Te+Me,ve=ne-Me;D[d]=(H+J)*a+1e-18-1e-18,V[d]=(be+ve)*a+1e-18-1e-18,g[K]=J*l+H*c,y[K]=ve*l+be*c,h=++h&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,c=this.dry,d=this.#l;for(let h=o;h<i;++h){0<this.#u?(this.#a+=this.#s,this.#u--):(this.#a=this.#c,this.#d=!1);let f=d-this.#a;f<0&&(f+=this.#t);let v=f|0,g=f-v,y=e[0][h],x=e[1][h],_=s[0][v],D=s[0][v],V=this.#i[0].processFrame(this.#o,_+g*(s[0][v+1&n]-_)),K=this.#i[1].processFrame(this.#o,D+g*(s[1][v+1&n]-D));s[0][d]=y+V*a+1e-18-1e-18,s[1][d]=x+V*a+1e-18-1e-18,t[0][h]=V*l+y*c,t[1][h]=K*l+x*c,d=++d&n}this.#l=d}#m(){this.#a=this.#c,this.#u=0,this.#d=!1}#v(){this.#c!==this.#a&&(this.#u=this.#n,this.#s=(this.#c-this.#a)/this.#u,this.#d=!0)}};var fv=class r extends Ie{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 ge,this.#i=this.own(new Ne(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 c=Q.pulsesToSamples(Xt.toPPQN(ei.OffsetFractions[0]),30,sampleRate),d=Math.floor(.5*sampleRate);this.#o=new pv(c,d),this.own(e.registerProcessor(this)),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||ot.some(t,8)){let s=this.parameterDelay.getValue(),a=Xt.toPPQN(ei.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=Ke(this.parameterDry.getValue()):e===this.parameterWet&&(this.#o.wet=Ke(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Lh=class r extends Jt{static ID=0;#e=r.ID++;#t;#r;#i;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new Ne(e.broadcaster,t.address)),this.own(e.registerProcessor(this))}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#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<128;a++)n[a]=o[a],s[a]=i[a];this.#i.process(n,s)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var ru=class r extends Jt{static ID=0;#e=r.ID++;#t;#r;#i;#o;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new Ne(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:()=>{I.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<128;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 fe;(a=>{a.Comparator=(l,c)=>{let d=l.position-c.position;return d!==0?d:l.type==="note-complete-event"?-1:c.type==="note-complete-event"?1:0},a.start=(l,c,d,h,f=0)=>({type:"note-event",position:l,duration:c,pitch:d,velocity:h,cent:f,id:++s}),a.startWith=(l,c,d)=>({type:"note-event",position:c??l.position,duration:d??l.duration,pitch:l.pitch,cent:l.cent,velocity:l.velocity,id:++s}),a.stop=({id:l,pitch:c},d)=>({type:"note-complete-event",position:d,pitch:c,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})(fe||={});var wo=class{#e=new j;#t;#r;#i;#o=m.None;constructor(e,t,o){this.#t=e,this.#r=this.#e.own(new gi(t,o)),this.#i=new Array(16)}setNoteEventSource(e){return B(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=m.wrap(e),this.#t.reset(),W.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(fe.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){fe.isStart(e)?this.#r.noteOn(e.pitch):fe.isStop(e)&&this.#r.noteOff(e.pitch)}};var LA;(e=>e.NotSet={start:()=>P("VoicingStrategy.start"),stop:()=>P("VoicingStrategy.stop"),forceStop:()=>Vr,process:()=>P("VoicingStrategy.process"),reset:Vr,processing:()=>I.empty()})(LA||={});var mv=class{#e;#t=[];constructor(e=LA.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 gv=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)&&(I.removeIf(this.#r,a=>a===s),this.#t.splice(n,1))}return this.#t.length===0}processing(){return this.#t}};var vv=class{#e;#t=[];#r=[];#i=null;#o=null;constructor(e){this.#e=e}start(e){if(this.#r.push(e),R(this.#i)&&this.#i.gate){this.#i.startGlide(this.#e.computeFrequency(e),this.#e.glideTime);return}R(this.#o)&&this.#o.forceStop();let t=this.#e.create();t.start(e,this.#e.computeFrequency(e),1,0),this.#i=t,this.#o=t,this.#t.push(t)}stop(e){let t=this.#r.findIndex(o=>o.id===e);if(t!==-1&&(this.#r.splice(t,1),!!R(this.#i))){if(t===this.#r.length){let o=this.#r.at(-1);if(R(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 Kh=class{#e;#t=[];#r=new Ja;#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[eS,tS,KA,rS,iS,yv,oS,nS,xv]=f_(Float32Array,128),Wh=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=Ao("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new fu(sampleRate),this.oscB=new fu(sampleRate),this.lfo=new hp(sampleRate),this.filter=new op(ho.MIN_CUTOFF,ho.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new Ga(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 Ja,this.gainASmooth=new Ai(.003,sampleRate),this.gainBSmooth=new Ai(.003,sampleRate),this.gainVcaSmooth=new Ai(.003,sampleRate)}start(e,t,o,i){this.#e=e,this.#t=o,this.#r=i,this.filter_keyboard_delta=pp.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:c,flt_resonance:d,flt_env_amount:h,flt_order:f,frequencyAMultiplier:v,frequencyBMultiplier:g,parameterLfoShape:y,parameterLfoRate:x,parameterLfoTargetTune:_,parameterLfoTargetCutoff:D,parameterLfoTargetVolume:V,parameterUnisonDetune:K,parameterUnisonStereo:H}=this.device,be=qa(this.#e.velocity)*this.#t,Te=2**(this.#r*(K.getValue()/1200)),ne=this.#r*H.getValue(),[Me,J]=jr.panningToGains(ne,jr.Mixing.Linear),[ve,Ue]=e.channels();KA.fill(Te,o,i),this.glide.process(KA,t,o,i),this.lfo.fill(oS,y.getValue(),x.getValue(),o,i),this.env.process(yv,o,i);let Mt=_.getValue(),Pr=D.getValue(),Ct=V.getValue();for(let ke=o;ke<i;ke++){let Or=oS[ke];nS[ke]=c+this.filter_keyboard_delta+yv[ke]*h+Or*Pr,yv[ke]*=zr(be+Or*Ct);let wi=KA[ke]*2**(Or*Mt);rS[ke]=wi*v,iS[ke]=wi*g}this.oscA.generateFromFrequencies(eS,rS,a,o,i),this.oscB.generateFromFrequencies(tS,iS,l,o,i);for(let ke=o;ke<i;ke++)xv[ke]=eS[ke]*this.gainASmooth.process(n)+tS[ke]*this.gainBSmooth.process(s);this.filter.order=f,this.filter.process(xv,xv,nS,d,o,i);for(let ke=o;ke<i;ke++){let Or=this.gainVcaSmooth.process(zr(yv[ke])),wi=xv[ke]*Or;if(ve[ke]+=wi*Me,Ue[ke]+=wi*J,this.env.complete&&Or<1e-4)return!0}return!1}};var wv=class extends Ie{#e;#t;#r;#i;#o;#n;#s;#l;#a;#c;#u;#h;#d;#p;#f;#m;#v;#w;#A;#k;#N;#F;#x;#E;#B;#_;#S;#b;#y;#P;#$;#T;#M;gainOscA=1;gainOscB=1;frequencyAMultiplier=1;frequencyBMultiplier=1;env_attack=1;env_decay=1;env_sustain=1;env_release=1;oscA_waveform=Oe.sine;oscB_waveform=Oe.sine;flt_cutoff=1;flt_resonance=Math.SQRT1_2;flt_env_amount=0;flt_order=1;#I=0;constructor(e,t){super(e),this.#e=t,this.#t=new mv,this.#r=new wo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ge,this.#o=new gp(sampleRate),this.#n=this.own(new Ne(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.#a=this.own(this.bindParameter(i[0].tune)),this.#c=this.own(this.bindParameter(i[0].volume)),this.#u=this.own(this.bindParameter(i[1].waveform)),this.#h=this.own(this.bindParameter(i[1].octave)),this.#d=this.own(this.bindParameter(i[1].tune)),this.#p=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.#w=this.own(this.bindParameter(o.release)),this.#A=this.own(this.bindParameter(o.cutoff)),this.#k=this.own(this.bindParameter(o.resonance)),this.#N=this.own(this.bindParameter(o.filterEnvelope)),this.#F=this.own(this.bindParameter(o.filterOrder)),this.#x=this.own(this.bindParameter(o.filterKeyboard)),this.#E=this.own(this.bindParameter(o.glideTime)),this.#B=this.own(this.bindParameter(o.voicingMode)),this.#_=this.own(this.bindParameter(o.unisonCount)),this.#S=this.own(this.bindParameter(o.unisonDetune)),this.#b=this.own(this.bindParameter(o.unisonStereo)),this.#y=this.own(this.bindParameter(o.lfoWaveform)),this.#P=this.own(this.bindParameter(o.lfoRate)),this.#$=this.own(this.bindParameter(o.lfoTargetTune)),this.#T=this.own(this.bindParameter(o.lfoTargetCutoff)),this.#M=this.own(this.bindParameter(o.lfoTargetVolume));let n=new Float32Array(32);this.ownAll(e.broadcaster.broadcastFloats(t.address.append(0),n,()=>{let s=0;this.#t.strategy.processing().forEach(a=>{let c=Ee(a,Kh).processing().at(0);c instanceof Wh&&(n[s++]=c.env.phase),n.length-1}),n[s]=-1}),e.registerProcessor(this)),this.readAllParameters()}computeFrequency(e){return du(e.pitch+e.cent/100,440)}get glideTime(){return this.#I}get parameterFilterKeyboard(){return this.#x}get parameterLfoShape(){return this.#y}get parameterLfoRate(){return this.#P}get parameterLfoTargetTune(){return this.#$}get parameterLfoTargetCutoff(){return this.#T}get parameterLfoTargetVolume(){return this.#M}get parameterUnisonDetune(){return this.#S}get parameterUnisonStereo(){return this.#b}create(){return new Kh(()=>new Wh(this),this.#_.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){fe.isStart(e)?this.#t.start(e):fe.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.#c)this.gainOscA=Ke(this.#c.getValue());else if(e===this.#p)this.gainOscB=Ke(this.#p.getValue());else if(e===this.#l||e===this.#a)this.frequencyAMultiplier=2**(this.#l.getValue()+this.#a.getValue()/1200);else if(e===this.#h||e===this.#d)this.frequencyBMultiplier=2**(this.#h.getValue()+this.#d.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.#w)this.env_release=this.#w.getValue();else if(e===this.#s)this.oscA_waveform=_o(this.#s.getValue(),Oe);else if(e===this.#u)this.oscB_waveform=_o(this.#u.getValue(),Oe);else if(e===this.#A)this.flt_cutoff=this.#A.getUnitValue();else if(e===this.#k)this.flt_resonance=this.#k.getValue();else if(e===this.#N)this.flt_env_amount=this.#N.getValue();else if(e===this.#F)this.flt_order=this.#F.getValue();else if(e===this.#E)this.#I=this.#E.getValue()*Q.Bar;else if(e===this.#B){let t=this.#B.getValue();switch(t){case Gi.Monophonic:{this.#t.strategy=new vv(this);return}case Gi.Polyphonic:{this.#t.strategy=new gv(this);return}default:return P(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var bv=class extends Jt{#e;#t;#r;#i;#o=128;constructor(e,t){super(e),this.#e=t,this.#t=new ge(2),this.#r=this.own(new Ne(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,lastRead:NaN,lastStepSize:0}),onRemove:o=>this.#i.removeByKey(o.uuid),onReorder:o=>{}}),e.registerProcessor(this))}get noteEventTarget(){return m.None}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#t}process({blocks:e}){this.#t.clear(0,128);let[t,o]=this.#t.channels();this.#i.forEach(i=>e.forEach(n=>{let{adapter:s}=i;if(s.type!==ee.Audio||!s.enabled.getValue())return;let{p0:a,p1:l,flags:c}=n;if(!ot.every(c,5))return;let d=this.context.clipSequencing.iterate(s.uuid,a,l);for(let{optClip:h,sectionFrom:f,sectionTo:v}of d)h.match({none:()=>{for(let g of s.regions.collection.iterateRange(a,l)){if(g.mute||!Le(g,On))continue;let x=g.file.getOrCreateLoader().data;if(x.isEmpty())return;let _=x.unwrap();for(let D of cr.locateLoops(g,a,l))this.#n(this.#t,_,D,n,i)}},some:g=>{if(!Le(g,$n))return;let y=g.file.getOrCreateLoader().data;if(y.isEmpty())return;let x=y.unwrap();for(let _ of cr.locateLoops({position:0,loopDuration:g.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},f,v))this.#n(this.#t,x,_,n,i)}})})),this.#t.assertSanity(),this.#r.process(t,o)}parameterChanged(e){}#n(e,t,o,{p0:i,p1:n,s0:s,s1:a},l){let[c,d]=e.channels(),{numberOfFrames:h,frames:f}=t,v=f[0],g=f.length===1?f[0]:f[1],y=a-s,x=n-i,_=h*o.resultStartValue,D=h*o.resultEndValue,V=(o.resultStart-i)/x,K=(o.resultEnd-i)/x,H=s+y*V,be=s+y*K,Te=be-H|0,ne=(D-_)/Te;B(s<=H&&be<=a,`Out of bounds ${H}, ${be}`);let Me=!Number.isFinite(l.lastRead)||Math.abs(_-(l.lastRead+ne))>2;for(let J=0,ve=H|0;J<Te;J++,ve++){let Ue=_+J*ne,Mt=Ue|0,Pr=0,Ct=0;if(Mt>=0&&Mt<h-1){let ke=Ue-Mt,Or=v[Mt],wi=g[Mt];Pr=Or+ke*(v[Mt+1]-Or),Ct=wi+ke*(g[Mt+1]-wi)}if(Me&&J<this.#o&&Number.isFinite(l.lastRead)){let ke=J/this.#o,Or=1-ke,wi=l.lastRead+J*l.lastStepSize,bs=wi|0;if(bs>=0&&bs<h-1){let XA=wi-bs,e_=v[bs],t_=g[bs],PS=e_+XA*(v[bs+1]-e_),ES=t_+XA*(g[bs+1]-t_);c[ve]+=Or*PS+ke*Pr,d[ve]+=Or*ES+ke*Ct}else c[ve]+=Pr,d[ve]+=Ct}else c[ve]+=Pr,d[ve]+=Ct}l.lastRead=_+(Te-1)*ne,l.lastStepSize=ne}};var Ar=class extends Jt{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:o,p0:i,p1:n,s0:s,bpm:a}=t,l=null,c=i;for(let d of this.eventInput.get(o))l?.forEach(h=>this.handleEvent(t,h)),l=null,c<d.position&&(this.processEvents(t,c,d.position),c=d.position),jh.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,c<n&&this.processEvents(t,c,n)}),this.eventInput.clear()}introduceBlock(e){}};var iu;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(o,i)=>i*o.mult+o.add))(iu||={});var Av=Object.freeze([{name:"up",run:(r,e,t,o,i,n)=>{let s=r.length,a=s*e,l=t%s,c=Math.floor(t%a/s),d=r[l];return fe.start(o,i,d.pitch+c*12,iu.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,c=e-1-Math.floor(t%a/s),d=r[l];return fe.start(o,i,d.pitch+c*12,iu.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),c=t%l,d=c<a?c:l-c,h=d%s,f=Math.floor(d/s),v=r[h];return fe.start(o,i,v.pitch+f*12,iu.apply(n,v.velocity))}}]);var _v=class extends Ar{#e;#t;#r;#i;#o;#n;#s;#l;#a;#c=iu.create();#u=m.None;#h=Av[0];#d=NaN;#p=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new Ha,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.#a=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 B(this.#u.isEmpty(),"NoteEventSource already set"),this.#u=m.wrap(e),W.create(()=>this.#u=m.None)}*processNotes(e,t,o){if(this.#r.nonEmpty())if(ot.every(o,2))for(let n of this.#r.releaseAll())yield fe.stop(n,e);else for(let n of this.#r.releaseLinearCompleted(t))yield fe.stop(n,n.position+n.duration);if(this.#u.nonEmpty()){let i=this.#u.unwrap();for(let s of i.processNotes(e,t,o));let n=!ot.every(o,1);for(let{position:s,index:a}of Wi.iterateWithIndex(e,t,this.#d)){let l=Array.from(i.iterateActiveNotesAt(s,n));if(l.length===0)continue;let c=Math.floor(a/this.#f),d=Math.max(1,Math.floor(this.#d*this.#p)),h=this.#h.run(l,this.#m,c,s,d,this.#c);this.#r.addAndRetain({...h}),yield h}for(let s of this.#r.releaseLinearCompleted(t))yield fe.stop(s,s.position+s.duration)}}*iterateActiveNotesAt(e,t){this.#u.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.#h=Av.at(this.#i.getValue())??Av[0];else if(e===this.#o)this.#d=Xt.toPPQN(Ci.RateFractions[this.#o.getValue()]);else if(e===this.#n)this.#p=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.#a){let t=this.#a.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 Pv=class extends Ar{#e;#t;#r;#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new gi(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 B(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=m.wrap(e),W.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(fe.isStart(i)){this.#t.noteOn(i.pitch);let{cent:n,octaves:s,semiTones:a}=this.#e.namedParameter;yield Er.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 Er.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 Ev=class r{static DEFAULT_SIZE=1024;#e;#t;#r;#i;#o;#n;#s;#l=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e,this.#r=new lp(this.#e),this.#i=new Float32Array(this.#e),this.#o=new Float32Array(this.#e),this.#n=gu.create(gu.Type.Blackman,this.#e),this.#t=this.#e>>1,this.#s=new Float32Array(this.#t)}clear(){this.#s.fill(0),this.#l=0}numBins(){return this.#t}bins(){return this.#s}process(e,t,o,i){for(let n=o;n<i;++n)this.#i[this.#l]=this.#n[this.#l]*(e[n]+t[n]),++this.#l===this.#e&&this.#a()}#a(){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]*=.9)}this.#l=0,this.#o.fill(0),this.decay=!1}};var Sv=class r extends Ie{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#l;#a;#c;#u;#h;#d;#p;#f;#m;#v;#w;#A;#k;#N;#F;#x;#E;#B;#_;#S;#b;#y;#P;#$;#T;#M;#I;#D;#C;#R;#O=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new Ne(e.broadcaster,t.address)),this.#o=new Ev,this.#n=new Float32Array(this.#o.numBins()),this.#s=I.create(()=>new Ki,7),this.#l=[new un(4),new un(4)],this.#a=[new un(4),new un(4)],this.#c=[this.#a,[new vt,new vt],[new vt,new vt],[new vt,new vt],[new vt,new vt],[new vt,new vt],this.#l],this.#u=I.create(()=>!0,7);let o=this.#t.namedParameter;this.#h=this.own(this.bindParameter(o.highPass.enabled)),this.#p=this.own(this.bindParameter(o.highPass.q)),this.#d=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.#w=this.own(this.bindParameter(o.lowShelf.gain)),this.#A=this.own(this.bindParameter(o.lowBell.enabled)),this.#k=this.own(this.bindParameter(o.lowBell.frequency)),this.#N=this.own(this.bindParameter(o.lowBell.gain)),this.#F=this.own(this.bindParameter(o.lowBell.q)),this.#x=this.own(this.bindParameter(o.midBell.enabled)),this.#E=this.own(this.bindParameter(o.midBell.frequency)),this.#B=this.own(this.bindParameter(o.midBell.gain)),this.#_=this.own(this.bindParameter(o.midBell.q)),this.#S=this.own(this.bindParameter(o.highBell.enabled)),this.#b=this.own(this.bindParameter(o.highBell.frequency)),this.#y=this.own(this.bindParameter(o.highBell.gain)),this.#P=this.own(this.bindParameter(o.highBell.q)),this.#$=this.own(this.bindParameter(o.highShelf.enabled)),this.#T=this.own(this.bindParameter(o.highShelf.frequency)),this.#M=this.own(this.bindParameter(o.highShelf.gain)),this.#I=this.own(this.bindParameter(o.lowPass.enabled)),this.#D=this.own(this.bindParameter(o.lowPass.frequency)),this.#C=this.own(this.bindParameter(o.lowPass.q)),this.#R=this.own(this.bindParameter(o.lowPass.order)),this.own(e.registerProcessor(this)),e.broadcaster.broadcastFloats(t.spectrum,this.#n,()=>{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.#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.#O=m.wrap(e),{terminate:()=>this.#O=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#O.isEmpty())return;let[i,n]=this.#r.channels(),s=this.#O.unwrap();if(this.#u.some(a=>a)){let[a,l]=s.channels();this.#s.forEach((c,d)=>{if(this.#u[d]){let[h,f]=this.#c[d];h.process(c,a,i,t,o),f.process(c,l,n,t,o),a=i,l=n}})}else{let[a,l]=s.channels();for(let c=t;c<o;c++)i[c]=a[c],n[c]=l[c]}this.#i.process(i,n,t,o),this.#o.process(i,n,t,o)}parameterChanged(e){if(e===this.#R){let o=this.#R.getValue()+1;this.#l[0].order=o,this.#l[1].order=o}else if(e===this.#f){let o=this.#f.getValue()+1;this.#a[0].order=o,this.#a[1].order=o}else if(e===this.#d||e===this.#p){let t=this.#d.getValue(),o=this.#p.getValue();this.#s[0].setHighpassParams(t/sampleRate,o)}else if(e===this.#v||e===this.#w){let t=this.#v.getValue(),o=this.#w.getValue();this.#s[1].setLowShelfParams(t/sampleRate,o)}else if(e===this.#k||e===this.#N||e===this.#F){let t=this.#k.getValue(),o=this.#N.getValue(),i=this.#F.getValue();this.#s[2].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#E||e===this.#B||e===this.#_){let t=this.#E.getValue(),o=this.#B.getValue(),i=this.#_.getValue();this.#s[3].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#b||e===this.#y||e===this.#P){let t=this.#b.getValue(),o=this.#y.getValue(),i=this.#P.getValue();this.#s[4].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#T||e===this.#M){let t=this.#T.getValue(),o=this.#M.getValue();this.#s[5].setHighShelfParams(t/sampleRate,o)}else if(e===this.#D||e===this.#C){let t=this.#D.getValue(),o=this.#C.getValue();this.#s[6].setLowpassParams(t/sampleRate,o)}else e===this.#h?this.#u[0]=this.#h.getValue():e===this.#m?this.#u[1]=this.#m.getValue():e===this.#A?this.#u[2]=this.#A.getValue():e===this.#x?this.#u[3]=this.#x.getValue():e===this.#S?this.#u[4]=this.#S.getValue():e===this.#$?this.#u[5]=this.#$.getValue():e===this.#I&&(this.#u[6]=this.#I.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var Nv=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);#a=new Float32Array(1024);#c=new Float32Array(512);#u=new Float32Array(512);#h=new Float32Array(256);#d=new Float32Array(2048);#p=new Float32Array(2048);#f=new Float32Array(2048);#m=new Float32Array(2048);#v=new Float32Array(2048);#w=new Float32Array(2048);#A=new Float32Array(2048);#k=new Float32Array(2048);#N=new Float32Array(1024);#F=new Float32Array(512);#x=new Float32Array(512);#E=new Float32Array(256);#B;#_;#S=0;#b=0;#y=0;#P=0;#$=0;#T=0;#M=0;#I=0;#D=0;#C=0;#R=0;#O=0;#V=0;#z=0;#U=0;#j=0;#L=0;#K=0;#Z=0;#G=0;#q=0;#H=0;#J=0;#Q=0;#Y=0;#X=0;#ee=0;#te=0;#re=0;#ie=0;#oe=0;#ne=0;#se=0;#ae=0;#le=0;#ce=0;#ue=0;#de=0;#he=0;#pe=0;#g=0;#W=0;constructor(e=.5){this.#B=So(Math.ceil(e*sampleRate)),this.#_=new Float32Array(this.#B<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#g=0,this.#W=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#g=0,this.#W=0,this.clearHistory(),this.clearBuffers()}process(e,t,o,i){let[n,s]=t.channels(),[a,l]=e.channels(),c=.4*this.damp,d=1-c,h=.7+.28*this.roomSize;for(let f=o;f<i;++f){let v=n[f],g=s[f],y=this.#W-this.predelayInSamples;y<0&&(y+=this.#B);let x;x=y<<1;let _=.01,D=this.#_[x]*_,V=this.#_[x+1]*_;x=this.#W<<1,this.#_[x]=v,this.#_[x+1]=g,this.#W=this.#W+1&this.#B-1;let K=this.#g&2047;this.#S=d*this.#b+c*this.#S,this.#e[K]=D+h*this.#S,this.#b=this.#e[this.#g-1617&2047],this.#y=d*this.#P+c*this.#y,this.#t[K]=D+h*this.#y,this.#P=this.#t[this.#g-1557&2047],this.#$=d*this.#T+c*this.#$,this.#r[K]=D+h*this.#$,this.#T=this.#r[this.#g-1491&2047],this.#M=d*this.#I+c*this.#M,this.#i[K]=D+h*this.#M,this.#I=this.#i[this.#g-1422&2047],this.#D=d*this.#C+c*this.#D,this.#o[K]=D+h*this.#D,this.#C=this.#o[this.#g-1356&2047],this.#R=d*this.#O+c*this.#R,this.#n[K]=D+h*this.#R,this.#O=this.#n[this.#g-1277&2047],this.#V=d*this.#z+c*this.#V,this.#s[K]=D+h*this.#V,this.#z=this.#s[this.#g-1188&2047],this.#U=d*this.#j+c*this.#U,this.#l[K]=D+h*this.#U,this.#j=this.#l[this.#g-1116&2047];let H=this.#j+this.#z+this.#O+this.#C+this.#I+this.#T+this.#P+this.#b,be=this.#L-H,Te=this.#K-be,ne=this.#Z-Te;this.#a[this.#g&1023]=H+.5*this.#L,this.#L=this.#a[this.#g-556&1023],this.#c[this.#g&511]=be+.5*this.#K,this.#K=this.#c[this.#g-441&511],this.#u[this.#g&511]=Te+.5*this.#Z,this.#Z=this.#u[this.#g-341&511],this.#h[this.#g&255]=ne+.5*this.#G,this.#G=this.#h[this.#g-225&255],a[f]=this.dryGain*v+this.wetGain*(this.#G-ne),this.#q=d*this.#H+c*this.#q,this.#d[K]=V+h*this.#q,this.#H=this.#d[this.#g-1640&2047],this.#J=d*this.#Q+c*this.#J,this.#p[K]=V+h*this.#J,this.#Q=this.#p[this.#g-1580&2047],this.#Y=d*this.#X+c*this.#Y,this.#f[K]=V+h*this.#Y,this.#X=this.#f[this.#g-1514&2047],this.#ee=d*this.#te+c*this.#ee,this.#m[K]=V+h*this.#ee,this.#te=this.#m[this.#g-1445&2047],this.#re=d*this.#ie+c*this.#re,this.#v[K]=V+h*this.#re,this.#ie=this.#v[this.#g-1379&2047],this.#oe=d*this.#ne+c*this.#oe,this.#w[K]=V+h*this.#oe,this.#ne=this.#w[this.#g-1300&2047],this.#se=d*this.#ae+c*this.#se,this.#A[K]=V+h*this.#se,this.#ae=this.#A[this.#g-1211&2047],this.#le=d*this.#ce+c*this.#le,this.#k[K]=V+h*this.#le,this.#ce=this.#k[this.#g-1139&2047];let Me=this.#ce+this.#ae+this.#ne+this.#ie+this.#te+this.#X+this.#Q+this.#H,J=this.#ue-Me,ve=this.#de-J,Ue=this.#he-ve;this.#N[this.#g&1023]=Me+.5*this.#ue,this.#ue=this.#N[this.#g-579&1023],this.#F[this.#g&511]=J+.5*this.#de,this.#de=this.#F[this.#g-464&511],this.#x[this.#g&511]=ve+.5*this.#he,this.#he=this.#x[this.#g-364&511],this.#E[this.#g&255]=Ue+.5*this.#pe,this.#pe=this.#E[this.#g-248&255],l[f]=this.dryGain*g+this.wetGain*(this.#pe-Ue),this.#g++}}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.#a.fill(0),this.#c.fill(0),this.#u.fill(0),this.#h.fill(0),this.#d.fill(0),this.#p.fill(0),this.#f.fill(0),this.#m.fill(0),this.#v.fill(0),this.#w.fill(0),this.#A.fill(0),this.#k.fill(0),this.#N.fill(0),this.#F.fill(0),this.#x.fill(0),this.#E.fill(0),this.#_.fill(0)}clearHistory(){this.#S=0,this.#b=0,this.#y=0,this.#P=0,this.#$=0,this.#T=0,this.#M=0,this.#I=0,this.#D=0,this.#C=0,this.#R=0,this.#O=0,this.#V=0,this.#z=0,this.#U=0,this.#j=0,this.#L=0,this.#K=0,this.#Z=0,this.#G=0,this.#q=0,this.#H=0,this.#J=0,this.#Q=0,this.#Y=0,this.#X=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#oe=0,this.#ne=0,this.#se=0,this.#ae=0,this.#le=0,this.#ce=0,this.#ue=0,this.#de=0,this.#he=0,this.#pe=0}};var Fv=class r extends Ie{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#l;#a;#c;#u=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new Ne(e.broadcaster,t.address)),this.#o=new Nv;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.#a=this.own(this.bindParameter(s)),this.#c=this.own(this.bindParameter(a)),this.own(e.registerProcessor(this)),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.#u=m.wrap(e),{terminate:()=>this.#u=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#u.isEmpty())return;this.#o.process(this.#r,this.#u.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.#a===e?this.#o.wetGain=Ke(this.#a.getValue()):this.#c===e&&(this.#o.dryGain=Ke(this.#c.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var Bv=class extends Ie{#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 ge,this.#i=new wo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#o=this.own(new Ne(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),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){fe.isStart(e)?this.#t.push(new ZA(this,e)):fe.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=Ke(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}"}},ZA=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,c=t.numberOfFrames,d=t.sampleRate/sampleRate,h=this.#e.gain*this.#t.velocity,f=this.#e.release,v=1/f;for(let g=o;g<i;g++){let y=this.#i|0;if(y>=c-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)*v,1)*_)**2,V=a[y]*(1-x)+a[y+1]*x,K=l[y]*(1-x)+l[y+1]*x;if(n[g]+=V*h*D,s[g]+=K*h*D,this.#i+=this.#r*d,++this.#n-this.#s>f)return!0}return!1}};var $v=class extends Ar{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=new wo(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){fe.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:o})=>o.add(e,t)):fe.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:o})=>o.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var kv=class extends Ie{#e;#t;#r;#i;#o;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=this.own(new Ne(e.broadcaster,t.adapter.address)),this.#i=[],this.#o=new tu,this.own(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{I.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<128;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 Iv=class r{static create(e,t,o,i){return new r(e,t,o,i)}#e=new j;#t;#r;#i=[];#o=!0;constructor(e,t,o,i){this.#t=b.newSet(({device:n})=>n.uuid),this.#r=this.#e.own(new j),this.#e.ownAll(t.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let s=Zh.create(e,n.box),a=this.#t.add({device:s,subscription:s.adapter().enabledField.subscribe(()=>this.invalidateWiring())});B(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;I.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 Gh=Math.floor(.005*sampleRate),Mv=class{#e;#t;#r;#i;#o;#n;#s=0;#l=Number.POSITIVE_INFINITY;#a;#c;#u;#h;#d;#p;#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=qa(this.#r.velocity);let{attack:n,release:s,sampleStart:a,sampleEnd:l}=this.#t;this.#a=n.getValue()*sampleRate,this.#c=s.getValue()*sampleRate,this.#u=(o.numberOfFrames-1)*a.getValue(),this.#h=(o.numberOfFrames-1)*l.getValue(),this.#d=this.#u,this.#p=0}get sample(){return this.#e}get event(){return this.#r}get position(){return this.#d}get envelope(){return this.#p}release(e=!1){this.#f&&(e?(this.#c=Gh,this.#v(),this.#f=!1):this.#o!==vo.Off&&this.#v())}processAdd(e,t,o){let[i,n]=e,{frames:s,numberOfFrames:a}=this.#i,l=s[0],c=s[1]??l,{pitch:d}=this.#t,h=this.#h-this.#u,f=Math.sign(h),v=this.#i.sampleRate/sampleRate*f*2**(d.getValue()/1200),g=0;for(let y=t;y<o;y++){let x=this.#d|0,_=this.#d-x,D=l[x]*(1-_)+(l[x+1]??0)*_,V=c[x]*(1-_)+(c[x+1]??0)*_;if(g=Math.min(this.#s/this.#a,1-(this.#s-(this.#l+this.#a))/this.#c,1),this.#d+=v,f>0){if(this.#o===vo.Off){if(this.#d>=a)return!0;!this.#m&&this.#d>=this.#h&&this.#v()}else if(this.#o===vo.On){if(this.#d>=this.#h-Gh){if(this.#d>=this.#h)return!0;g*=(this.#h-this.#d)/Gh}}else if(this.#o===vo.Loop)for(;this.#d>=this.#h;)this.#d-=h}else if(f<0){if(this.#o===vo.Off){if(this.#d<=0)return!0;!this.#m&&this.#d<=this.#h&&this.#v()}else if(this.#o===vo.On){if(this.#d<=this.#h+Gh){if(this.#d<=this.#h)return!0;g*=(this.#h-this.#d)/Gh}}else if(this.#o===vo.Loop)for(;this.#d<=this.#h;)this.#d-=h}if(++this.#s-this.#l>this.#a+this.#c)return!0;g*=this.#n*g,i[y]+=D*g,n[y]+=V*g}return this.#p=g,!1}toString(){return"{PlayfieldSampleVoice}"}#v(){this.#m||(this.#m=!0,this.#l=this.#s<this.#a?this.#s-this.#a:this.#s)}};var Cv=class extends Ie{#e;#t;#r;#i;#o;#n;constructor(e,t,o,i){super(e),this.#e=t,this.#t=o,this.#r=[],this.#i=new ge,this.#o=this.own(new Ne(e.broadcaster,o.peakAddress));let{sampleStart:n,sampleEnd:s,attack:a,release:l,pitch:c}=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(c))});let d=new Float32Array(16);this.ownAll(Iv.create(e,o.audioEffects,this,i),e.broadcaster.broadcastFloats(o.address,d,()=>{let h=this.#r.length<d.length?this.#r:this.#r.slice(0,d.length);h.forEach(({position:f},v)=>d[v]=f),d[h.length]=-1}),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){if(fe.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 Mv(this.#t,this.#n,t.unwrap(),e))}else fe.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 Dv=class{#e=new j;#t;#r;#i;#o;constructor(e,t){this.#t=t,this.#r=this.#e.own(new $v(e,this)),this.#i=this.#e.own(new kv(e,this)),this.#o=b.newSet(o=>o.uuid),this.#e.ownAll(t.samples.catchupAndSubscribe({onAdd:o=>{let i=new Cv(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 Rv=class extends Ie{#e;#t;#r;#i=Kt.stereoMatrix(sampleRate);#o={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#n;#s;#l;#a;#c;#u;#h=m.None;#d=jr.Mixing.Linear;#p=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=this.own(new Ne(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.#a=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(o=>{this.#d=o.getValue(),this.#p=!0}),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#f=!1}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}setAudioSource(e){return this.#h=m.wrap(e),{terminate:()=>this.#h=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,o){if(this.#h.isEmpty())return;this.#p&&(this.#i.update(this.#o,this.#d,this.#f),this.#p=!1);let i=this.#h.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=Ke(this.#n.getValue()),this.#p=!0;return;case this.#s:this.#o.panning=this.#s.getValue(),this.#p=!0;return;case this.#l:this.#o.stereo=this.#l.getValue(),this.#p=!0;return;case this.#a:this.#o.invertL=this.#a.getValue(),this.#p=!0;return;case this.#c:this.#o.invertR=this.#c.getValue(),this.#p=!0;return;case this.#u:this.#o.swap=this.#u.getValue(),this.#p=!0;return}}toString(){return`{${this.constructor.name}}`}};var Ov=class extends Ar{#e;#t;#r=m.None;#i=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new gi(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,Ea.checkType))}),W.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 B(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),W.create(()=>this.#i=m.None)}*processNotes(e,t,o){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),n=this.#r.mapOr(su,pu.Identity);for(let s of i.processNotes(n.unwarp(e),n.unwarp(t),o))fe.isStart(s)?this.#t.noteOn(s.pitch):this.#t.noteOff(s.pitch),yield Er.overwrite(s,{position:X(n.warp(s.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let o=this.#i.unwrap(),i=this.#r.mapOr(su,pu.Identity);for(let n of o.iterateActiveNotesAt(i.unwarp(e),t))yield Er.overwrite(n,{position:i.warp(n.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,o){}};var Vv=class extends Ar{#e;#t;#r=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new gi(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return B(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=m.wrap(e),W.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 zv=(r,e)=>(r[e]??r[e.toString()])?.value,ou=(r,e,t)=>zv(e,t)??zv(r,t),sS=new Float32Array(128),Uv=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=zv(s,53)??0,l=o?.sample??i.samples[a];this.sampleData=l.data,this.rootKey=zv(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 c=ou(n,s,54)??0;this.shouldLoop=c===1||c===3,this.pan=(ou(n,s,17)??0)/1e3;let d=ou(n,s,34),h=ou(n,s,36),f=ou(n,s,37),v=ou(n,s,38),g=Ra(d)?Math.pow(2,d/1200):.005,y=Ra(h)?Math.pow(2,h/1200):.005,x=1-(f??0)/1e3,_=Ra(v)?Math.pow(2,v/1200):.005;this.envelope=new Ga(sampleRate),this.envelope.set(g,y,x,_),this.envelope.gateOn(),this.#e=new Ai(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,o){let n=du(this.event.pitch+this.event.cent/100,440)/du(this.rootKey,440)*(this.sampleRate/sampleRate),s=qa(this.event.velocity),a=Math.cos((this.pan+1)*Math.PI/4),l=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(sS,t,o);let c=e.getChannel(0),d=e.getChannel(1);for(let h=t;h<o;h++){let f=Math.floor(this.playbackPosition),g=this.#t(f)/32768*s*this.#e.process(sS[h]);if(c[h]+=g*a,d[h]+=g*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<1e-4}#t(e){if(e>=this.sampleData.length-1)return this.sampleData[this.sampleData.length-1];let t=this.playbackPosition-e;return this.sampleData[e]*(1-t)+this.sampleData[e+1]*t}};var jv=class extends Ie{#e;#t;#r;#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new wo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ge,this.#o=this.own(new Ne(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),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(fe.isStart(e)){let i=o.presets[this.#e.presetIndex]??o.presets[0];if(Jh(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 c=0;c<l.length;c++){let d=l[c];this.#s(e.pitch,a,d)&&(this.#t.push(new Uv(e,s,d,o)),n++)}}}}else fe.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 Hh(e)||t>=e.lo&&t<=e.hi}};var aS=r=>r>0?20*Math.log10(r):-100,lS=r=>Math.pow(10,r*.05);var Lv=class{#e=.08;#t=1;#r;#i;#o=0;#n=.14;#s=0;#l=.14;#a=0;#c=0;#u=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t){this.#a===0&&(this.#a=e[0]),this.#c===0&&(this.#c=e[0]),this.#s=0,this.#l=0;for(let o=0;o<t;++o){let i=e[o]*e[o];this.#a=Math.max(i,this.#r*this.#a+this.#i*i),this.#c=this.#r*this.#c+this.#i*i;let n=this.#a/this.#c;this.#u=n>0?n:0,this.#u>0&&(this.#o=2*(this.#e/this.#u),this.#n=2*(this.#t/this.#u)-this.#o,this.#s+=this.#o,this.#l+=this.#n)}this.#s/=t,this.#l/=t}getAvgAttack(){return this.#s}getAvgRelease(){return this.#l}};var Kv=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){if(this.#r===0)return;let o=(this.#o-this.#r+this.#t)%this.#t;for(let i=0;i<this.#i;i++){let n=e.getChannel(i),s=this.#o,a=o;for(let l=0;l<t;l++){let c=this.#e[i][a];this.#e[i][s]=n[l],n[l]=c,s=(s+1)%this.#t,a=(a+1)%this.#t}}this.#o=(this.#o+t)%this.#t}};var Wv=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){for(let o=0;o<t;++o){let i=Math.max(Math.abs(e[o]),1e-6),n=aS(i);e[o]=this.applyCompression(n)}}};var Ca=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 Zv=class{#e;#t;#r;#i;#o=.01;#n=0;#s=.14;#l=0;#a=0;#c=0;#u=!1;#h=!1;constructor(e){this.#e=e,this.#t=new Lv(e),this.#r=new Ca(e),this.#i=new Ca(e),this.#n=Math.exp(-1/(e*this.#o)),this.#l=Math.exp(-1/(e*this.#s)),this.#a=0,this.#c=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.#u=e}setAutoRelease(e){this.#h=e}#d(e){return e<this.#a?this.#a=this.#n*this.#a+(1-this.#n)*e:this.#a=this.#l*this.#a+(1-this.#l)*e,this.#a}applyBallistics(e,t){for(let o=0;o<t;++o)e[o]=this.#d(e[o])}processCrestFactor(e,t){(this.#u||this.#h)&&(this.#t.process(e,t),this.#r.process(this.#t.getAvgAttack()),this.#i.process(this.#t.getAvgRelease()),this.#u&&this.setAttack(this.#r.getState()),this.#h&&this.setRelease(this.#i.getState()))}};var Gv=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){this.#n(e,t),this.#l(),this.#s(e,t)}#n(e,t){for(let o=0;o<t;o++)this.#e[this.#i]=e[o],this.#i=(this.#i+1)%this.#r;this.#o=t}#s(e,t){let o=this.#i-this.#o-this.#t;o<0&&(o+=this.#r);for(let i=0;i<t;i++)e[i]=this.#e[o],o=(o+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 qv=class r extends Ie{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=128/sampleRate*.05;static ID=0;#e=r.ID++;#t;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#o;#n;#s;#l;#a;#c;#u;#h=.005;#d;#p;#f=m.None;#m=!1;#v=!1;#w=!1;#A=!1;#k=-10;#N=2;#F=6;#x=2;#E=140;#B=0;#_=1;#S=0;#b=0;#y=0;#P=0;#$=!1;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new Ne(e.broadcaster,t.address)),this.#d=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#p=Kt.linear(sampleRate);let{lookahead:o,automakeup:i,autoattack:n,autorelease:s,inputgain:a,threshold:l,ratio:c,knee:d,attack:h,release:f,makeup:v,mix:g}=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(c)),this.parameterKnee=this.own(this.bindParameter(d)),this.parameterAttack=this.own(this.bindParameter(h)),this.parameterRelease=this.own(this.bindParameter(f)),this.parameterMakeup=this.own(this.bindParameter(v)),this.parameterMix=this.own(this.bindParameter(g)),this.#o=new Zv(sampleRate),this.#n=new Wv,this.#s=new Kv(sampleRate,.005,128,2),this.#l=new Gv(sampleRate,this.#h,128),this.#a=new Ca(sampleRate),this.#a.setAlpha(.03),this.#c=new Float32Array(128),this.#u=[new Float32Array(128),new Float32Array(128)],this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.address.append(0),this.#d,()=>{this.#d[0]=My(this.#b),this.#d[1]=this.#P,this.#d[2]=My(this.#y)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#$=!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.#S=0,this.#b=0,this.#y=0,this.#P=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#f=m.wrap(e),{terminate:()=>this.#f=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,o){if(this.#f.isEmpty())return;let i=this.#f.unwrap(),n=o-t,s=i.getChannel(0),a=i.getChannel(1),l=this.#r.getChannel(0),c=this.#r.getChannel(1);for(let d=t;d<o;d++){let h=this.#p.moveAndGet(),f=l[d]=s[d]*h,v=c[d]=a[d]*h,g=Math.max(Math.abs(f),Math.abs(v));this.#b<=g?this.#b=g:this.#b*=r.PEAK_DECAY_PER_SAMPLE}this.#c.fill(0,0,n);for(let d=0;d<n;d++){let h=t+d;this.#c[d]=Math.max(Math.abs(l[h]),Math.abs(c[h]))}this.#o.processCrestFactor(this.#c,n),this.#n.applyCompressionToBuffer(this.#c,n),this.#o.applyBallistics(this.#c,n);for(let d=0;d<n;d++){let h=this.#c[d];this.#P>=h?this.#P=h:this.#P+=r.REDUCTION_DECAY_PER_SAMPLE}this.#S=this.#T(this.#c,n),this.#m&&(this.#s.process(this.#r,n),this.#l.process(this.#c,n));for(let d=0;d<n;d++)this.#c[d]=lS(this.#c[d]+this.#B+this.#S);for(let d=0;d<n;d++){let h=t+d;this.#u[0][d]=l[h],this.#u[1][d]=c[h]}for(let d=0;d<n;d++){let h=t+d;l[h]*=this.#c[d],c[h]*=this.#c[d]}for(let d=0;d<n;d++){let h=t+d,f=l[h]*this.#_+this.#u[0][d]*(1-this.#_),v=c[h]*this.#_+this.#u[1][d]*(1-this.#_),g=Math.max(Math.abs(f),Math.abs(v));this.#y<=g?this.#y=g:this.#y*=r.PEAK_DECAY_PER_SAMPLE,l[h]=f,c[h]=v}this.#i.process(l,c,t,o),this.#$=!0}#T(e,t){let o=0;for(let i=0;i<t;i++)o+=e[i];return this.#a.process(-o/t),this.#v?this.#a.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#m=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#v=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#w=this.parameterAutoattack.getValue(),this.#o.setAutoAttack(this.#w),this.#w||this.#o.setAttack(this.#x*.001)):e===this.parameterAutorelease?(this.#A=this.parameterAutorelease.getValue(),this.#o.setAutoRelease(this.#A),this.#A||this.#o.setRelease(this.#E*.001)):e===this.parameterInputgain?this.#p.set(Ke(this.parameterInputgain.getValue()),this.#$):e===this.parameterThreshold?(this.#k=this.parameterThreshold.getValue(),this.#n.setThreshold(this.#k)):e===this.parameterRatio?(this.#N=this.parameterRatio.getValue(),this.#n.setRatio(this.#N)):e===this.parameterKnee?(this.#F=this.parameterKnee.getValue(),this.#n.setKnee(this.#F)):e===this.parameterAttack?(this.#x=this.parameterAttack.getValue(),this.#w||this.#o.setAttack(this.#x*.001)):e===this.parameterRelease?(this.#E=this.parameterRelease.getValue(),this.#A||this.#o.setRelease(this.#E*.001)):e===this.parameterMakeup?this.#B=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#_=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Hv=class r extends Ie{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 ge,this.#i=new np(sampleRate),this.#o=this.own(new Ne(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.own(e.registerProcessor(this)),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 tk=[2,4,8],cS=8,Jv=class r extends Ie{static ID=0;#e=r.ID++;#t;#r;#i;#o;parameterDrive;parameterVolume;#n=m.None;#s=!1;#l;#a;#c;#u;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=[new Float32Array(128*cS),new Float32Array(128*cS)],this.#o=this.own(new Ne(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),t.box.overSampling.catchupAndSubscribe(n=>{let s=tk[n.getValue()];this.#l=new mp(s),this.#c=Kt.linear(sampleRate*s),this.#c.set(Ke(this.parameterDrive.getValue()),this.#s),this.#u=Kt.linear(sampleRate*s),this.#u.set(Ke(this.parameterVolume.getValue()),this.#s),this.#a=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.#a,[n,s]=this.#i;for(let a=0;a<i;a++){let l=this.#u.moveAndGet(),c=this.#c.moveAndGet();n[a]=Cy(n[a]*c)*l,s[a]=Cy(s[a]*c)*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.#c.set(Ke(this.parameterDrive.getValue()),this.#s):e===this.parameterVolume&&this.#u.set(Ke(this.parameterVolume.getValue()),this.#s)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Qv=class extends Ie{#e;#t;#r=[];#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=new ge,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(Ee(s,Si).value.address)))),onRemoved:(({box:s})=>I.removeIf(this.#i,a=>a.address===Ee(s,Si).value.address))}),i.channel.subscribe(s=>{o.ifSome(a=>this.#r.forEach(l=>e.engineToClient.sendMIDIData(a.id.getValue(),rt.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(Ee(d,Ei))}),c=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 h=o/sampleRate,f=Q.pulsesToSeconds(d.position-e,n),v=(h+f)*1e3+c,g=s.getValue();if(fe.isStart(d)){let y=Math.round(d.velocity*127);this.#r.push(d.pitch),l.ifSome(x=>this.context.engineToClient.sendMIDIData(x.id.getValue(),rt.noteOn(g,d.pitch,y),v))}else if(fe.isStop(d)){let y=this.#r.indexOf(d.pitch);y>-1&&this.#r.splice(y,1),l.ifSome(x=>this.context.engineToClient.sendMIDIData(x.id.getValue(),rt.noteOff(g,d.pitch),v))}}}setNoteEventSource(e){return this.#n=m.wrap(e),W.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}=Ee(i.targetVertex.unwrap().box,Ei),a=t*1e3*s.getValue(),l=Ee(e.adapter.field.box,Si).controller.getValue(),c=Math.round(e.getValue()*127),d=rt.control(o.getValue(),l,c);this.context.engineToClient.sendMIDIData(n.getValue(),d,a)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var Yv=class extends Ar{#e;#t;#r;#i=m.None;#o;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new gi(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,()=>{this.#r[this.#o]=0,this.#o=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return B(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),W.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(fe.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 Er.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 Er.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 Xv=class r extends Ie{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#l;#a;#c;#u;#h;#d;#p=m.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new Ne(e.broadcaster,t.address)),this.#o=new sp,this.#n=new Ai(.003,sampleRate),this.#s=new Ai(.003,sampleRate);let{rate:o,depth:i,slope:n,symmetry:s,offset:a,channelOffset:l}=t.namedParameter;this.#l=this.bindParameter(o),this.#a=this.bindParameter(i),this.#c=this.bindParameter(n),this.#u=this.bindParameter(s),this.#h=this.bindParameter(a),this.#d=this.bindParameter(l),this.ownAll(e.broadcaster.broadcastFloat(t.address.append(0),()=>this.#m),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#m=0,this.#f=!0,this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#p=m.wrap(e),{terminate:()=>this.#p=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:o},i,n){if(this.#p.isEmpty())return;let s=this.#p.unwrap(),[a,l]=s.channels(),[c,d]=this.#r.channels();this.#f&&(this.#o.set(this.#a.getValue(),this.#c.getValue(),this.#u.getValue()),this.#f=!1);let{RateFractions:h}=Ui,f=Q.samplesToPulses(1,t,sampleRate),g=1/Xt.toPPQN(h[this.#l.getValue()]),y=this.#h.getValue()/360,x=y+this.#d.getValue()/360;for(let _=i;_<n;_++){let D=(e+_*f)*g+y,V=(e+_*f)*g+x;c[_]=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(c,d),ot.every(o,5)&&(this.#m=(e+(n-i)*f)*g)}parameterChanged(e){(e===this.#a||e===this.#c||e===this.#u)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var GA;(e=>e.create=(t,o)=>o.accept({visitAudioBusBox:i=>new ru(t,t.boxAdapters.adapterFor(i,ir)),visitVaporisateurDeviceBox:i=>new wv(t,t.boxAdapters.adapterFor(i,dc)),visitNanoDeviceBox:i=>new Bv(t,t.boxAdapters.adapterFor(i,fc)),visitTapeDeviceBox:i=>new bv(t,t.boxAdapters.adapterFor(i,uc)),visitPlayfieldDeviceBox:i=>new Dv(t,t.boxAdapters.adapterFor(i,is)),visitSoundfontDeviceBox:i=>new jv(t,t.boxAdapters.adapterFor(i,Sc)),visitMIDIOutputDeviceBox:i=>new Qv(t,t.boxAdapters.adapterFor(i,Tc))}))(GA||={});var qA;(e=>e.create=(t,o)=>G(o.accept({visitUnknownMidiEffectDeviceBox:i=>new Vv(t,t.boxAdapters.adapterFor(i,_c)),visitArpeggioDeviceBox:i=>new _v(t,t.boxAdapters.adapterFor(i,Ci)),visitPitchDeviceBox:i=>new Pv(t,t.boxAdapters.adapterFor(i,hc)),visitVelocityDeviceBox:i=>new Yv(t,t.boxAdapters.adapterFor(i,Mc)),visitZeitgeistDeviceBox:i=>new Ov(t,t.boxAdapters.adapterFor(i,bc))}),`Could not create midi-effect for'${o.name}'`))(qA||={});var Zh;(e=>e.create=(t,o)=>G(o.accept({visitUnknownAudioEffectDeviceBox:i=>new Lh(t,t.boxAdapters.adapterFor(i,Ac)),visitStereoToolDeviceBox:i=>new Rv(t,t.boxAdapters.adapterFor(i,xc)),visitCompressorDeviceBox:i=>new qv(t,t.boxAdapters.adapterFor(i,Nc)),visitDelayDeviceBox:i=>new fv(t,t.boxAdapters.adapterFor(i,ei)),visitTidalDeviceBox:i=>new Xv(t,t.boxAdapters.adapterFor(i,Ui)),visitCrusherDeviceBox:i=>new Hv(t,t.boxAdapters.adapterFor(i,Fc)),visitFoldDeviceBox:i=>new Jv(t,t.boxAdapters.adapterFor(i,$c)),visitReverbDeviceBox:i=>new Fv(t,t.boxAdapters.adapterFor(i,Kl)),visitRevampDeviceBox:i=>new Sv(t,t.boxAdapters.adapterFor(i,Wl)),visitModularDeviceBox:i=>new Lh(t,t.boxAdapters.adapterFor(i,Qn))}),`Could not create audio-effect for'${o.name}'`))(Zh||={});var ey=class extends Ie{#e;#t;#r;#i;#o;#n;#s=m.None;#l=!0;#a=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=Kt.linear(sampleRate),this.#i=Kt.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 c=Ke(this.#o.getValue()),d=this.#n.getValue();this.#r.set((1-Math.max(0,d))*c,this.#a),this.#i.set((1+Math.min(0,d))*c,this.#a),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 c=t;c<o;c++)i[c]=a[c]*this.#r.moveAndGet(),n[c]=l[c]*this.#i.moveAndGet();else{let c=this.#r.get(),d=this.#i.get();for(let h=t;h<o;h++)i[h]=a[h]*c,n[h]=l[h]*d}this.#a=!0}parameterChanged(e){this.#l=!0}};var ty=class extends Ie{#e;#t;#r;#i;#o;#n;#s;#l;#a=Kt.linear(sampleRate);#c=Kt.linear(sampleRate);#u=Kt.linear(sampleRate);#h=m.None;#d=!0;#p=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new Ne(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)),this.readAllParameters()}reset(){this.#i.clear(),this.#t.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#p=!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.#h.isEmpty())return;if(this.#d){let h=this.context.mixer;h.updateSolo();let f=this.isSolo||h.isVirtualSolo(this),v=this.isMute||h.hasChannelSolo()&&!f&&!this.#e.isOutput,g=Ke(this.#o.getValue()),y=this.#n.getValue();this.#a.set((1-Math.max(0,y))*g,this.#p),this.#c.set((1+Math.min(0,y))*g,this.#p),this.#u.set(v?0:1,this.#p),this.#d=!1}let i=this.#h.unwrap(),[n,s]=i.channels(),[a,l]=this.#t.channels(),[c,d]=this.#r;if(this.#a.isInterpolating()||this.#c.isInterpolating()||this.#u.isInterpolating())for(let h=t;h<o;h++){let f=this.#u.moveAndGet(),v=n[h]*this.#a.moveAndGet(),g=s[h]*this.#c.moveAndGet();a[h]=v*f,l[h]=g*f,c[h]=v,d[h]=g}else{let h=this.#a.get(),f=this.#c.get(),v=this.#u.get();for(let g=t;g<o;g++){let y=n[g]*h,x=s[g]*f;c[g]=y,d[g]=x,a[g]=y*v,l[g]=x*v}}this.#i.process(c,d,t,o),this.#p=!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.#d=!0}requestSoloUpdate(){this.#d=!0}setAudioSource(e){return this.#h=m.wrap(e),{terminate:()=>this.#h=m.None}}toString(){return`{${this.constructor.name}}`}};var ry=class{#e=new j;#t;#r;#i;#o;#n;#s;#l=[];#a=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=b.newSet(o=>o.adapter.uuid),this.#o=this.#e.own(new ty(this.#t.context,this.#t.adapter)),this.#n=b.newSet(({device:o})=>o.uuid),this.#s=this.#e.own(new j),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let i=Zh.create(this.#t.context,o.box),n=this.#n.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});B(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 ey(this.#t.context,o));B(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.#a&&(this.#c(),this.#a=!1)}))}get channelStrip(){return this.#o}invalidateWiring(){this.#s.terminate(),this.#a=!0}terminate(){this.#e.terminate(),this.#n.forEach(({device:e})=>e.terminate()),this.#n.clear(),this.#l=[]}toString(){return`{${this.constructor.name}}`}#c(){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){I.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 iy=class{#e=new j;#t;#r;#i;#o;#n;constructor(e,t){this.#t=e,this.#r=t,this.#i=La.create(268431651),this.#o=new Set,this.#n=new Ha,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}}*processNotes(e,t,o){let i=ot.every(o,5);if(this.#n.nonEmpty()&&(!i||ot.every(o,2)?yield*this.#c(e):yield*this.#u(e,t)),this.#o.size>0)for(let n of this.#o){if(n.running.isEmpty()){let{pitch:s,velocity:a}=n,l=Number.POSITIVE_INFINITY,c=fe.start(e,l,s,a);n.running=m.wrap(c),yield c}n.gate||(this.#o.delete(n),yield fe.stop(n.running.unwrap("raw note never started"),e))}if(i){let n=this.#r.tracks.collection.adapters().filter(s=>s.type===ee.Notes&&s.enabled.getValue());for(let s of n)for(let{optClip:a,sectionFrom:l,sectionTo:c}of this.#t.clipSequencing.iterate(s.uuid,e,t))a.isEmpty()?yield*this.#l(s,l,c):yield*this.#s(a.unwrap(),l,c);yield*this.#u(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};t||(yield*this.#n.overlapping(e,er.Comparator))}reset(){this.#n.clear(),this.#o.clear()}toString(){return`{${this.constructor.name}}`}*#s(e,t,o){if(e.optCollection.isEmpty())return;let i=e.optCollection.unwrap(),n=e.duration,s=Eo(t,n),a=s+n;o>a?(yield*this.#a(i,t,a,s),yield*this.#a(i,a,o,a)):yield*this.#a(i,t,o,s)}*#l(e,t,o){for(let i of e.regions.collection.iterateRange(t,o)){if(this.#t.ignoresRegion(i.address.uuid)||i.mute||!Le(i,Vn))continue;let n=i.optCollection;if(n.isEmpty())continue;let s=n.unwrap();for(let{resultStart:a,resultEnd:l,rawStart:c}of cr.locateLoops(i,t,o))yield*this.#a(s,a,l,c)}}*#a(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:c,chance:d,playCount:h,playCurve:f}=a;if(!(d<100&&this.#i.nextDouble(0,100)>d)){if(h>1){let v=er.inverseCurveFunc((n-l)/c,f),g=er.inverseCurveFunc((s-l)/c,f),y=Math.floor(v*h),x=y/h;for(;x<g;){if(x>=v){let _=er.curveFunc(x,f)*c;if(_>=c)break;let D=er.curveFunc(x+1/h,f)*c,V=fe.startWith(a,l+_+i,D-_);this.#n.addAndRetain({...V}),yield V}x=++y/h}}else if(n<=l&&l<s){let v=fe.startWith(a,l+i);this.#n.addAndRetain({...v}),yield v}}}}*#c(e){for(let t of this.#n.releaseAll())yield fe.stop(t,e)}*#u(e,t){for(let o of this.#n.releaseLinearCompleted(t)){let i=X(o.position+o.duration,e,t);yield fe.stop(o,i)}}};var oy=class{#e=new j;#t;#r;#i;#o;#n=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new iy(this.#t.context,this.#t.adapter)),this.#i=b.newSet(({device:t})=>t.uuid),this.#o=this.#e.own(new j),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let o=qA.create(this.#t.context,t.box),i=this.#i.add({device:o,subscription:o.adapter().enabledField.subscribe(()=>this.invalidateWiring())});B(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 ny=class r{static ID=0;#e=r.ID++;#t=new j;#r;#i;#o;#n;#s=m.None;constructor(e,t,o){this.#r=e,this.#i=t,this.#o=this.#t.own(new oy(this)),this.#n=this.#t.own(new ry(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(GA.create(e,n.box.box)))}))}input(){return this.#s}inputAsAudioBus(){return Ee(this.#s.unwrap("No input available"),ru)}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(){console.debug(`terminate ${this}`),this.#t.terminate(),this.#s.ifSome(e=>e.terminate()),this.#s=m.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var sy=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),W.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=o=>{e.has(o)||(e.add(o),o.adapter.input.getValue().ifSome(i=>{i.type==="bus"&&i.box.input.pointerHub.filter(u.AudioOutput).map(n=>G(n.box.accept({visitAudioUnitBox:({address:{uuid:s}})=>this.#e.get(s),visitAuxSendBox:({audioUnit:{targetVertex:s}})=>this.#e.get(s.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(n=>{n.isSolo||this.#r.add(n),t(n)})}))};this.#e.forEach(o=>{o.isSolo&&t(o)}),this.#i=!1}};var ys;(function(r){let e=typeof self<"u"&&"location"in self&&typeof self.location!==void 0,t=typeof self<"u"&&"navigator"in self&&typeof self.navigator!==void 0;r.isLocalHost=()=>e&&location.host.includes("localhost"),r.isMacOS=()=>t&&navigator.userAgent.includes("Mac OS X"),r.isWindows=()=>t&&navigator.userAgent.includes("Windows"),r.isChrome=()=>t&&/chrome|chromium|crios/.test(navigator.userAgent.toLowerCase())&&!/edg|opera|opr/.test(navigator.userAgent.toLowerCase()),r.isFirefox=()=>t&&navigator.userAgent.toLowerCase().includes("firefox"),r.isWeb=()=>!r.isTauriApp(),r.isVitest=typeof process<"u"&&process.env?.VITEST==="true",r.isTauriApp=()=>"__TAURI__"in window,r.userAgent=t?navigator.userAgent.replace(/^Mozilla\/[\d.]+\s*/,"").replace(/\bAppleWebKit\/[\d.]+\s*/g,"").replace(/\(KHTML, like Gecko\)\s*/g,"").replace(/\bSafari\/[\d.]+\s*/g,"").replace(/\s+/g," ").trim():"N/A",r.id=()=>{if(!e)return"";let o="__id__",i=localStorage.getItem(o);if(R(i))return i;let n=b.toString(b.generate());return localStorage.setItem(o,n),n}})(ys||(ys={}));var uS;(function(r){r.encode=async(e,t="gzip")=>{let o=new CompressionStream(t),i=o.writable.getWriter();return i.write(new Uint8Array(e)),i.close(),new Response(o.readable).arrayBuffer()},r.decode=async(e,t="gzip")=>{let o=new DecompressionStream(t),i=o.writable.getWriter();return i.write(new Uint8Array(e)),i.close(),new Response(o.readable).arrayBuffer()}})(uS||(uS={}));var dS;(function(r){r.exportMethod=(i,n)=>o(i,{value:n}),r.exportBoolean=(i,n=!1)=>{let s=new Yt(n);return r.exportAccessor(i,()=>s.getValue(),a=>{let l=!!a;console.debug(`set to ${l}`),s.setValue(l)}),s},r.exportAccessor=(i,n,s=i_)=>o(i,{get:()=>{try{return console.debug(n()),0}catch(a){return console.error(a),1}},set:a=>{try{return s(a),n()}catch(l){return console.error(l),1}},enumerable:!1,configurable:!1});let e=(()=>{try{return self}catch{return{}}})(),t=e.opendaw??={},o=(i,n)=>{let s=i.split("."),a=s.splice(-1)[0],l=t;for(let c of s)l=l[c]??={};Object.defineProperty(l,a,n),console.debug(`Console command 'opendaw.${i}' exported`)}})(dS||(dS={}));var hS;(function(r){r.resolveString=e=>{if(!Jh(e)){if(typeof e=="string")return e;if(Array.isArray(e))return e.join(",");if(typeof e=="object"){if(typeof e.exact=="string")return e.exact;if(Array.isArray(e.exact))return e.exact.join(",");if(typeof e.ideal=="string")return e.ideal;if(Array.isArray(e.ideal))return e.ideal.join(",")}}}})(hS||(hS={}));var pS;(function(r){r.truncateText=(e,t,o)=>{if(t.length===0)return{text:"",width:0};let i=e.measureText(t).width;if(i<=o)return{text:t,width:i};let n=e.measureText("\u2026").width,s=0,a=t.length|0;for(;s<a;){let c=a+s>>>1;i=e.measureText(t.substring(0,c+1)).width+n,i<=o?s=c+1:a=c}if(s===0)return{text:"",width:0};let l=t.substring(0,s);return{text:l+"\u2026",width:e.measureText(l).width+n}}})(pS||(pS={}));var fS;(function(r){r.calc=(t,o,i)=>{let n=/([0-9]*\.?[0-9]+)([a-zA-Z%]*)/g,s=t;return s.split(/\+|(?<!\d)-/).flatMap(a=>Array.from(a.matchAll(n))).forEach(([a,l,c])=>{let d=parseFloat(l);if(isNaN(d))return P(`${a} does not contain a number`);if(c==="em")s=s.replaceAll(a,`${d*i}`);else if(c==="%")s=s.replaceAll(a,`${d/100*o}`);else if(c==="px")s=s.replaceAll(a,`${d}`);else return P(`Unknown unit '${c}'`)}),Function(`return ${s}`)()};let e=new Map;r.registerCustomCursor=(t,o)=>e.set(t,o),r.setCursor=(t,o=document)=>{o.documentElement.style.cursor=typeof t=="number"?e.get(t)??"auto":t}})(fS||(fS={}));var qh;(function(r){let e=new Set,t=new Set,o=new Array,i=-1,n=null;r.add=a=>(t.add(a),{terminate:()=>t.delete(a)}),r.once=a=>{e.add(a)},r.start=a=>{n!==a&&(n?.cancelAnimationFrame(i),n=a,i=a.requestAnimationFrame(s))},r.stop=()=>{n?.cancelAnimationFrame(i),n=null,i=-1},r.terminate=()=>{r.stop(),o.length=0,t.clear(),e.clear()};let s=()=>{(t.size>0||e.size>0)&&(t.forEach(a=>o.push(a)),e.forEach(a=>o.push(a)),e.clear(),o.forEach(a=>a()),o.length=0),i=n?.requestAnimationFrame(s)??-1}})(qh||(qh={}));var _r=class{static subscribe(e,t,o,i){return e.addEventListener(t,o,i),{terminate:()=>e.removeEventListener(t,o,i)}}static subscribeAny(e,t,o,i){return e.addEventListener(t,o,i),{terminate:()=>e.removeEventListener(t,o,i)}}static DOUBLE_DOWN_THRESHOLD=200;static subscribeDblDwn=(e,t)=>{let o=0;return this.subscribe(e,"pointerdown",i=>{let n=performance.now();n-o<this.DOUBLE_DOWN_THRESHOLD&&t(i),o=n},{capture:!0})};static PreventDefault=e=>e.preventDefault();static isTextInput=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&R(e.getAttribute("contenteditable"))};var xs;(function(r){r.isControlKey=({ctrlKey:e,metaKey:t})=>ys.isMacOS()?t:e,r.isCopyKey=({altKey:e})=>e,r.GlobalShortcut=Object.freeze({isDelete:e=>!_r.isTextInput(e.target)&&(e.code==="Delete"||e.code==="Backspace"),isSelectAll:e=>r.isControlKey(e)&&!e.shiftKey&&e.code==="KeyA",isDeselectAll:e=>r.isControlKey(e)&&e.shiftKey&&e.code==="KeyA"})})(xs||(xs={}));var mS;(function(r){r.usePointerLock=!1,r.attach=(e,t,o)=>{let i=new j;return W.many(i,_r.subscribe(e,"pointerdown",n=>{if(o?.multiTouch!==!0&&!n.isPrimary||n.buttons!==1||ys.isMacOS()&&n.ctrlKey)return;let s=t(n);if(s.isEmpty())return;let a=s.unwrap(),l=n.pointerId;n.stopPropagation(),n.stopImmediatePropagation(),e.setPointerCapture(l);let c=o?.pointerLock!==!1&&r.usePointerLock,d=o?.pointerLockThreshold??16,h=e instanceof Element?e:null,f=!1,v=(_,D)=>{if(!c||h===null||f)return;let V=_<d,K=_>window.innerWidth-d,H=D<d,be=D>window.innerHeight-d;(V||K||H||be)&&(h.requestPointerLock?.(),f=!0)},g={clientX:n.clientX,clientY:n.clientY,altKey:n.altKey,shiftKey:n.shiftKey,ctrlKey:xs.isControlKey(n)};o?.immediate===!0&&a.update(g),o?.permanentUpdates===!0?(i.own(qh.add(()=>a.update(g))),i.own(_r.subscribe(e,"pointermove",_=>{_.pointerId===l&&(h!==null&&document.pointerLockElement===h?(g.clientX+=_.movementX,g.clientY+=_.movementY):(g.clientX=_.clientX,g.clientY=_.clientY,v(_.clientX,_.clientY)),g.altKey=_.altKey,g.shiftKey=_.shiftKey,g.ctrlKey=xs.isControlKey(_))}))):i.own(_r.subscribe(e,"pointermove",_=>{_.pointerId===l&&(h!==null&&document.pointerLockElement===h?(g.clientX+=_.movementX,g.clientY+=_.movementY):(g.clientX=_.clientX,g.clientY=_.clientY,v(_.clientX,_.clientY)),g.altKey=_.altKey,g.shiftKey=_.shiftKey,g.ctrlKey=xs.isControlKey(_),a.update(g))}));let y=()=>{f&&h!==null&&document.pointerLockElement===h&&document.exitPointerLock(),a.cancel?.call(a),a.finally?.call(a),i.terminate()},x=r_(e,"ownerDocument","defaultView")??self;i.ownAll(_r.subscribe(e,"pointerup",_=>{_.pointerId===l&&(f&&h!==null&&document.pointerLockElement===h&&document.exitPointerLock(),a.approve?.call(a),a.finally?.call(a),i.terminate())},{capture:!0}),_r.subscribe(e,"pointercancel",_=>{console.debug(_.type),_.pointerId===l&&(e.releasePointerCapture(l),y())},{capture:!0}),_r.subscribe(x,"beforeunload",_=>{e.releasePointerCapture(l),y()},{capture:!0}),_r.subscribe(x,"keydown",_=>{g.altKey=_.altKey,g.shiftKey=_.shiftKey,g.ctrlKey=xs.isControlKey(_),_.key==="Escape"?y():a.update(g)}),_r.subscribe(x,"keyup",_=>{g.altKey=_.altKey,g.shiftKey=_.shiftKey,g.ctrlKey=xs.isControlKey(_),a.update(g)})),R(a.abortSignal)&&i.own(_r.subscribe(a.abortSignal,"abort",()=>{e.releasePointerCapture(l),y()}))}))}})(mS||(mS={}));var gS;(function(r){r.save=async(e,t)=>{if(R(window.showSaveFilePicker)){let o=await window.showSaveFilePicker(t),i=await o.createWritable();return await i.truncate(0),await i.write(e),await i.close(),o.name??"unknown"}else{let o=new Blob([e]),i=URL.createObjectURL(o),n=document.createElement("a");return n.href=i,n.download=t?.suggestedName??"unknown",n.click(),URL.revokeObjectURL(i),t?.suggestedName??"Unknown"}},r.open=async e=>{if(R(window.showOpenFilePicker)){let{status:t,value:o,error:i}=await mn.tryCatch(window.showOpenFilePicker(e));return t==="rejected"?Promise.reject(i):Promise.all(o.map(n=>n.getFile()))}else return new Promise((t,o)=>{R(e)&&console.warn("FileApi.showOpenFilePicker is emulated in this browser. OpenFilePickerOptions are ignored.");let i=document.createElement("input");i.type="file",i.multiple=e?.multiple??!1,i.style.display="none",i.addEventListener("cancel",async()=>{i.remove(),o(new DOMException("cancel","AbortError"))}),i.addEventListener("change",async n=>{let a=n.target.files;R(a)?t(I.create(l=>G(a.item(l),`No file at index ${l}`),a.length)):o(new DOMException("cancel","AbortError")),i.remove()}),document.body.appendChild(i),i.click()})}})(gS||(gS={}));var vS;(function(r){r.parse=e=>{let t=document.createElement("div");if(t.innerHTML=e,t.childElementCount!==1)return P(`Source html has more than one root elements: '${e}'`);let o=t.firstChild;return o instanceof HTMLElement||o instanceof SVGSVGElement?o:P(`Cannot parse to HTMLOrSVGElement from '${e}'`)},r.empty=e=>{for(;e.firstChild!==null;)e.firstChild.remove()},r.query=(e,t=document)=>G(t.querySelector(e)),r.queryAll=(e,t=document)=>Array.from(t.querySelectorAll(e)),r.sanitize=e=>{e.querySelectorAll("script").forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{[...t.attributes].forEach(o=>{o.name.toLowerCase().startsWith("on")&&t.removeAttribute(o.name)})})},r.nextID=(()=>{let e=0;return()=>(++e).toString(16).padStart(4,"0")})(),r.adoptStyleSheet=(e,t)=>{B(e.includes("component"),`No 'component' found in: ${e}`);let o=`${t??"C"}${r.nextID()}`,i=new CSSStyleSheet;return i.replaceSync(e.replaceAll("component",`.${o}`)),i.cssRules.length===0?P(`No cssRules found in: ${e}`):(document.adoptedStyleSheets.push(i),o)},r.buildClassList=(...e)=>e.filter(t=>t!==!1&&t!==void 0).join(" "),r.readCssVarColor=(...e)=>{let t=document.createElement("div");document.body.appendChild(t);let o=e.map(i=>(t.style.color=i,Yh.parseCssRgbOrRgba(getComputedStyle(t).color)));return t.remove(),o},r.watchResize=(e,t,o)=>{let i=new ResizeObserver(([n],s)=>t(n,s));return i.observe(e,o),{terminate:()=>i.disconnect()}},r.watchIntersection=(e,t,o)=>{let i=new IntersectionObserver(t,o);return i.observe(e),{terminate:()=>i.disconnect()}},r.secureBoundingBox=e=>{let t=e.getBoundingClientRect();if(!lu.isEmpty(t))return t;for(let o of e.children)lu.union(t,r.secureBoundingBox(o));return t},r.unfocus=(e=self)=>{let t=e.document.activeElement;t!==null&&"blur"in t&&typeof t.blur=="function"&&t.blur()},r.selectContent=e=>{let t=document.createRange(),o=window.getSelection();R(o)&&(t.selectNodeContents(e),o.removeAllRanges(),o.addRange(t))},r.unselectContent=e=>{let t=window.getSelection();!R(t)||t.rangeCount===0||e.contains(t.getRangeAt(0).commonAncestorContainer)&&t.removeAllRanges()},r.limitChars=(e,t,o)=>{if(!(t in e))return P(`${t} not found in ${e}`);if(typeof e[t]!="string")return P(`${t} in ${e} is not a string`);if(e[t].length>o)if(e[t]=e[t].substring(0,o),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.setSelectionRange(o,o);else{let i=e.ownerDocument,n=i.createRange(),s=i.defaultView?.getSelection();if(!R(s))return;n.selectNodeContents(e),n.collapse(!1),s.removeAllRanges(),s.addRange(n)}},r.EmptyGif="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="})(vS||(vS={}));var cue=(()=>{let r={Cmd:"\u2318",Opt:"\u2325",Shift:"\u21E7"},e={Cmd:"Ctrl",Opt:"Alt",Shift:"\u21E7"};return Object.freeze({Mac:r,Win:e,System:ys.isMacOS()?r:e})})();var yS;(function(r){r.read=async e=>{let t=[];for(;;){let{done:s,value:a}=await e.read();if(s)break;t.push(a)}let o=t.reduce((s,a)=>s+a.length,0),i=new Uint8Array(o),n=0;for(let s of t)i.set(s,n),n+=s.length;return i.buffer}})(yS||(yS={}));var xS;(function(r){r.pathBuilder=()=>new class{#e="";moveTo(e,t){return this.#e+=`M${e.toFixed(3)} ${t.toFixed(3)}`,this}lineTo(e,t){return this.#e+=`L${e.toFixed(3)} ${t.toFixed(3)}`,this}quadratic(e,t,o,i){return this.#e+=`Q${e.toFixed(3)} ${t.toFixed(3)} ${o.toFixed(3)} ${i.toFixed(3)}`,this}quadraticTo(e,t){return this.#e+=`T${e.toFixed(3)} ${t.toFixed(3)}`,this}cubic(e,t,o,i,n,s){return this.#e+=`Q${e.toFixed(3)} ${t.toFixed(3)} ${o.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)}`,this}arc(e,t,o,i,n,s,a){return this.#e+=`A${e} ${t} ${o} ${i?1:0} ${n?1:0} ${s.toFixed(3)} ${a.toFixed(3)}`,this}circleSegment(e,t,o,i,n){let s=e+Math.cos(i)*o,a=t+Math.sin(i)*o,l=e+Math.cos(n)*o,c=t+Math.sin(n)*o,d=n-i;for(;d<0;)d+=Math.PI*2;return this.moveTo(s,a).arc(o,o,0,d>Math.PI,!0,l,c)}close(){return this.#e+="Z",this}get(){return this.#e}}})(xS||(xS={}));var wS;(function(r){let e=new Array;r.watchWeak=(o,i)=>{let n=new WeakRef(o),s=i(n);return e.push([n,s]),e.length===1&&t(),o};let t=()=>{console.debug("start weak watching");let o=setInterval(()=>{let i=e.length;for(;--i>=0;){let n=e[i];n[0].deref()===void 0&&(n[1].terminate(),e.splice(i,1),e.length===0&&clearInterval(o))}},1e3)}})(wS||(wS={}));var ay=Symbol.for("@openDAW/lib-dom");globalThis[ay]?console.debug(`%c${ay.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[ay]=!0,console.debug(`%c${ay.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var rn;(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"})(rn||(rn={}));var nu;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(nu||(nu={}));var Da;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(Da||(Da={}));var ly=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#o=We.create(0);#n=m.None;#s=m.None;#l=-1;#a=-1;#c=!1;#u=!1;constructor(e){this.#i=tr.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.#u||(this.#i.sendShareLock(this.#t),this.#u=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#d();if(this.#o.remaining<t){let o=So(t),i=new SharedArrayBuffer(o);this.#o=We.use(i),this.#n=m.wrap(i),this.#i.sendUpdateData(i)}}this.#n.isEmpty()||Atomics.load(this.#r,0)===nu.WRITE&&(this.#p(this.#o),this.#o.position=0,Atomics.store(this.#r,0,nu.READ))}broadcastFloat(e,t){return this.#m(new class{type=rn.Float;address=e;capacity=8;put(o){o.writeFloat(t())}})}broadcastInteger(e,t){return this.#m(new class{type=rn.Integer;address=e;capacity=8;put(o){o.writeInt(t())}})}broadcastFloats(e,t,o,i){return this.#m(new class{type=rn.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(n){A(o),n.writeInt(t.length);for(let s of t)n.writeFloat(s);A(i)}})}broadcastIntegers(e,t,o){return this.#m(new class{type=rn.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(i){o(),i.writeInt(t.length),t.forEach(n=>i.writeInt(n))}})}broadcastByteArray(e,t,o){return this.#m(new class{type=rn.ByteArray;address=e;capacity=4+t.byteLength;put(i){o(),i.writeInt(t.byteLength),i.writeBytes(t)}})}#h(){if(this.#c){try{this.#s=m.wrap(this.#w())}catch(e){throw e}this.#c=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=m.None,e}return m.None}#d(){return this.#a===-1&&(this.#a=this.#f()+12),this.#a}terminate(){I.clear(this.#e),this.#s=m.None,this.#c=!1,this.#a=0}#p(e){B(!this.#c&&this.#s.isEmpty(),"Cannot flush while update is available");let t=this.#d();B(e.remaining>=t,"Insufficient data"),e.writeInt(this.#l),e.writeInt(Da.START);for(let o of this.#e)o.put(e);e.writeInt(Da.END)}#f(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#m(e){return this.#e.push(e),this.#v(),{terminate:()=>{I.removeOpt(this.#e,e),this.#v()}}}#v(){this.#a=-1,this.#c=!0}#w(){let e=We.create();e.writeInt(Da.ID),e.writeInt(++this.#l),e.writeInt(this.#e.length);for(let{address:t,type:o}of this.#e)t.write(e),e.writeByte(o);return e.toArrayBuffer()}};var ws;(function(r){class e{shift;numPeaks;dataOffset;constructor(o,i,n){this.shift=o,this.numPeaks=i,this.dataOffset=n}unitsEachPeak(){return 1<<this.shift}}r.Stage=e,r.unpack=(t,o)=>{switch(o){case 0:return sn.intBitsToFloat(t);case 1:return sn.intBitsToFloat(t>>16);default:return bo(o)}}})(ws||(ws={}));var cy=class r{stages;data;numFrames;numChannels;static from(e){B(e.readString()==="PEAKS","Wrong header");let t=e.readInt(),o=[];for(let l=0;l<t;l++){let c=e.readInt(),d=e.readInt(),h=e.readInt();e.readInt(),o[l]=new ws.Stage(h,d,c)}let i=e.readInt(),n=[];for(let l=0;l<i;l++){let c=new Int8Array(e.readInt());e.readBytes(c),n[l]=new Int32Array(c.buffer)}let s=e.readInt(),a=e.readInt();return new r(o,n,s,a)}static None=new r([],[],0,0);static findBestFit=(e,t=1200)=>{let o=e/t;if(o<=1)return new Uint8Array(0);let i=3,n=Math.floor(Math.log(o)/Math.LN2),s=Math.max(1,Math.floor(n/i));return new Uint8Array(I.create(a=>i*(a+1),s))};constructor(e,t,o,i){this.stages=e,this.data=t,this.numFrames=o,this.numChannels=i}nearest(e){if(this.stages.length===0)return null;let t=Math.floor(Math.log(Math.abs(e))/Math.LN2),o=this.stages.length;for(;--o>-1;)if(t>=this.stages[o].shift)return this.stages[o];return this.stages[0]}toArrayBuffer(){let e=We.create();e.writeString("PEAKS"),e.writeInt(this.stages.length);for(let t=0;t<this.stages.length;t++){let{dataOffset:o,numPeaks:i,shift:n}=this.stages[t];e.writeInt(o),e.writeInt(i),e.writeInt(n),e.writeInt((1<<n)-1)}e.writeInt(this.data.length);for(let t=0;t<this.data.length;t++){let o=new Int8Array(this.data[t].buffer);e.writeInt(o.length),e.writeBytes(o)}return e.writeInt(this.numFrames),e.writeInt(this.numChannels),e.toArrayBuffer()}toString(){return`{SamplePeaks num-stages: ${this.stages.length}}`}};var bS;(function(r){r.install=o=>tr.executor(o.channel("peaks"),new class{async generateAsync(i,n,s,a,l){return e(i,n,s,a,l).toArrayBuffer()}});let e=(o,i,n,s,a)=>{if(n.length!==a)return P(`Invalid numberOfChannels. Expected: ${a}. Got ${n.length}`);class l{min=Number.POSITIVE_INFINITY;max=Number.NEGATIVE_INFINITY;index=0}let c=C_(),d=i.length,[h,f]=t(i,s),v=I.create(()=>new Int32Array(f),a),g=(1<<h[0].shift)-1,y=a*s,x=0;for(let _=0;_<a;++_){let D=v[_],V=n[_],K=I.create(()=>new l,d),H=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,Te=0;for(let ne=0;ne<s;++ne){let Me=V[ne];if(H=Math.min(Me,H),be=Math.max(Me,be),(++Te&g)===0){for(let J=0;J<d;++J){let ve=h[J],Ue=K[J];Ue.min=Math.min(Ue.min,H),Ue.max=Math.max(Ue.max,be),((1<<ve.shift)-1&Te)===0&&(D[ve.dataOffset+Ue.index++]=r.pack(Ue.min,Ue.max),Ue.min=Number.POSITIVE_INFINITY,Ue.max=Number.NEGATIVE_INFINITY)}H=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY}(++x&65535)===0&&o(x/y)}}return o(1),c.lab(`SamplePeaks '${self.constructor.name}'`),new cy(h,v,s,a)},t=(o,i)=>{let n=0;return[I.create(a=>{let l=o[a],c=Math.ceil(i/(1<<l)),d=new ws.Stage(l,c,n);return n+=c,d},o.length),n]};r.pack=(o,i)=>{let n=sn.floatToIntBits(o),s=sn.floatToIntBits(i);return n|s<<16}})(bS||(bS={}));var AS;(function(r){r.renderBlocks=(e,t,o,{u0:i,u1:n,v0:s,v1:a,x0:l,x1:c,y0:d,y1:h})=>{let f=(n-i)/(c-l),v=t.nearest(f);if(v===null)return;let g=(h-d-1)/(a-s),y=v.unitsEachPeak(),x=l-Math.floor(l),_=f/y,D=(i-x*f)/f*_,V=Math.floor(D),K=0,H=0,be=t.data[o];for(let Te=Math.floor(l);Te<Math.floor(c);Te++){let ne=D+_,Me=Math.floor(ne),J=!1;for(;V<Me;){let Ct=be[v.dataOffset+V++];K=Math.min(ws.unpack(Ct,0),K),H=Math.max(ws.unpack(Ct,1),H),J=!0}let ve=d+Math.floor((K-s)*g),Ue=d+Math.floor((H-s)*g),Mt=Math.max(d,Math.min(ve,Ue)),Pr=Math.min(h,Math.max(ve,Ue));if(e.fillRect(Te,Mt,1,Pr===Mt?1:Pr-Mt),J){let Ct=H;H=K,K=Ct}D=ne,V=Me}}})(AS||(AS={}));var _S;(function(r){r.init=o=>tr.executor(o.channel("opfs"),new class{#e=new Map;async write(i,n){await this.#t(i,async()=>{let s=await this.#r(i,{create:!0});try{s.truncate(n.length),s.write(n.buffer,{at:0}),s.flush()}finally{s.close()}})}async read(i){return await this.#t(i,async()=>{let n=await this.#r(i);try{let s=n.getSize(),a=new Uint8Array(s);return n.read(a),a}finally{n.close()}})}async delete(i){await this.#t(i,async()=>{let n=t(i);return n.length===0?this.clear():this.#i(n.slice(0,-1)).then(s=>s.removeEntry(G(n.at(-1)),{recursive:!0}))})}async list(i){let n=t(i),{status:s,value:a}=await mn.tryCatch(this.#i(n));if(s==="rejected")return I.empty();let l=[];for await(let{name:c,kind:d}of a.values())l.push({name:c,kind:d});return l}async clear(){let i=await navigator.storage.getDirectory();for await(let[n,s]of i.entries())s.kind==="file"?await i.removeEntry(n):s.kind==="directory"&&await i.removeEntry(n,{recursive:!0})}async#t(i,n){for(;;){let s=this.#e.get(i);if(Ra(s)){await s;continue}let a=()=>P("Lock not acquired"),l=new Promise(c=>a=c);this.#e.set(i,l);try{return await n()}finally{this.#e.get(i)===l&&this.#e.delete(i),a()}}}async#r(i,n){let s=t(i);return await(await(await this.#i(s.slice(0,-1),n)).getFileHandle(G(s.at(-1)),n)).createSyncAccessHandle()}async#i(i,n){let s=await navigator.storage.getDirectory();for(let a of i)s=await s.getDirectoryHandle(a,n);return s}});let t=o=>{let i=o.replace(/^\/+|\/+$/g,"");return i===""?[]:i.split("/")}})(_S||(_S={}));var uy=Symbol.for("@openDAW/lib-fusion");globalThis[uy]?console.debug(`%c${uy.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[uy]=!0,console.debug(`%c${uy.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"));var dy=class{#e;#t;#r=new ge;#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&&ot.every(a,1)){let[l,c]=this.#e.signature,d=Q.fromSignature(1,c);for(let h of Wi.iterate(t,o,d)){B(t<=h&&h<o,`${h} out of bounds (${t}, ${o})`);let f=Math.floor(Q.pulsesToSamples(h-t,i,sampleRate));this.#i.push(new HA(h,n+f,l,c))}}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}},HA=class{#e;#t=0;#r=0;constructor(e,t,o,i){B(t>=0&&t<128,`${t} out of bounds`),this.#e=Q.toParts(e,o,i).beats===0?880:440,this.#r=t}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 c=Math.min(this.#t/s,1-(this.#t-s)/a),d=Math.sin(this.#t/sampleRate*bi*this.#e)*.25*c*c;if(i[l]+=d,n[l]+=d,++this.#t>s+a)return!0}return this.#r=0,!1}};var hy=class{#e;#t;#r=!0;#i=!1;#o=null;#n=!1;#s=0;constructor(e,t){this.#e=e,this.#e.timelineBoxAdapter.markerTrack.subscribe(()=>this.#n=!0),this.#e.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#t=new ja}setCallback(e,t){return this.#t.add(e,t),W.create(()=>this.#t.remove(e,t))}reset(){this.#i=!1,this.#n=!1,this.#s=0,this.#o=null}process(e){let t=!1,{timeInfo:o,timelineBoxAdapter:{box:i,markerTrack:n}}=this.#e,s=i.bpm.getValue(),a=o.transporting;if(a){let l=[],c=o.position,d=0,h=0,f=o.getLeapStateAndReset();for(;d<128;){if(this.#n||f){this.#n=!1;let ne=n.events.lowerEqual(c);(this.#o?.at(0)??null)!==ne&&(this.#o=R(ne)?[ne,0]:null,t=!0)}let v=128-d,g=c+Q.samplesToPulses(v,s,sampleRate),y=null,x=Number.POSITIVE_INFINITY;if(n.enabled){let ne=Array.from(He.take(n.events.iterateFrom(c),2));if(ne.length>0){let[Me,J]=ne;this.#o===null?Me.position>=c&&Me.position<g&&(y={type:"marker",prev:Me,next:J},x=Me.position):R(J)&&J!==this.#o[0]&&Me.position<c&&J.position<g&&(y={type:"marker",prev:Me,next:J},x=J.position)}}let{isRecording:_,isCountingIn:D}=this.#e.timeInfo,{from:V,to:K,enabled:H}=i.loopArea;if(H.getValue()&&!(_||D)||this.#r){let ne=K.getValue();c<ne&&g>ne&&ne<x&&(y={type:"loop",target:V.getValue()},x=ne)}if(this.#t.keyCount()>0)for(let ne of this.#t.keys())c<ne&&g>ne&&ne<x&&(y={type:"callback",position:ne,callbacks:this.#t.get(ne)},x=ne);let Te=!o.isCountingIn;if(y===null){let ne=d+v;l.push({index:h++,p0:c,p1:g,s0:d,s1:ne,bpm:s,flags:eu.create(a,f,Te,this.#i)}),f=!1,c=g,d=ne}else{let ne=()=>{if(x>c){let J=d+Q.pulsesToSamples(x-c,s,sampleRate)|0;l.push({index:h++,p0:c,p1:x,s0:d,s1:J,bpm:s,flags:eu.create(a,f,Te,this.#i)}),f=!1,c=x,d=J}},Me=()=>{if(d<128){let J=d+Q.pulsesToSamples(g-c,s,sampleRate)|0;l.push({index:h++,p0:c,p1:x,s0:d,s1:J,bpm:s,flags:eu.create(!1,!1,!1,this.#i)}),d=J}};switch(y.type){case"loop":{ne(),this.#r?(this.#e.timeInfo.pause(),Me()):(c=y.target,f=!0);break}case"marker":{let{prev:J,next:ve}=y;!R(this.#o)||this.#o[0]!==J?this.#o=[J,0]:++this.#o[1]<J.plays||J.plays===0?(ne(),c=J.position,f=!0):this.#o=[ve,0],t=!0;break}case"callback":{ne(),y.callbacks.forEach(J=>J());break}}}this.#i=!1}e({blocks:l}),o.advanceTo(c),this.#s=c}else{if(this.#n||o.getLeapStateAndReset()){this.#n=!1;let h=n.events.lowerEqual(o.position);h!==null&&this.#o?.at(0)!==h&&(this.#o=[h,0],t=!0)}let l=this.#s,c=l+Q.samplesToPulses(128,s,sampleRate),d={blocks:[{index:0,p0:l,p1:c,s0:0,s1:128,bpm:s,flags:eu.create(!1,!1,!1,!1)}]};e(d),this.#s=c}t&&this.#e.engineToClient.switchMarkerState(R(this.#o)?[this.#o[0].uuid,this.#o[1]]:null)}};var JA=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 W.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},py=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 JA(t,this.#e))}remove(e){}invalidate(e){}};var fy=class{constructor(e){this.uuid=e}waiting=m.None;playing=m.None},my=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(su);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 fy(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})`),I.removeOpt(this.#o,e.uuid),o.waiting=m.wrap(m.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,i=>new fy(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=Eo(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.playback.loop.getValue())yield{optClip:i.playing,sectionFrom:t,sectionTo:o};else{let s=Eo(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 QA;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(QA||={});var YA=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 W.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},gy=class{#e;#t;constructor(e){this.#e=e,this.#t=b.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new YA(t,this.#e))}remove(e){}invalidate(e){}};var vy=class r extends Jt{static ClockRate=Q.fromSignature(1,96);#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=[],this.own(this.context.registerProcessor(this))}schedule(e){this.#t.push(e)}reset(){this.eventInput.clear()}process({blocks:e}){let t=this.#e.midiOutputDevices;if(t.length===0){this.#t.length=0;return}let 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.engineToClient.sendMIDIData(n,a,s)),this.#t.length=0}),e.forEach(({p0:i,p1:n,s0:s,bpm:a,flags:l})=>{let c=s/sampleRate;if(ot.every(l,1))for(let d of Wi.iterate(i,n,r.ClockRate)){let h=Q.pulsesToSeconds(d-i,a);o.forEach(f=>{let v=f.id.getValue(),g=f.delayInMs.getValue(),y=(c+h)*1e3+g;this.context.engineToClient.sendMIDIData(v,rt.Clock,y)})}})}toString(){return`{${this.constructor.name}}`}};var rk=!1,yy=class extends AudioWorkletProcessor{#e;#t;#r;#i;#o;#n;#s;#l;#a;#c;#u;#h;#d;#p;#f;#m;#v;#w;#A;#k;#N;#F;#x;#E;#B;#_;#S;#b;#y=m.None;#P=m.None;#$=m.None;#T=!1;#M=!0;#I=!1;#D=0;#C=0;#R=!0;#O=1;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:o,exportConfiguration:i,options:n}}){super();let{boxGraph:s,mandatoryBoxes:{rootBox:a,timelineBox:l}}=cs.decode(o);this.#e=new j,this.#t=T_.for(this.port),this.#r=s,this.#i=new Fp,this.#_=new Int32Array(t),this.#o=tr.sender(this.#t.channel("engine-to-client"),c=>new class{log(d){c.dispatchAndForget(this.log,d)}error(d){c.dispatchAndForget(this.error,d)}fetchAudio(d){return c.dispatchAndReturn(this.fetchAudio,d)}fetchSoundfont(d){return c.dispatchAndReturn(this.fetchSoundfont,d)}notifyClipSequenceChanges(d){c.dispatchAndForget(this.notifyClipSequenceChanges,d)}switchMarkerState(d){c.dispatchAndForget(this.switchMarkerState,d)}sendMIDIData(d,h,f){c.dispatchAndForget(this.sendMIDIData,d,h,f)}ready(){c.dispatchAndForget(this.ready)}}),this.#s=new py(this.#o),this.#l=new gy(this.#o),this.#a=b.newSet(c=>c.adapter.uuid),this.#d=new Ym,this.#h=new vp(l.bpm),this.#n=this.#e.own(new Um(this)),this.#c=this.#n.adapterFor(a,cc),this.#u=this.#n.adapterFor(l,ao),this.#p=new cp,this.#f=new up(this.#p),this.#m=new te,this.#v=new sy,this.#F=new dy(this.#u,this.#i),this.#x=new vy(this,this.#c),this.#E=new hy(this,n),this.#b=b.newSet(c=>c),this.#B=Za.writer(kP(),e,c=>{let{transporting:d,isCountingIn:h,isRecording:f,position:v}=this.#i,g=this.#u.box.signature.denominator.getValue();c.position=v,c.playbackTimestamp=this.#C,c.countInBeatsRemaining=h?(this.#D-v)/Q.fromSignature(1,g):0,c.isPlaying=d,c.isRecording=f,c.isCountingIn=h}),this.#w=this.#e.own(ly.create(this.#t,"engine-live-data")),this.#k=new hv(this),this.#N=this.#e.own(new Ne(this.#w,he.compose(b.Lowest))),this.#A=this.#e.own(new my(this.#r)),this.#e.ownAll(R_(this.#r,this.#t.channel("engine-sync")),tr.executor(this.#t.channel("engine-commands"),{play:()=>this.#V(),stop:c=>this.#z(c),setPosition:c=>this.#U(c),prepareRecordingState:c=>this.#j(c),stopRecording:()=>this.#L(),setMetronomeEnabled:c=>this.#i.metronomeEnabled=this.#I=c,setPlaybackTimestampEnabled:c=>this.#R=c,setCountInBarsTotal:c=>this.#O=c,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(c=>c.accept({visitAudioFileBox:d=>this.#s.getOrCreate(d.address.uuid).data.nonEmpty()&&d.pointerHub.nonEmpty()})??!0)),panic:()=>this.#T=!0,noteSignal:c=>{if(as.isOn(c)){let{uuid:d,pitch:h,velocity:f}=c;this.optAudioUnit(d).ifSome(v=>v.midiDeviceChain.noteSequencer.pushRawNoteOn(h,f))}else if(as.isOff(c)){let{uuid:d,pitch:h}=c;this.optAudioUnit(d).ifSome(f=>f.midiDeviceChain.noteSequencer.pushRawNoteOff(h))}},ignoreNoteRegion:c=>this.#b.add(c),scheduleClipPlay:c=>{c.forEach(d=>{let h=this.#r.findBox(d);if(h.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${b.toString(d)}'`);else{let f=yf.for(this.#n,h.unwrap());this.#A.schedulePlay(f)}}),this.#i.transporting=!0,this.#x.schedule(rt.Start)},scheduleClipStop:c=>{c.forEach(d=>{let h=this.#r.findBox(d);h.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${b.toString(d)}'`):this.#A.scheduleStop(this.#n.adapterFor(h.unwrap(),ut))})},terminate:()=>{this.#$.ifSome(c=>c.terminate()),this.#$=m.None,this.#M=!1,this.#b.clear(),this.#e.terminate()}}),this.#c.audioUnits.catchupAndSubscribe({onAdd:c=>{let d=b.toString(c.uuid),h=R(i?.[d])?i[d]:QA.Default,f=new ny(this,c,h),v=this.#a.add(f);if(B(v,`Could not add ${f}`),f.adapter.isOutput){B(this.#P.isEmpty(),"Output can only assigned once."),this.#P=m.wrap(f);return}},onRemove:({uuid:c})=>this.#a.removeByKey(c).terminate(),onReorder:Vr})),this.#S=m.wrap(i).match({none:()=>I.empty(),some:c=>Object.keys(c).map(d=>this.#a.get(b.parse(d)))}),this.#o.ready(),console.log=(...c)=>this.#o.log(c.join(", "))}ignoresRegion(e){return this.#b.hasKey(e)}process(e,t){if(!this.#M)return!1;if(Atomics.load(this.#_,0)===1)return!0;try{return this.render(e,t)}catch(o){return console.debug(o),this.#M=!1,this.#o.error(o),this.terminate(),!1}}render(e,[t]){if(!this.#M)return!1;if(this.#T)return P("Manual Panic");let o=this.#i.metronomeEnabled;this.#m.notify(0),this.#y.isEmpty()&&(this.#f.update(),this.#y=m.wrap(this.#f.sorted().concat()),rk&&console.debug(`%cAudio-Graph%c
|
|
28
|
-
${this.#
|
|
29
|
-
`)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let
|
|
25
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let d=p[1];if(e===p[0]){a(p);continue}if(i.external){let v=i.external.registry.get(p[0])?.id;if(e!==p[0]&&v){a(p);continue}}if(this.metadataRegistry.get(p[0])?.id){a(p);continue}if(d.cycle){a(p);continue}if(d.count>1&&i.reused==="ref"){a(p);continue}}let s=(p,d)=>{let f=this.seen.get(p),v=f.def??f.schema,m={...v};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){s(y,d);let x=this.seen.get(y).schema;x.$ref&&(d.target==="draft-7"||d.target==="draft-4"||d.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(x)):(Object.assign(v,x),Object.assign(v,m))}f.isParent||this.override({zodSchema:p,jsonSchema:v,path:f.path??[]})};for(let p of[...this.seen.entries()].reverse())s(p[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?l.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),i.external?.uri){let p=i.external.registry.get(e)?.id;if(!p)throw new Error("Schema is missing an `id` property");l.$id=i.external.uri(p)}Object.assign(l,n.def);let u=i.external?.defs??{};for(let p of this.seen.entries()){let d=p[1];d.def&&d.defId&&(u[d.defId]=d.def)}i.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?l.$defs=u:l.definitions=u);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}};function GA(r,e){if(r instanceof lc){let i=new gh(e),n={};for(let s of r._idmap.entries()){let[l,u]=s;i.process(u)}let o={},a={registry:r,uri:e?.uri,defs:n};for(let s of r._idmap.entries()){let[l,u]=s;o[l]=i.emit(u,{...e,external:a})}if(Object.keys(n).length>0){let s=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[s]:n}}return{schemas:o}}let t=new gh(e);return t.process(r),t.emit(r,e)}function hr(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let i=r._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return hr(i.element,t);if(i.type==="set")return hr(i.valueType,t);if(i.type==="lazy")return hr(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return hr(i.innerType,t);if(i.type==="intersection")return hr(i.left,t)||hr(i.right,t);if(i.type==="record"||i.type==="map")return hr(i.keyType,t)||hr(i.valueType,t);if(i.type==="pipe")return hr(i.in,t)||hr(i.out,t);if(i.type==="object"){for(let n in i.shape)if(hr(i.shape[n],t))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(hr(n,t))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(hr(n,t))return!0;return!!(i.rest&&hr(i.rest,t))}return!1}var GS={};var Zv={};Aa(Zv,{ZodISODate:()=>Lv,ZodISODateTime:()=>jv,ZodISODuration:()=>Wv,ZodISOTime:()=>Kv,date:()=>HA,datetime:()=>qA,duration:()=>QA,time:()=>JA});var jv=b("ZodISODateTime",(r,e)=>{n0.init(r,e),qe.init(r,e)});function qA(r){return sA(jv,r)}var Lv=b("ZodISODate",(r,e)=>{o0.init(r,e),qe.init(r,e)});function HA(r){return lA(Lv,r)}var Kv=b("ZodISOTime",(r,e)=>{a0.init(r,e),qe.init(r,e)});function JA(r){return uA(Kv,r)}var Wv=b("ZodISODuration",(r,e)=>{s0.init(r,e),qe.init(r,e)});function QA(r){return cA(Wv,r)}var HS=(r,e)=>{Kp.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>Zp(r,t)},flatten:{value:t=>Wp(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,ec,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,ec,2)}},isEmpty:{get(){return r.issues.length===0}}})},ik=b("ZodError",HS),Br=b("ZodError",HS,{Parent:Error});var YA=ic(Br),XA=nc(Br),e_=oc(Br),t_=ac(Br),r_=Yg(Br),i_=Xg(Br),n_=ev(Br),o_=tv(Br),a_=rv(Br),s_=iv(Br),l_=nv(Br),u_=ov(Br);var Ae=b("ZodType",(r,e)=>(he.init(r,e),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.check=(...t)=>r.clone(j.mergeDefs(e,{checks:[...e.checks??[],...t.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),r.clone=(t,i)=>dr(r,t,i),r.brand=()=>r,r.register=((t,i)=>(t.add(r,i),r)),r.parse=(t,i)=>YA(r,t,i,{callee:r.parse}),r.safeParse=(t,i)=>e_(r,t,i),r.parseAsync=async(t,i)=>XA(r,t,i,{callee:r.parseAsync}),r.safeParseAsync=async(t,i)=>t_(r,t,i),r.spa=r.safeParseAsync,r.encode=(t,i)=>r_(r,t,i),r.decode=(t,i)=>i_(r,t,i),r.encodeAsync=async(t,i)=>n_(r,t,i),r.decodeAsync=async(t,i)=>o_(r,t,i),r.safeEncode=(t,i)=>a_(r,t,i),r.safeDecode=(t,i)=>s_(r,t,i),r.safeEncodeAsync=async(t,i)=>l_(r,t,i),r.safeDecodeAsync=async(t,i)=>u_(r,t,i),r.refine=(t,i)=>r.check(TE(t,i)),r.superRefine=t=>r.check(RE(t)),r.overwrite=t=>r.check(Dn(t)),r.optional=()=>qv(r),r.nullable=()=>Hv(r),r.nullish=()=>qv(Hv(r)),r.nonoptional=t=>PE(r,t),r.array=()=>Xv(r),r.or=t=>M_([r,t]),r.and=t=>cE(r,t),r.transform=t=>Jv(r,C_(t)),r.default=t=>bE(r,t),r.prefault=t=>_E(r,t),r.catch=t=>BE(r,t),r.pipe=t=>Jv(r,t),r.readonly=()=>kE(r),r.describe=t=>{let i=r.clone();return pr.add(i,{description:t}),i},Object.defineProperty(r,"description",{get(){return pr.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return pr.get(r);let i=r.clone();return pr.add(i,t[0]),i},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),p_=b("_ZodString",(r,e)=>{Cs.init(r,e),Ae.init(r,e);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...i)=>r.check(nh(...i)),r.includes=(...i)=>r.check(sh(...i)),r.startsWith=(...i)=>r.check(lh(...i)),r.endsWith=(...i)=>r.check(uh(...i)),r.min=(...i)=>r.check(wa(...i)),r.max=(...i)=>r.check(cc(...i)),r.length=(...i)=>r.check(dc(...i)),r.nonempty=(...i)=>r.check(wa(1,...i)),r.lowercase=i=>r.check(oh(i)),r.uppercase=i=>r.check(ah(i)),r.trim=()=>r.check(ph()),r.normalize=(...i)=>r.check(dh(...i)),r.toLowerCase=()=>r.check(hh()),r.toUpperCase=()=>r.check(fh()),r.slugify=()=>r.check(mh())}),yh=b("ZodString",(r,e)=>{Cs.init(r,e),p_.init(r,e),r.email=t=>r.check(Av(h_,t)),r.url=t=>r.check(rh(Qv,t)),r.jwt=t=>r.check(Uv(F_,t)),r.emoji=t=>r.check(Bv(f_,t)),r.guid=t=>r.check(th(Gv,t)),r.uuid=t=>r.check(_v(ho,t)),r.uuidv4=t=>r.check(Pv(ho,t)),r.uuidv6=t=>r.check(Sv(ho,t)),r.uuidv7=t=>r.check(Ev(ho,t)),r.nanoid=t=>r.check(Fv(m_,t)),r.guid=t=>r.check(th(Gv,t)),r.cuid=t=>r.check(Nv(g_,t)),r.cuid2=t=>r.check(kv(v_,t)),r.ulid=t=>r.check($v(y_,t)),r.base64=t=>r.check(Ov(S_,t)),r.base64url=t=>r.check(Vv(E_,t)),r.xid=t=>r.check(Mv(x_,t)),r.ksuid=t=>r.check(Iv(w_,t)),r.ipv4=t=>r.check(Dv(b_,t)),r.ipv6=t=>r.check(Cv(A_,t)),r.cidrv4=t=>r.check(Tv(__,t)),r.cidrv6=t=>r.check(Rv(P_,t)),r.e164=t=>r.check(zv(B_,t)),r.datetime=t=>r.check(qA(t)),r.date=t=>r.check(HA(t)),r.time=t=>r.check(JA(t)),r.duration=t=>r.check(QA(t))});function c_(r){return iA(yh,r)}var qe=b("ZodStringFormat",(r,e)=>{We.init(r,e),p_.init(r,e)}),h_=b("ZodEmail",(r,e)=>{Hb.init(r,e),qe.init(r,e)});function ok(r){return Av(h_,r)}var Gv=b("ZodGUID",(r,e)=>{Gb.init(r,e),qe.init(r,e)});function ak(r){return th(Gv,r)}var ho=b("ZodUUID",(r,e)=>{qb.init(r,e),qe.init(r,e)});function sk(r){return _v(ho,r)}function lk(r){return Pv(ho,r)}function uk(r){return Sv(ho,r)}function ck(r){return Ev(ho,r)}var Qv=b("ZodURL",(r,e)=>{Jb.init(r,e),qe.init(r,e)});function dk(r){return rh(Qv,r)}function pk(r){return rh(Qv,{protocol:/^https?$/,hostname:Bi.domain,...j.normalizeParams(r)})}var f_=b("ZodEmoji",(r,e)=>{Qb.init(r,e),qe.init(r,e)});function hk(r){return Bv(f_,r)}var m_=b("ZodNanoID",(r,e)=>{Yb.init(r,e),qe.init(r,e)});function fk(r){return Fv(m_,r)}var g_=b("ZodCUID",(r,e)=>{Xb.init(r,e),qe.init(r,e)});function mk(r){return Nv(g_,r)}var v_=b("ZodCUID2",(r,e)=>{e0.init(r,e),qe.init(r,e)});function gk(r){return kv(v_,r)}var y_=b("ZodULID",(r,e)=>{t0.init(r,e),qe.init(r,e)});function vk(r){return $v(y_,r)}var x_=b("ZodXID",(r,e)=>{r0.init(r,e),qe.init(r,e)});function yk(r){return Mv(x_,r)}var w_=b("ZodKSUID",(r,e)=>{i0.init(r,e),qe.init(r,e)});function xk(r){return Iv(w_,r)}var b_=b("ZodIPv4",(r,e)=>{l0.init(r,e),qe.init(r,e)});function wk(r){return Dv(b_,r)}var JS=b("ZodMAC",(r,e)=>{c0.init(r,e),qe.init(r,e)});function bk(r){return oA(JS,r)}var A_=b("ZodIPv6",(r,e)=>{u0.init(r,e),qe.init(r,e)});function Ak(r){return Cv(A_,r)}var __=b("ZodCIDRv4",(r,e)=>{d0.init(r,e),qe.init(r,e)});function _k(r){return Tv(__,r)}var P_=b("ZodCIDRv6",(r,e)=>{p0.init(r,e),qe.init(r,e)});function Pk(r){return Rv(P_,r)}var S_=b("ZodBase64",(r,e)=>{f0.init(r,e),qe.init(r,e)});function Sk(r){return Ov(S_,r)}var E_=b("ZodBase64URL",(r,e)=>{m0.init(r,e),qe.init(r,e)});function Ek(r){return Vv(E_,r)}var B_=b("ZodE164",(r,e)=>{g0.init(r,e),qe.init(r,e)});function Bk(r){return zv(B_,r)}var F_=b("ZodJWT",(r,e)=>{v0.init(r,e),qe.init(r,e)});function Fk(r){return Uv(F_,r)}var xh=b("ZodCustomStringFormat",(r,e)=>{y0.init(r,e),qe.init(r,e)});function Nk(r,e,t={}){return pc(xh,r,e,t)}function kk(r){return pc(xh,"hostname",Bi.hostname,r)}function $k(r){return pc(xh,"hex",Bi.hex,r)}function Mk(r,e){let t=e?.enc??"hex",i=`${r}_${t}`,n=Bi[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return pc(xh,i,n,e)}var wh=b("ZodNumber",(r,e)=>{fv.init(r,e),Ae.init(r,e),r.gt=(i,n)=>r.check(co(i,n)),r.gte=(i,n)=>r.check(Er(i,n)),r.min=(i,n)=>r.check(Er(i,n)),r.lt=(i,n)=>r.check(uo(i,n)),r.lte=(i,n)=>r.check(Fi(i,n)),r.max=(i,n)=>r.check(Fi(i,n)),r.int=i=>r.check(d_(i)),r.safe=i=>r.check(d_(i)),r.positive=i=>r.check(co(0,i)),r.nonnegative=i=>r.check(Er(0,i)),r.negative=i=>r.check(uo(0,i)),r.nonpositive=i=>r.check(Fi(0,i)),r.multipleOf=(i,n)=>r.check(Ts(i,n)),r.step=(i,n)=>r.check(Ts(i,n)),r.finite=()=>r;let t=r._zod.bag;r.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),r.isFinite=!0,r.format=t.format??null});function QS(r){return dA(wh,r)}var fc=b("ZodNumberFormat",(r,e)=>{x0.init(r,e),wh.init(r,e)});function d_(r){return hA(fc,r)}function Ik(r){return fA(fc,r)}function Dk(r){return mA(fc,r)}function Ck(r){return gA(fc,r)}function Tk(r){return vA(fc,r)}var bh=b("ZodBoolean",(r,e)=>{Jp.init(r,e),Ae.init(r,e)});function YS(r){return yA(bh,r)}var Ah=b("ZodBigInt",(r,e)=>{mv.init(r,e),Ae.init(r,e),r.gte=(i,n)=>r.check(Er(i,n)),r.min=(i,n)=>r.check(Er(i,n)),r.gt=(i,n)=>r.check(co(i,n)),r.gte=(i,n)=>r.check(Er(i,n)),r.min=(i,n)=>r.check(Er(i,n)),r.lt=(i,n)=>r.check(uo(i,n)),r.lte=(i,n)=>r.check(Fi(i,n)),r.max=(i,n)=>r.check(Fi(i,n)),r.positive=i=>r.check(co(BigInt(0),i)),r.negative=i=>r.check(uo(BigInt(0),i)),r.nonpositive=i=>r.check(Fi(BigInt(0),i)),r.nonnegative=i=>r.check(Er(BigInt(0),i)),r.multipleOf=(i,n)=>r.check(Ts(i,n));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function Rk(r){return wA(Ah,r)}var N_=b("ZodBigIntFormat",(r,e)=>{w0.init(r,e),Ah.init(r,e)});function Ok(r){return AA(N_,r)}function Vk(r){return _A(N_,r)}var XS=b("ZodSymbol",(r,e)=>{b0.init(r,e),Ae.init(r,e)});function zk(r){return PA(XS,r)}var eE=b("ZodUndefined",(r,e)=>{A0.init(r,e),Ae.init(r,e)});function Uk(r){return SA(eE,r)}var tE=b("ZodNull",(r,e)=>{_0.init(r,e),Ae.init(r,e)});function rE(r){return EA(tE,r)}var iE=b("ZodAny",(r,e)=>{P0.init(r,e),Ae.init(r,e)});function jk(){return BA(iE)}var nE=b("ZodUnknown",(r,e)=>{S0.init(r,e),Ae.init(r,e)});function hc(){return FA(nE)}var oE=b("ZodNever",(r,e)=>{E0.init(r,e),Ae.init(r,e)});function k_(r){return NA(oE,r)}var aE=b("ZodVoid",(r,e)=>{B0.init(r,e),Ae.init(r,e)});function Lk(r){return kA(aE,r)}var Yv=b("ZodDate",(r,e)=>{F0.init(r,e),Ae.init(r,e),r.min=(i,n)=>r.check(Er(i,n)),r.max=(i,n)=>r.check(Fi(i,n));let t=r._zod.bag;r.minDate=t.minimum?new Date(t.minimum):null,r.maxDate=t.maximum?new Date(t.maximum):null});function Kk(r){return $A(Yv,r)}var sE=b("ZodArray",(r,e)=>{N0.init(r,e),Ae.init(r,e),r.element=e.element,r.min=(t,i)=>r.check(wa(t,i)),r.nonempty=t=>r.check(wa(1,t)),r.max=(t,i)=>r.check(cc(t,i)),r.length=(t,i)=>r.check(dc(t,i)),r.unwrap=()=>r.element});function Xv(r,e){return VA(sE,r,e)}function Wk(r){let e=r._zod.def.shape;return D_(Object.keys(e))}var ey=b("ZodObject",(r,e)=>{k0.init(r,e),Ae.init(r,e),j.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>D_(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:hc()}),r.loose=()=>r.clone({...r._zod.def,catchall:hc()}),r.strict=()=>r.clone({...r._zod.def,catchall:k_()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=t=>j.extend(r,t),r.safeExtend=t=>j.safeExtend(r,t),r.merge=t=>j.merge(r,t),r.pick=t=>j.pick(r,t),r.omit=t=>j.omit(r,t),r.partial=(...t)=>j.partial(T_,r,t[0]),r.required=(...t)=>j.required(R_,r,t[0])});function Zk(r,e){let t={type:"object",shape:r??{},...j.normalizeParams(e)};return new ey(t)}function Gk(r,e){return new ey({type:"object",shape:r,catchall:k_(),...j.normalizeParams(e)})}function qk(r,e){return new ey({type:"object",shape:r,catchall:hc(),...j.normalizeParams(e)})}var $_=b("ZodUnion",(r,e)=>{gv.init(r,e),Ae.init(r,e),r.options=e.options});function M_(r,e){return new $_({type:"union",options:r,...j.normalizeParams(e)})}var lE=b("ZodDiscriminatedUnion",(r,e)=>{$_.init(r,e),$0.init(r,e)});function Hk(r,e,t){return new lE({type:"union",options:e,discriminator:r,...j.normalizeParams(t)})}var uE=b("ZodIntersection",(r,e)=>{M0.init(r,e),Ae.init(r,e)});function cE(r,e){return new uE({type:"intersection",left:r,right:e})}var dE=b("ZodTuple",(r,e)=>{vv.init(r,e),Ae.init(r,e),r.rest=t=>r.clone({...r._zod.def,rest:t})});function pE(r,e,t){let i=e instanceof he,n=i?t:e,o=i?e:null;return new dE({type:"tuple",items:r,rest:o,...j.normalizeParams(n)})}var I_=b("ZodRecord",(r,e)=>{I0.init(r,e),Ae.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function hE(r,e,t){return new I_({type:"record",keyType:r,valueType:e,...j.normalizeParams(t)})}function Jk(r,e,t){let i=dr(r);return i._zod.values=void 0,new I_({type:"record",keyType:i,valueType:e,...j.normalizeParams(t)})}var fE=b("ZodMap",(r,e)=>{D0.init(r,e),Ae.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function Qk(r,e,t){return new fE({type:"map",keyType:r,valueType:e,...j.normalizeParams(t)})}var mE=b("ZodSet",(r,e)=>{C0.init(r,e),Ae.init(r,e),r.min=(...t)=>r.check(Rs(...t)),r.nonempty=t=>r.check(Rs(1,t)),r.max=(...t)=>r.check(uc(...t)),r.size=(...t)=>r.check(ih(...t))});function Yk(r,e){return new mE({type:"set",valueType:r,...j.normalizeParams(e)})}var vh=b("ZodEnum",(r,e)=>{T0.init(r,e),Ae.init(r,e),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(i,n)=>{let o={};for(let a of i)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new vh({...e,checks:[],...j.normalizeParams(n),entries:o})},r.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new vh({...e,checks:[],...j.normalizeParams(n),entries:o})}});function D_(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(i=>[i,i])):r;return new vh({type:"enum",entries:t,...j.normalizeParams(e)})}function Xk(r,e){return new vh({type:"enum",entries:r,...j.normalizeParams(e)})}var gE=b("ZodLiteral",(r,e)=>{R0.init(r,e),Ae.init(r,e),r.values=new Set(e.values),Object.defineProperty(r,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function e$(r,e){return new gE({type:"literal",values:Array.isArray(r)?r:[r],...j.normalizeParams(e)})}var vE=b("ZodFile",(r,e)=>{O0.init(r,e),Ae.init(r,e),r.min=(t,i)=>r.check(Rs(t,i)),r.max=(t,i)=>r.check(uc(t,i)),r.mime=(t,i)=>r.check(ch(Array.isArray(t)?t:[t],i))});function t$(r){return zA(vE,r)}var yE=b("ZodTransform",(r,e)=>{V0.init(r,e),Ae.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new fa(r.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(j.issue(o,t.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=t.value),a.inst??(a.inst=r),t.issues.push(j.issue(a))}};let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>(t.value=o,t)):(t.value=n,t)}});function C_(r){return new yE({type:"transform",transform:r})}var T_=b("ZodOptional",(r,e)=>{z0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function qv(r){return new T_({type:"optional",innerType:r})}var xE=b("ZodNullable",(r,e)=>{U0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Hv(r){return new xE({type:"nullable",innerType:r})}function r$(r){return qv(Hv(r))}var wE=b("ZodDefault",(r,e)=>{j0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function bE(r,e){return new wE({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var AE=b("ZodPrefault",(r,e)=>{L0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function _E(r,e){return new AE({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var R_=b("ZodNonOptional",(r,e)=>{K0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function PE(r,e){return new R_({type:"nonoptional",innerType:r,...j.normalizeParams(e)})}var SE=b("ZodSuccess",(r,e)=>{W0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function i$(r){return new SE({type:"success",innerType:r})}var EE=b("ZodCatch",(r,e)=>{Z0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function BE(r,e){return new EE({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var FE=b("ZodNaN",(r,e)=>{G0.init(r,e),Ae.init(r,e)});function n$(r){return IA(FE,r)}var O_=b("ZodPipe",(r,e)=>{q0.init(r,e),Ae.init(r,e),r.in=e.in,r.out=e.out});function Jv(r,e){return new O_({type:"pipe",in:r,out:e})}var V_=b("ZodCodec",(r,e)=>{O_.init(r,e),Qp.init(r,e)});function o$(r,e,t){return new V_({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var NE=b("ZodReadonly",(r,e)=>{H0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function kE(r){return new NE({type:"readonly",innerType:r})}var $E=b("ZodTemplateLiteral",(r,e)=>{J0.init(r,e),Ae.init(r,e)});function a$(r,e){return new $E({type:"template_literal",parts:r,...j.normalizeParams(e)})}var ME=b("ZodLazy",(r,e)=>{X0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.getter()});function IE(r){return new ME({type:"lazy",getter:r})}var DE=b("ZodPromise",(r,e)=>{Y0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function s$(r){return new DE({type:"promise",innerType:r})}var CE=b("ZodFunction",(r,e)=>{Q0.init(r,e),Ae.init(r,e)});function l$(r){return new CE({type:"function",input:Array.isArray(r?.input)?pE(r?.input):r?.input??Xv(hc()),output:r?.output??hc()})}var ty=b("ZodCustom",(r,e)=>{eA.init(r,e),Ae.init(r,e)});function u$(r){let e=new Ge({check:"custom"});return e._zod.check=r,e}function c$(r,e){return UA(ty,r??(()=>!0),e)}function TE(r,e={}){return jA(ty,r,e)}function RE(r){return LA(r)}var d$=KA,p$=WA;function h$(r,e={error:`Input not instance of ${r.name}`}){let t=new ty({type:"custom",check:"custom",fn:i=>i instanceof r,abort:!0,...j.normalizeParams(e)});return t._zod.bag.Class=r,t}var f$=(...r)=>ZA({Codec:V_,Boolean:bh,String:yh},...r);function m$(r){let e=IE(()=>M_([c_(r),QS(),YS(),rE(),Xv(e),hE(c_(),e)]));return e}function g$(r,e){return Jv(C_(r),e)}var v$={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 y$(r){yt({customError:r})}function x$(){return yt().customError}var z_;z_||(z_={});var U_={};Aa(U_,{bigint:()=>_$,boolean:()=>A$,date:()=>P$,number:()=>b$,string:()=>w$});function w$(r){return nA(yh,r)}function b$(r){return pA(wh,r)}function A$(r){return xA(bh,r)}function _$(r){return bA(Ah,r)}function P$(r){return MA(Yv,r)}yt(yv());var OE=St.object({name:St.string(),bpm:St.number(),duration:St.number(),sample_rate:St.number(),origin:St.enum(["openDAW","recording","import"])});var j7=OE.extend({uuid:A.zType(St)});var S$,E$,B$,F$,N$,k$;S$=new WeakMap,E$=new WeakMap,B$=new WeakMap,F$=new WeakMap,N$=new WeakMap,k$=new WeakMap;var mc=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},$$,M$,j_,L_,K_,I$,D$;M$=new WeakMap,j_=new WeakMap,L_=new WeakMap,K_=new WeakMap,I$=new WeakMap,$$=new WeakSet,D$=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let i=Be(t.box,ln);I(i.isAttached(),"SelectionBox is not attached");let n=i.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${i.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),o={box:i,selectable:n};mc(this,K_,"f").proxy.onSelected(n),I(mc(this,j_,"f").add(o),"Could not add to entityMap"),I(mc(this,L_,"f").add(o),"Could not add to selectableMap")},onRemoved:t=>{let i=Be(t.box,ln),n=mc(this,j_,"f").removeByKey(i.address.uuid);I(n.box===i,"Broken selection");let o=n.selectable;mc(this,K_,"f").proxy.onDeselected(o),mc(this,L_,"f").removeByKey(o.address)}},c.Selection)};var VE=St.object({name:St.string(),size:St.number().int(),url:St.string(),license:St.string(),origin:St.enum(["openDAW","import"])});var iJ=VE.extend({uuid:A.zType(St)});var zE;(function(r){r.cut=(e,t,i)=>{if(!(e.position>=t||t>=e.complete))if(Tw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;e.duration=t-n,e.copyTo({position:t,duration:o-t,loopOffset:Bc(a+(t-n),s),consolidate:i})}else return N("Not yet implemented")},r.clip=(e,t,i)=>{if(Tw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;if(o-i<=0)return N(`duration will zero or negative(${o-i})`);e.duration=t-n,e.copyTo({position:i,duration:o-i,loopOffset:Bc(a+(i-n),s)})}else return N("Not yet implemented")}})(zE||(zE={}));var gc;(e=>e.create=(t,i,n,o)=>0|(t?1:0)|(i?2:0)|(n?4:0)|(o?8:0))(gc||={});var _e=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#n;#o=0;#a=0;#l=0;#s=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=O.create(()=>new rl(r.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,()=>{this.#r[0]=this.#o,this.#r[1]=this.#a,this.#r[2]=this.#l,this.#r[3]=this.#s})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#o=0,this.#a=0}process(e,t,i=0,n=128){let o=n-i,a=r.PEAK_DECAY**o,s=0,l=0;for(let u=i;u<n;u++){let p=Math.abs(e[u]),d=Math.abs(t[u]);p>s&&(s=p),d>l&&(l=d)}this.#o=Math.max(s,this.#o*a),this.#a=Math.max(l,this.#a*a),this.#l=this.#i[0].processBlock(e,i,n),this.#s=this.#i[1].processBlock(t,i,n)}processStereo([e,t],i=0,n=128){this.process(e,t,i,n)}terminate(){this.#n.terminate()}};var ry=class{#e=new z;#t;#r;#i;#n=g.None;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=new te,this.#o=this.#r.getValue(),this.#e.own(this.#r.subscribe(i=>{this.#o=i.getValue(),this.#i.notify(this)}))}get adapter(){return this.#r}get address(){return this.#r.address}subscribe(e){return this.#i.subscribe(e)}getValue(){return this.#o}getUnitValue(){return this.#r.valueMapping.x(this.#o)}onStartAutomation(){I(this.#n.isEmpty(),"Already broadcasting"),this.#n=g.wrap(this.#t.broadcaster.broadcastFloat(this.#r.address,()=>this.getUnitValue()))}updateAutomation(e){let t=this.#r.valueAt(e);return this.#o!==t?(this.#o=t,!0):!1}onStopAutomation(){I(this.#n.nonEmpty(),"Never started broadcasting"),this.#n.unwrap().terminate(),this.#n=g.None,this.#o=this.#r.getValue()}own(e){return this.#e.own(e)}ownAll(...e){this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#e.terminate()}};var vc=class{#e;constructor(){this.#e=new Uh}add(e,t){this.#e.add(e,t)}get(e){return this.#e.get(e)}forEach(e){return this.#e.forEach(e)}clear(){this.#e.clear()}};var Yt=class{#e=new z;#t;#r;#i;#n;#o=g.None;constructor(e){this.#t=e,this.#r=new vc,this.#i=[],this.#n=[]}parameterChanged(e,t){return N(`Got update event for ${e}, but has no parameter change method`)}get context(){return this.#t}get eventInput(){return this.#r}bindParameter(e){let t=new ry(this.#t,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:i=>{this.#o.isEmpty()&&(this.#o=g.wrap(this.#t.updateClock.addEventOutput(this.#r))),this.#n.push(t),t.onStartAutomation()},onRemoved:i=>{O.remove(this.#n,t),this.#n.length===0&&(this.#o.ifSome(n=>n.terminate()),this.#o=g.None),t.onStopAutomation()}},c.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameters(e,t){this.#n.forEach(i=>{i.updateAutomation(e)&&this.parameterChanged(i,t)})}readAllParameters(){this.#i.forEach(e=>this.parameterChanged(e,0))}own(e){return this.#e.own(e)}ownAll(...e){return this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#o.ifSome(e=>e.terminate()),this.#o=g.None,this.#i.length=0,this.#e.terminate()}toString(){return`{${this.constructor.name}}`}};var _h;(e=>e.isOfType=t=>t.type==="update-event")(_h||={});var iy=class extends Yt{#e=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#e.push(e),{terminate:()=>O.remove(this.#e,e)}}process({blocks:e}){e.forEach(({p0:t,p1:i,flags:n},o)=>{if(nt.every(n,1))for(let a of rn.iterate(t,i,tf)){let s={type:"update-event",position:a};this.#e.forEach(l=>l.add(o,s))}})}toString(){return`{${this.constructor.name}}`}};var Me=class extends Yt{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,s0:o,s1:a,bpm:s}=t,l=null,u=o;for(let p of this.eventInput.get(i)){let d=p.position-n,f=Math.abs(d)<1e-7?o:o+Math.floor(Y.pulsesToSamples(d,s,sampleRate));I(o<=f&&f<=a,()=>`${f} out of bounds. event: ${p.position} (${p.type}), p0: ${n}`),l?.forEach(v=>this.handleEvent(v)),l=null,u<f&&(this.processAudio(t,u,f),u=f),_h.isOfType(p)?this.updateParameters(p.position,o/sampleRate+Y.pulsesToSeconds(p.position-n,s)):(l??=[]).push(p)}l?.forEach(p=>this.handleEvent(p)),l=null,u<a&&this.processAudio(t,u,a)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return N(`${this} received an event but has no accepting method.`)}finishProcess(){}};var ny=class r{static#e=S.exponential(20/sampleRate,2e4/sampleRate);#t;#r;#i;#n;#o;feedback=.7;cross=0;wet=.75;dry=.75;#a=0;#l=0;#s=0;#u=0;#c=0;#d=!1;#p=!1;constructor(e,t){let i=fo(e);this.#t=i,this.#r=[new Float32Array(i),new Float32Array(i)],this.#i=[new wt,new wt],this.#n=new tn,this.#o=t}reset(){this.#l=0,this.#d&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#d=!1,this.#p=!1),this.#m()}set offset(e){I(0<=e&&e<this.#t,"Out of bounds"),this.#u!==e&&(this.#u=e,this.#d?this.#w():this.#m())}get offset(){return this.#u}set filter(e){e===0?this.#n.identity():e>0?this.#n.setHighpassParams(r.#e.y(e)):e<0&&this.#n.setLowpassParams(r.#e.y(1+e))}process(e,t,i,n){this.#p?this.#f(e,t,i,n):this.#h(e,t,i,n),this.#d=!0}#h(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,l=this.wet,u=this.dry,p=this.#l,d=p-Math.floor(this.#s);d<0&&(d+=this.#t);let f=e[0],v=e[1],m=t[0],y=t[1],x=this.#i[0],F=this.#i[1],D=a[0],R=a[1];for(let T=i;T<n;++T){let W=f[T],ne=v[T],se=x.processFrame(this.#n,D[d]*.96),J=F.processFrame(this.#n,R[d]*.96),fe=this.cross*(J-se),Q=se+fe,Re=J-fe;D[p]=(W+Q)*s+1e-18-1e-18,R[p]=(ne+Re)*s+1e-18-1e-18,m[T]=Q*l+W*u,y[T]=Re*l+ne*u,d=++d&o,p=++p&o}this.#l=p}#f(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,l=this.wet,u=this.dry,p=this.#l;for(let d=i;d<n;++d){0<this.#c?(this.#s+=this.#a,this.#c--):(this.#s=this.#u,this.#p=!1);let f=p-this.#s;f<0&&(f+=this.#t);let v=f|0,m=f-v,y=e[0][d],x=e[1][d],F=a[0][v],D=a[0][v],R=this.#i[0].processFrame(this.#n,F+m*(a[0][v+1&o]-F)),T=this.#i[1].processFrame(this.#n,D+m*(a[1][v+1&o]-D));a[0][p]=y+R*s+1e-18-1e-18,a[1][p]=x+R*s+1e-18-1e-18,t[0][d]=R*l+y*u,t[1][d]=T*l+x*u,p=++p&o}this.#l=p}#m(){this.#s=this.#u,this.#c=0,this.#p=!1}#w(){this.#u!==this.#s&&(this.#c=this.#o,this.#a=(this.#u-this.#s)/this.#c,this.#p=!0)}};var oy=class r extends Me{static ID=0;#e=r.ID++;#t;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#n;#o=g.None;#a=!0;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new _e(e.broadcaster,t.address));let{delay:i,feedback:n,cross:o,filter:a,dry:s,wet:l}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(i)),this.parameterFeedback=this.own(this.bindParameter(n)),this.parameterCross=this.own(this.bindParameter(o)),this.parameterFilter=this.own(this.bindParameter(a)),this.parameterDry=this.own(this.bindParameter(s)),this.parameterWet=this.own(this.bindParameter(l));let u=Y.pulsesToSamples(er.toPPQN(li.OffsetFractions[0]),30,sampleRate),p=Math.floor(.5*sampleRate);this.#n=new ny(u,p),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#n.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio({bpm:e,flags:t},i,n){if(this.#o.isEmpty())return;if(this.#a||nt.some(t,8)){let a=this.parameterDelay.getValue(),s=er.toPPQN(li.OffsetFractions[a]);this.#n.offset=Y.pulsesToSamples(s,e,sampleRate),this.#a=!1}let o=this.#o.unwrap();this.#n.process(o.channels(),this.#r.channels(),i,n),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),i,n)}parameterChanged(e){e===this.parameterDelay?this.#a=!0:e===this.parameterFeedback?this.#n.feedback=this.parameterFeedback.getValue():e===this.parameterCross?this.#n.cross=this.parameterCross.getValue():e===this.parameterFilter?this.#n.filter=this.parameterFilter.getValue():e===this.parameterDry?this.#n.dry=Oe(this.parameterDry.getValue()):e===this.parameterWet&&(this.#n.wet=Oe(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Ph=class r extends Yt{static ID=0;#e=r.ID++;#t;#r;#i;#n=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new _e(e.broadcaster,t.address)),this.own(e.registerProcessor(this))}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=g.wrap(e),{terminate:()=>this.#n=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}process(e){if(this.#n.isEmpty())return;let t=this.#n.unwrap(),[i,n]=t.channels(),[o,a]=this.#r.channels();for(let s=0;s<128;s++)o[s]=i[s],a[s]=n[s];this.#i.process(o,a)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var yc=class r extends Yt{static ID=0;#e=r.ID++;#t;#r;#i;#n;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return g.None}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#t.uuid}reset(){this.#i.clear(),this.#r.clear()}addAudioSource(e){return this.#n.push(e),{terminate:()=>{O.remove(this.#n,e),this.#r.clear()}}}get adapter(){return this.#t}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,i]=this.#r.channels();for(let n of this.#n){let[o,a]=n.channels();for(let s=0;s<128;s++)t[s]+=o[s],i[s]+=a[s]}this.#r.assertSanity(),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1))}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})}`}};var ye;(s=>{s.Comparator=(l,u)=>{let p=l.position-u.position;return p!==0?p:l.type==="note-complete-event"?-1:u.type==="note-complete-event"?1:0},s.start=(l,u,p,d,f=0)=>({type:"note-event",position:l,duration:u,pitch:p,velocity:d,cent:f,id:++a}),s.startWith=(l,u,p)=>({type:"note-event",position:u??l.position,duration:p??l.duration,pitch:l.pitch,cent:l.cent,velocity:l.velocity,id:++a}),s.stop=({id:l,pitch:u},p)=>({type:"note-complete-event",position:p,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 Cn=class{#e=new z;#t;#r;#i;#n=g.None;constructor(e,t,i){this.#t=e,this.#r=this.#e.own(new Si(t,i)),this.#i=new Array(16)}setNoteEventSource(e){return I(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=g.wrap(e),this.#t.reset(),L.create(()=>{this.#n=g.None,this.#t.reset()})}introduceBlock({index:e,p0:t,p1:i,flags:n}){if(!this.#n.isEmpty()){for(let o of this.#n.unwrap().processNotes(t,i,n))this.#i.push(o);this.#i.sort(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 W_;(e=>e.NotSet={start:()=>N("VoicingStrategy.start"),stop:()=>N("VoicingStrategy.stop"),forceStop:()=>Ni,process:()=>N("VoicingStrategy.process"),reset:Ni,processing:()=>O.empty()})(W_||={});var ay=class{#e;#t=[];constructor(e=W_.NotSet){this.#e=e}set strategy(e){this.#t.push(this.#e),this.#e.forceStop(),this.#e=e}get strategy(){return this.#e}start(e){this.#e.start(e)}stop(e){this.#e.stop(e)}process(e,t,i,n){this.#e.process(e,t,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1)}reset(){this.#t.forEach(e=>e.reset()),this.#t.length=0,this.#e.reset()}};var sy=class{#e;#t=[];#r=[];constructor(e){this.#e=e}start(e){let t=NaN;for(let o=0;o<this.#r.length;o++){let a=this.#r[o];if(!a.gate){t=a.currentFrequency,this.#r.splice(o,1);break}}let i=this.#e.computeFrequency(e),n=this.#e.create();isNaN(t)?n.start(e,i,1,0):(n.start(e,t,1,0),n.startGlide(i,this.#e.glideTime)),this.#r.push(n),this.#t.push(n)}stop(e){this.#t.find(t=>t.id===e)?.stop()}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#t.length=0,this.#r.length=0}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(O.removeIf(this.#r,s=>s===a),this.#t.splice(o,1))}return this.#t.length===0}processing(){return this.#t}};var ly=class{#e;#t=[];#r=[];#i=null;#n=null;constructor(e){this.#e=e}start(e){if(this.#r.push(e),Z(this.#i)&&this.#i.gate){this.#i.startGlide(this.#e.computeFrequency(e),this.#e.glideTime);return}Z(this.#n)&&this.#n.forceStop();let t=this.#e.create();t.start(e,this.#e.computeFrequency(e),1,0),this.#i=t,this.#n=t,this.#t.push(t)}stop(e){let t=this.#r.findIndex(i=>i.id===e);if(t!==-1&&(this.#r.splice(t,1),!!Z(this.#i))){if(t===this.#r.length){let i=this.#r.at(-1);if(Z(i)){this.#i.startGlide(this.#e.computeFrequency(i),this.#e.glideTime);return}}this.#r.length===0&&(this.#i.stop(),this.#i=null)}}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#r.length=0,this.#t.length=0,this.#i=null,this.#n=null}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(this.#t.splice(o,1),a===this.#i&&(this.#i=null),a===this.#n&&(this.#n=null))}return this.#t.length===0}processing(){return this.#t}};var Sh=class{#e;#t=[];#r=new tl;#i;gate=!0;id=-1;constructor(e,t){this.#e=e,this.#i=t}get currentFrequency(){return this.#r.currentFrequency()}start(e,t,i,n){if(this.id=e.id,this.#r.init(t),this.#i===1){let o=this.#e();o.start(e,t,i,n),this.#t.push(o)}else for(let o=0;o<this.#i;++o){let a=o/(this.#i-1)*2-1,s=this.#e(),l=(1-Math.abs(n))*a+n;s.start(e,t,i/Math.sqrt(this.#i),l),this.#t.push(s)}}startGlide(e,t){this.#r.glideTo(e,t),this.#t.forEach(i=>i.startGlide(e,t))}process(e,t,i,n){this.#r.advance(t.bpm,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1);return this.#t.length===0}stop(){this.#t.forEach(e=>e.stop()),this.gate=!1}forceStop(){this.#t.forEach(e=>e.forceStop()),this.gate=!1}processing(){return this.#t}};var[UE,jE,Z_,LE,KE,uy,WE,ZE,cy]=lP(Float32Array,128),Eh=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=Pa("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new Cc(sampleRate),this.oscB=new Cc(sampleRate),this.lfo=new Hh(sampleRate),this.filter=new jh(Fn.MIN_CUTOFF,Fn.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new Ys(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 tl,this.gainASmooth=new $i(.003,sampleRate),this.gainBSmooth=new $i(.003,sampleRate),this.gainVcaSmooth=new $i(.003,sampleRate)}start(e,t,i,n){this.#e=e,this.#t=i,this.#r=n,this.filter_keyboard_delta=Jh.keyboardTracking(e.pitch,this.device.parameterFilterKeyboard.getValue()),this.glide.init(t)}stop(){this.env.gateOff()}forceStop(){this.env.forceStop()}startGlide(e,t){this.glide.glideTo(e,t)}get gate(){return this.env.gate}get currentFrequency(){return this.glide.currentFrequency()}process(e,{bpm:t},i,n){let{gainOscA:o,gainOscB:a,oscA_waveform:s,oscB_waveform:l,flt_cutoff:u,flt_resonance:p,flt_env_amount:d,flt_order:f,frequencyAMultiplier:v,frequencyBMultiplier:m,parameterLfoShape:y,parameterLfoRate:x,parameterLfoTargetTune:F,parameterLfoTargetCutoff:D,parameterLfoTargetVolume:R,parameterUnisonDetune:T,parameterUnisonStereo:W}=this.device,ne=Xs(this.#e.velocity)*this.#t,se=2**(this.#r*(T.getValue()/1200)),J=this.#r*W.getValue(),[fe,Q]=Un.panningToGains(J,nn.Linear),[Re,Ie]=e.channels();Z_.fill(se,i,n),this.glide.process(Z_,t,i,n),this.lfo.fill(WE,y.getValue(),x.getValue(),i,n),this.env.process(uy,i,n);let ze=F.getValue(),Nr=D.getValue(),kr=R.getValue();for(let Ne=i;Ne<n;Ne++){let Ct=WE[Ne];ZE[Ne]=u+this.filter_keyboard_delta+uy[Ne]*d+Ct*Nr,uy[Ne]*=Hr(ne+Ct*kr);let $r=Z_[Ne]*2**(Ct*ze);LE[Ne]=$r*v,KE[Ne]=$r*m}this.oscA.generateFromFrequencies(UE,LE,s,i,n),this.oscB.generateFromFrequencies(jE,KE,l,i,n);for(let Ne=i;Ne<n;Ne++)cy[Ne]=UE[Ne]*this.gainASmooth.process(o)+jE[Ne]*this.gainBSmooth.process(a);this.filter.order=f,this.filter.process(cy,cy,ZE,p,i,n);for(let Ne=i;Ne<n;Ne++){let Ct=this.gainVcaSmooth.process(Hr(uy[Ne])),$r=cy[Ne]*Ct;if(Re[Ne]+=$r*fe,Ie[Ne]+=$r*Q,this.env.complete&&Ct<1e-4)return!0}return!1}};var dy=class extends Me{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#w;#b;#A;#N;#B;#P;#k;#g;#v;#y;#E;#F;#S;#_;#$;#M;#D;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;#C=0;constructor(e,t){super(e),this.#e=t,this.#t=new ay,this.#r=new Cn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ve,this.#n=new Xh(sampleRate),this.#o=this.own(new _e(e.broadcaster,t.address));let{namedParameter:i}=this.#e,{oscillators:n}=i;this.#a=this.own(this.bindParameter(n[0].waveform)),this.#l=this.own(this.bindParameter(n[0].octave)),this.#s=this.own(this.bindParameter(n[0].tune)),this.#u=this.own(this.bindParameter(n[0].volume)),this.#c=this.own(this.bindParameter(n[1].waveform)),this.#d=this.own(this.bindParameter(n[1].octave)),this.#p=this.own(this.bindParameter(n[1].tune)),this.#h=this.own(this.bindParameter(n[1].volume)),this.#f=this.own(this.bindParameter(i.attack)),this.#m=this.own(this.bindParameter(i.decay)),this.#w=this.own(this.bindParameter(i.sustain)),this.#b=this.own(this.bindParameter(i.release)),this.#A=this.own(this.bindParameter(i.cutoff)),this.#N=this.own(this.bindParameter(i.resonance)),this.#B=this.own(this.bindParameter(i.filterEnvelope)),this.#P=this.own(this.bindParameter(i.filterOrder)),this.#k=this.own(this.bindParameter(i.filterKeyboard)),this.#g=this.own(this.bindParameter(i.glideTime)),this.#v=this.own(this.bindParameter(i.voicingMode)),this.#y=this.own(this.bindParameter(i.unisonCount)),this.#E=this.own(this.bindParameter(i.unisonDetune)),this.#F=this.own(this.bindParameter(i.unisonStereo)),this.#S=this.own(this.bindParameter(i.lfoWaveform)),this.#_=this.own(this.bindParameter(i.lfoRate)),this.#$=this.own(this.bindParameter(i.lfoTargetTune)),this.#M=this.own(this.bindParameter(i.lfoTargetCutoff)),this.#D=this.own(this.bindParameter(i.lfoTargetVolume));let o=new Float32Array(32);this.ownAll(e.broadcaster.broadcastFloats(t.address.append(0),o,()=>{let a=0;this.#t.strategy.processing().forEach(s=>{let u=Be(s,Sh).processing().at(0);u instanceof Eh&&(o[a++]=u.env.phase),o.length-1}),o[a]=-1}),e.registerProcessor(this)),this.readAllParameters()}computeFrequency(e){return Mc(e.pitch+e.cent/100,440)}get glideTime(){return this.#C}get parameterFilterKeyboard(){return this.#k}get parameterLfoShape(){return this.#S}get parameterLfoRate(){return this.#_}get parameterLfoTargetTune(){return this.#$}get parameterLfoTargetCutoff(){return this.#M}get parameterLfoTargetVolume(){return this.#D}get parameterUnisonDetune(){return this.#E}get parameterUnisonStereo(){return this.#F}create(){return new Sh(()=>new Eh(this),this.#y.getValue())}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#o.clear(),this.#t.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}handleEvent(e){ye.isStart(e)?this.#t.start(e):ye.isStop(e)&&this.#t.stop(e.id)}processAudio(e,t,i){this.#t.process(this.#i,e,t,i),this.#n.replace(this.#i,t,i)}parameterChanged(e){if(e===this.#u)this.gainOscA=Oe(this.#u.getValue());else if(e===this.#h)this.gainOscB=Oe(this.#h.getValue());else if(e===this.#l||e===this.#s)this.frequencyAMultiplier=2**(this.#l.getValue()+this.#s.getValue()/1200);else if(e===this.#d||e===this.#p)this.frequencyBMultiplier=2**(this.#d.getValue()+this.#p.getValue()/1200);else if(e===this.#f)this.env_attack=this.#f.getValue();else if(e===this.#m)this.env_decay=this.#m.getValue();else if(e===this.#w)this.env_sustain=this.#w.getValue();else if(e===this.#b)this.env_release=this.#b.getValue();else if(e===this.#a)this.oscA_waveform=qr(this.#a.getValue(),Ke);else if(e===this.#c)this.oscB_waveform=qr(this.#c.getValue(),Ke);else if(e===this.#A)this.flt_cutoff=this.#A.getUnitValue();else if(e===this.#N)this.flt_resonance=this.#N.getValue();else if(e===this.#B)this.flt_env_amount=this.#B.getValue();else if(e===this.#P)this.flt_order=this.#P.getValue();else if(e===this.#g)this.#C=this.#g.getValue()*Y.Bar;else if(e===this.#v){let t=this.#v.getValue();switch(t){case sn.Monophonic:{this.#t.strategy=new ly(this);return}case sn.Polyphonic:{this.#t.strategy=new sy(this);return}default:return N(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var py=class{#e;#t;#r;#i;#n=1;#o;#a=0;#l;#s=0;constructor(e,t,i,n,o=0,a=0){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#o=i.start+o,this.#l=a,this.#o>=i.end&&(this.#n=4)}done(){return this.#n===4}startFadeOut(e){if(!(this.#n===4||this.#n===3)){if(this.#n===1){let t=this.#a/this.#i;this.#a=this.#i*(1-t)}else this.#a=0;this.#n=3,this.#s=e}}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#i,d=this.#r.end-u,f=this.#l,v=this.#s,m=this.#n,y=this.#o,x=this.#a;for(let F=0;F<t&&m!==4;F++){if(F<f)continue;let D=e+F,R;if(m===1)R=x/u,++x>=u&&(m=2,x=0);else if(m===3){if(F<v)R=1;else if(R=1-x/u,++x>=u){m=4;break}}else R=1;let T=y|0;if(T>=0&&T<a-1){let W=y-T,ne=s[T],se=l[T];i[D]+=(ne+W*(s[T+1]-ne))*R,n[D]+=(se+W*(l[T+1]-se))*R}y+=1,m===2&&y>=d&&(m=3,x=0)}this.#n=m,this.#o=y,this.#a=x,this.#l=0,this.#s=0}};var hy=class{#e;#t;#r;#i;#n;#o;#a=1;#l;#s=0;#u=0;#c=0;#d;#p=0;constructor(e,t,i,n,o=0,a=0){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#n=i.start+256,this.#o=i.end-256,this.#l=i.start+o,this.#d=a,this.#l>=i.end&&(this.#a=4)}done(){return this.#a===4}startFadeOut(e){if(!(this.#a===4||this.#a===3)){if(this.#a===1){let t=this.#s/this.#i;this.#s=this.#i*(1-t)}else this.#s=0;this.#a=3,this.#p=e}}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#i,p=this.#n,f=this.#o-u,v=this.#d,m=this.#p,y=this.#a,x=this.#l,F=this.#s,D=this.#u,R=this.#c;for(let T=0;T<t&&y!==4;T++){if(T<v)continue;let W=e+T,ne;if(y===1)ne=F/u,++F>=u&&(y=2,F=0);else if(y===3){if(T<m)ne=1;else if(ne=1-F/u,++F>=u){y=4;break}}else ne=1;let se=x|0,J=0,fe=0;if(se>=0&&se<a-1){let Q=x-se,Re=s[se],Ie=l[se];J=Re+Q*(s[se+1]-Re),fe=Ie+Q*(l[se+1]-Ie)}if(x>=f){D===0&&(R=p);let Q=R|0;if(Q>=0&&Q<a-1){let Re=R-Q,Ie=s[Q],ze=l[Q],Nr=Ie+Re*(s[Q+1]-Ie),kr=ze+Re*(l[Q+1]-ze),Ne=D/u;J=J*(1-Ne)+Nr*Ne,fe=fe*(1-Ne)+kr*Ne}D+=1,R+=1,D>=u&&(x=R,D=0)}i[W]+=J*ne,n[W]+=fe*ne,x+=1}this.#a=y,this.#l=x,this.#s=F,this.#u=D,this.#c=R,this.#d=0,this.#p=0}};var fy=256,my=class{#e;#t;#r;#i;#n;#o=0;#a;#l=0;#s=1;#u=1;#c=0;#d=0;#p;#h=0;constructor(e,t,i,n,o=0,a=0){this.#e=e,this.#t=t,this.#r=n,this.#i=i.start+256,this.#n=i.end-256,this.#a=i.start+o,this.#p=a,this.#a>=i.end&&(this.#o=4)}done(){return this.#o===4}startFadeOut(e){this.#o!==4&&(this.#s<0||(this.#o===2&&(this.#o=0,this.#l=this.#r),this.#s=-1,this.#h=e))}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#r,p=this.#i,d=this.#n,f=d-fy,v=p+fy,m=this.#p,y=this.#h,x=this.#o,F=this.#a,D=this.#l,R=this.#s,T=this.#u,W=this.#c,ne=this.#d;for(let se=0;se<t&&x!==4;se++){if(se<m)continue;let J=e+se,fe;if(x===0){if(R<0&&se<y)fe=1;else if(fe=D/u,D+=R,D>=u)x=2;else if(D<=0){x=4;break}}else fe=1;let Q=F|0,Re=0,Ie=0;if(Q>=0&&Q<a-1){let ze=F-Q,Nr=s[Q],kr=l[Q];Re=Nr+ze*(s[Q+1]-Nr),Ie=kr+ze*(l[Q+1]-kr)}if(W===0&&(T>0&&F>=f?(W=1,ne=d):T<0&&F<=v&&(W=1,ne=p)),W>0){let ze=ne|0;if(ze>=0&&ze<a-1){let Nr=ne-ze,kr=s[ze],Ne=l[ze],Ct=kr+Nr*(s[ze+1]-kr),$r=Ne+Nr*(l[ze+1]-Ne),Mh=W/fy,fx=Math.cos(Mh*Math.PI*.5),js=Math.sin(Mh*Math.PI*.5);Re=Re*fx+Ct*js,Ie=Ie*fx+$r*js}ne-=T,W+=1,W>=fy&&(F=ne,T=-T,W=0)}i[J]+=Re*fe,n[J]+=Ie*fe,F+=T}this.#o=x,this.#a=F,this.#l=D,this.#s=R,this.#u=T,this.#c=W,this.#d=ne,this.#p=0,this.#h=0}};var Vs=class{#e;#t;#r;#i=1;#n;#o=0;#a;#l;#s=0;constructor(e,t,i,n,o=0,a=0){this.#e=e,this.#t=t,this.#r=i,this.#a=n,this.#n=o,this.#l=a,this.#n>=t.numberOfFrames&&(this.#i=4)}get readPosition(){return this.#n}done(){return this.#i===4}isFadingOut(){return this.#i===3}startFadeOut(e){this.#i!==4&&this.#i!==3&&(this.#i=3,this.#o=0,this.#s=e)}setPlaybackRate(e){this.#a=e}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#r,p=this.#a,d=a-u*p,f=this.#l,v=this.#s,m=this.#i,y=this.#n,x=this.#o;for(let F=0;F<t&&m!==4;F++){if(F<f)continue;let D=e+F,R;if(m===1)R=x/u,++x>=u&&(m=2,x=0);else if(m===3){if(F<v)R=1;else if(R=1-x/u,++x>=u){m=4;break}}else R=1;let T=y|0;if(T>=0&&T<a-1){let W=y-T,ne=s[T],se=l[T];i[D]+=(ne+W*(s[T+1]-ne))*R,n[D]+=(se+W*(l[T+1]-se))*R}y+=p,m===2&&y>=d&&(m=3,x=0)}this.#i=m,this.#n=y,this.#o=x,this.#l=0,this.#s=0}};var gy=class extends Yt{#e;#t;#r;#i;constructor(e,t){super(e),this.#e=t,this.#t=new ve(2),this.#r=this.own(new _e(e.broadcaster,t.address)),this.#i=A.newSet(({adapter:{uuid:i}})=>i),this.ownAll(this.#e.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:i=>this.#i.add({adapter:i,voices:[],lastTransientIndex:-1}),onRemove:i=>this.#i.removeByKey(i.uuid),onReorder:i=>{}}),e.registerProcessor(this))}get noteEventTarget(){return g.None}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#t}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#i.forEach(e=>{e.voices=[],e.lastTransientIndex=-1})}process({blocks:e}){this.#t.clear(0,128),this.#i.forEach(n=>e.forEach(o=>this.#n(n,o))),this.#t.assertSanity();let[t,i]=this.#t.channels();this.#r.process(t,i)}parameterChanged(e){}#n(e,t){let{adapter:i}=e;if(i.type!==re.Audio||!i.enabled.getValue()){e.voices.forEach(l=>l.startFadeOut(0)),e.lastTransientIndex=-1;return}let{p0:n,p1:o,flags:a}=t;if(!nt.every(a,5))return;let s=this.context.clipSequencing.iterate(i.uuid,n,o);for(let{optClip:l,sectionFrom:u,sectionTo:p}of s)l.match({none:()=>{for(let d of i.regions.collection.iterateRange(n,o)){if(d.mute||!De(d,Uo))continue;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.waveformOffset.getValue(),y=d.asPlayModeTimeStretch;if(y.nonEmpty()){let x=f.transients;if(x.length()<2)return;for(let F of Kt.locateLoops(d,n,o)){let D=y.unwrap();this.#l(e,t,F,v.unwrap(),D,x,m)}}else for(let x of Kt.locateLoops(d,n,o))this.#o(e,t,x,d,v.unwrap())}},some:d=>{if(!De(d,Jn))return;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.asPlayModeTimeStretch;if(m.nonEmpty()){let y=m.unwrap(),x=f.transients;if(x.length()<2)return;for(let F of Kt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},u,p))this.#l(e,t,F,v.unwrap(),y,x,d.waveformOffset.getValue())}else for(let y of Kt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},u,p))this.#o(e,t,y,d,v.unwrap())}})}#o(e,t,i,n,o){let{p0:a,p1:s,s0:l,s1:u,flags:p}=t,d=u-l,f=s-a,v=(i.resultStart-a)/f,m=(i.resultEnd-a)/f,y=l+d*v,x=l+d*m,F=x-y|0,D=n.waveformOffset.getValue();I(l<=y&&x<=u,()=>`Out of bounds ${y}, ${x}`),nt.some(p,2)&&(e.voices.forEach(T=>T.startFadeOut(0)),e.lastTransientIndex=-1);let R=n.asPlayModePitch;if(R.isEmpty()||n.observableOptPlayMode.isEmpty()){let T=o.numberOfFrames,ne=(i.resultEndValue-i.resultStartValue)*T,se=(i.resultEnd-i.resultStart)/f*d,J=ne/se,fe=i.resultStartValue*o.numberOfFrames+D*o.sampleRate;this.#a(e,o,J,fe,0)}else{let W=R.unwrap().warpMarkers,ne=W.first(),se=W.last();if(ne===null||se===null){e.voices.forEach(Ie=>Ie.startFadeOut(0));return}let J=i.resultStart-i.rawStart;if(J<ne.position||J>=se.position){e.voices.forEach(Ie=>Ie.startFadeOut(0));return}let fe=this.#d(J,i.resultStartValue,W),Q=this.#u(J,W,o.sampleRate,f,d),Re=(fe+D)*o.sampleRate;this.#a(e,o,Q,Re,0)}for(let T of e.voices)T.process(y|0,F);e.voices=e.voices.filter(T=>!T.done())}#a(e,t,i,n,o){if(e.voices.length===0)e.voices.push(new Vs(this.#t,t,256,i,n,o));else{let a=!1;for(let s of e.voices)if(s instanceof Vs){if(s.isFadingOut())continue;Math.abs(s.readPosition-n)>256?s.startFadeOut(o):(s.setPlaybackRate(i),a=!0)}else s.startFadeOut(o);a||e.voices.push(new Vs(this.#t,t,256,i,n,o))}}#l(e,t,i,n,o,a,s){let{p0:l,p1:u,s0:p,s1:d,flags:f}=t;nt.some(f,2)&&(e.lastTransientIndex=-1,e.voices.forEach(Ie=>Ie.startFadeOut(0)));for(let Ie of e.voices)Ie instanceof Vs&&Ie.startFadeOut(0);let v=d-p,m=u-l,y=(i.resultStart-l)/m,x=(i.resultEnd-l)/m,F=p+v*y,D=p+v*x,R=D-F|0,T=o.warpMarkers,W=o.transientPlayMode;I(p<=F&&D<=d,()=>`Out of bounds ${F}, ${D}`);let ne=X(T.first(),"missing first warp marker"),se=X(T.last(),"missing last warp marker"),J=i.resultStart-i.rawStart;if(J<ne.position||J>=se.position)return;let Q=this.#d(J,i.resultStartValue,T)+s;if(Q<0||Q>=n.numberOfFrames/n.sampleRate)return;let Re=a.floorLastIndex(Q);if(Re!==e.lastTransientIndex){let Ie=this.#s(Re,a,n);if(Tn(Ie))return;let{segment:ze,hasNext:Nr,nextTransientSeconds:kr}=Ie,Ne=ze.end-ze.start;if(Ne>=256*2){let Ct=a.optAt(Re),$r=0;if(Ct!==null&&e.lastTransientIndex!==-1){let Ac=Ct.position-s,_c=this.#c(Ac,T)-J;_c>0&&_c<m&&($r=_c/m*R|0)}e.voices.forEach(Ac=>Ac.startFadeOut($r));let Mh=Q*n.sampleRate-ze.start,js=e.lastTransientIndex===-1||Re!==e.lastTransientIndex+1?0:Math.max(0,Mh),rP=!1;if(Nr&&W!==bo.Once){let Ac=kr-s,_c=this.#c(Ac,T)-J,YE=R/m,XE=_c*YE,iP=Ne,eB=iP-512;rP=XE>iP*1.01&&eB>=2048}W===bo.Once||!rP?e.voices.push(new py(this.#t,n,ze,256,js,$r)):W===bo.Repeat?e.voices.push(new hy(this.#t,n,ze,256,js,$r)):e.voices.push(new my(this.#t,n,ze,256,js,$r))}e.lastTransientIndex=Re}for(let Ie of e.voices)Ie.process(F|0,R);e.voices=e.voices.filter(Ie=>!Ie.done())}#s(e,t,i){let n=t.optAt(e);if(n===null)return null;let o=t.optAt(e+1),a=n.position*i.sampleRate,s=o!==null?o.position*i.sampleRate:i.numberOfFrames;return{segment:{start:a,end:s},hasNext:o!==null,nextTransientSeconds:o!==null?o.position:Number.POSITIVE_INFINITY}}#u(e,t,i,n,o){let a=t.floorLastIndex(e),s=t.optAt(a),l=t.optAt(a+1);if(s===null||l===null)return 1;let u=l.position-s.position,f=(l.seconds-s.seconds)*i/u,v=o/n;return f/v}#c(e,t){for(let i=0;i<t.length()-1;i++){let n=t.optAt(i),o=t.optAt(i+1);if(!(n===null||o===null)&&e>=n.seconds&&e<o.seconds){let a=(e-n.seconds)/(o.seconds-n.seconds);return n.position+a*(o.position-n.position)}}return 0}#d(e,t,i){let n=i.floorLastIndex(e),o=i.optAt(n),a=i.optAt(n+1);if(o===null||a===null)return t;let s=(e-o.position)/(a.position-o.position);return o.seconds+s*(a.seconds-o.seconds)}};var Fr=class extends Yt{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,p1:o,s0:a,bpm:s}=t,l=null,u=n;for(let p of this.eventInput.get(i))l?.forEach(d=>this.handleEvent(t,d)),l=null,u<p.position&&(this.processEvents(t,u,p.position),u=p.position),_h.isOfType(p)?this.updateParameters(p.position,a/sampleRate+Y.pulsesToSeconds(p.position-n,s)):(l??=[]).push(p);l?.forEach(p=>this.handleEvent(t,p)),l=null,u<o&&this.processEvents(t,u,o)}),this.eventInput.clear()}introduceBlock(e){}};var xc;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(i,n)=>n*i.mult+i.add))(xc||={});var vy=Object.freeze([{name:"up",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=t%a,u=Math.floor(t%s/a),p=r[l];return ye.start(i,n,p.pitch+u*12,xc.apply(o,p.velocity))}},{name:"down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=a-1-t%a,u=e-1-Math.floor(t%s/a),p=r[l];return ye.start(i,n,p.pitch+u*12,xc.apply(o,p.velocity))}},{name:"up-down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=Math.max(1,s*2-2),u=t%l,p=u<s?u:l-u,d=p%a,f=Math.floor(p/a),v=r[d];return ye.start(i,n,v.pitch+f*12,xc.apply(o,v.velocity))}}]);var yy=class extends Fr{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u=xc.create();#c=g.None;#d=vy[0];#p=NaN;#h=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new el,this.#i=this.own(this.bindParameter(t.namedParameter.modeIndex)),this.#n=this.own(this.bindParameter(t.namedParameter.rate)),this.#o=this.own(this.bindParameter(t.namedParameter.gate)),this.#a=this.own(this.bindParameter(t.namedParameter.repeat)),this.#l=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#s=this.own(this.bindParameter(t.namedParameter.velocity)),this.ownAll(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return g.wrap(this)}setNoteEventSource(e){return I(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=g.wrap(e),L.create(()=>this.#c=g.None)}*processNotes(e,t,i){if(this.#r.nonEmpty())if(nt.every(i,2))for(let o of this.#r.releaseAll())yield ye.stop(o,e);else for(let o of this.#r.releaseLinearCompleted(t))yield ye.stop(o,o.position+o.duration);if(this.#c.nonEmpty()){let n=this.#c.unwrap();for(let a of n.processNotes(e,t,i));let o=!nt.every(i,1);for(let{position:a,index:s}of rn.iterateWithIndex(e,t,this.#p)){let l=Array.from(n.iterateActiveNotesAt(a,o));if(l.length===0)continue;let u=Math.floor(s/this.#f),p=Math.max(1,Math.floor(this.#p*this.#h)),d=this.#d.run(l,this.#m,u,a,p,this.#u);this.#r.addAndRetain({...d}),yield d}for(let a of this.#r.releaseLinearCompleted(t))yield ye.stop(a,a.position+a.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,tr.Comparator))}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){if(e===this.#i)this.#d=vy.at(this.#i.getValue())??vy[0];else if(e===this.#n)this.#p=er.toPPQN(Zi.RateFractions[this.#n.getValue()]);else if(e===this.#o)this.#h=this.#o.getValue();else if(e===this.#a)this.#f=this.#a.getValue();else if(e===this.#l)this.#m=this.#l.getValue();else if(e===this.#s){let t=this.#s.getValue();t<=0?(this.#u.add=1+t,this.#u.mult=0):(this.#u.add=1-t,this.#u.mult=t)}}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var xy=class extends Fr{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.#r=this.own(this.bindParameter(t.namedParameter.octaves)),this.#i=this.own(this.bindParameter(t.namedParameter.semiTones)),this.#n=this.own(this.bindParameter(t.namedParameter.cent)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=g.wrap(e),L.create(()=>this.#o=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#o.isEmpty())for(let n of this.#o.unwrap().processNotes(e,t,i))if(ye.isStart(n)){this.#t.noteOn(n.pitch);let{cent:o,octaves:a,semiTones:s}=this.#e.namedParameter;yield Mr.overwrite(n,{pitch:n.pitch+a.valueAt(n.position)*12+s.valueAt(n.position),cent:n.cent+o.valueAt(n.position)})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#o.isEmpty()){for(let i of this.#o.unwrap().iterateActiveNotesAt(e,t))if(i.type==="note-event"){let{cent:n,octaves:o,semiTones:a}=this.#e.namedParameter;yield Mr.overwrite(i,{pitch:i.pitch+o.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+n.valueAt(i.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var wy=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#w;#b;#A;#N;#B;#P;#k;#g;#v;#y;#E;#F;#S;#_;#$;#M;#D;#C;#R;#T;#O;#I=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=new Ls,this.#o=new Float32Array(this.#n.numBins()),this.#a=O.create(()=>new tn,7),this.#l=[new go(4),new go(4)],this.#s=[new go(4),new go(4)],this.#u=[this.#s,[new wt,new wt],[new wt,new wt],[new wt,new wt],[new wt,new wt],[new wt,new wt],this.#l],this.#c=O.create(()=>!0,7);let i=this.#t.namedParameter;this.#d=this.own(this.bindParameter(i.highPass.enabled)),this.#h=this.own(this.bindParameter(i.highPass.q)),this.#p=this.own(this.bindParameter(i.highPass.frequency)),this.#f=this.own(this.bindParameter(i.highPass.order)),this.#m=this.own(this.bindParameter(i.lowShelf.enabled)),this.#w=this.own(this.bindParameter(i.lowShelf.frequency)),this.#b=this.own(this.bindParameter(i.lowShelf.gain)),this.#A=this.own(this.bindParameter(i.lowBell.enabled)),this.#N=this.own(this.bindParameter(i.lowBell.frequency)),this.#B=this.own(this.bindParameter(i.lowBell.gain)),this.#P=this.own(this.bindParameter(i.lowBell.q)),this.#k=this.own(this.bindParameter(i.midBell.enabled)),this.#g=this.own(this.bindParameter(i.midBell.frequency)),this.#v=this.own(this.bindParameter(i.midBell.gain)),this.#y=this.own(this.bindParameter(i.midBell.q)),this.#E=this.own(this.bindParameter(i.highBell.enabled)),this.#F=this.own(this.bindParameter(i.highBell.frequency)),this.#S=this.own(this.bindParameter(i.highBell.gain)),this.#_=this.own(this.bindParameter(i.highBell.q)),this.#$=this.own(this.bindParameter(i.highShelf.enabled)),this.#M=this.own(this.bindParameter(i.highShelf.frequency)),this.#D=this.own(this.bindParameter(i.highShelf.gain)),this.#C=this.own(this.bindParameter(i.lowPass.enabled)),this.#R=this.own(this.bindParameter(i.lowPass.frequency)),this.#T=this.own(this.bindParameter(i.lowPass.q)),this.#O=this.own(this.bindParameter(i.lowPass.order)),this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.spectrum,this.#o,()=>{this.#o.set(this.#n.bins()),this.#n.decay=!0})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.#u.forEach(e=>e.forEach(t=>t.reset())),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#I=g.wrap(e),{terminate:()=>this.#I=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#I.isEmpty())return;let[n,o]=this.#r.channels(),a=this.#I.unwrap();if(this.#c.some(s=>s)){let[s,l]=a.channels();this.#a.forEach((u,p)=>{if(this.#c[p]){let[d,f]=this.#u[p];d.process(u,s,n,t,i),f.process(u,l,o,t,i),s=n,l=o}})}else{let[s,l]=a.channels();for(let u=t;u<i;u++)n[u]=s[u],o[u]=l[u]}this.#i.process(n,o,t,i),this.#n.process(n,o,t,i)}parameterChanged(e){if(e===this.#O){let i=this.#O.getValue()+1;this.#l[0].order=i,this.#l[1].order=i}else if(e===this.#f){let i=this.#f.getValue()+1;this.#s[0].order=i,this.#s[1].order=i}else if(e===this.#p||e===this.#h){let t=this.#p.getValue(),i=this.#h.getValue();this.#a[0].setHighpassParams(t/sampleRate,i)}else if(e===this.#w||e===this.#b){let t=this.#w.getValue(),i=this.#b.getValue();this.#a[1].setLowShelfParams(t/sampleRate,i)}else if(e===this.#N||e===this.#B||e===this.#P){let t=this.#N.getValue(),i=this.#B.getValue(),n=this.#P.getValue();this.#a[2].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#g||e===this.#v||e===this.#y){let t=this.#g.getValue(),i=this.#v.getValue(),n=this.#y.getValue();this.#a[3].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#F||e===this.#S||e===this.#_){let t=this.#F.getValue(),i=this.#S.getValue(),n=this.#_.getValue();this.#a[4].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#M||e===this.#D){let t=this.#M.getValue(),i=this.#D.getValue();this.#a[5].setHighShelfParams(t/sampleRate,i)}else if(e===this.#R||e===this.#T){let t=this.#R.getValue(),i=this.#T.getValue();this.#a[6].setLowpassParams(t/sampleRate,i)}else e===this.#d?this.#c[0]=this.#d.getValue():e===this.#m?this.#c[1]=this.#m.getValue():e===this.#A?this.#c[2]=this.#A.getValue():e===this.#k?this.#c[3]=this.#k.getValue():e===this.#E?this.#c[4]=this.#E.getValue():e===this.#$?this.#c[5]=this.#$.getValue():e===this.#C&&(this.#c[6]=this.#C.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var by=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#e=new Float32Array(2048);#t=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#n=new Float32Array(2048);#o=new Float32Array(2048);#a=new Float32Array(2048);#l=new Float32Array(2048);#s=new Float32Array(1024);#u=new Float32Array(512);#c=new Float32Array(512);#d=new Float32Array(256);#p=new Float32Array(2048);#h=new Float32Array(2048);#f=new Float32Array(2048);#m=new Float32Array(2048);#w=new Float32Array(2048);#b=new Float32Array(2048);#A=new Float32Array(2048);#N=new Float32Array(2048);#B=new Float32Array(1024);#P=new Float32Array(512);#k=new Float32Array(512);#g=new Float32Array(256);#v;#y;#E=0;#F=0;#S=0;#_=0;#$=0;#M=0;#D=0;#C=0;#R=0;#T=0;#O=0;#I=0;#V=0;#z=0;#U=0;#j=0;#L=0;#K=0;#W=0;#Z=0;#q=0;#H=0;#J=0;#Q=0;#Y=0;#X=0;#ee=0;#te=0;#re=0;#ie=0;#ne=0;#oe=0;#ae=0;#se=0;#le=0;#ue=0;#ce=0;#de=0;#pe=0;#he=0;#x=0;#G=0;constructor(e=.5){this.#v=fo(Math.ceil(e*sampleRate)),this.#y=new Float32Array(this.#v<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#x=0,this.#G=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#x=0,this.#G=0,this.clearHistory(),this.clearBuffers()}process(e,t,i,n){let[o,a]=t.channels(),[s,l]=e.channels(),u=.4*this.damp,p=1-u,d=.7+.28*this.roomSize;for(let f=i;f<n;++f){let v=o[f],m=a[f],y=this.#G-this.predelayInSamples;y<0&&(y+=this.#v);let x;x=y<<1;let F=.01,D=this.#y[x]*F,R=this.#y[x+1]*F;x=this.#G<<1,this.#y[x]=v,this.#y[x+1]=m,this.#G=this.#G+1&this.#v-1;let T=this.#x&2047;this.#E=p*this.#F+u*this.#E,this.#e[T]=D+d*this.#E,this.#F=this.#e[this.#x-1617&2047],this.#S=p*this.#_+u*this.#S,this.#t[T]=D+d*this.#S,this.#_=this.#t[this.#x-1557&2047],this.#$=p*this.#M+u*this.#$,this.#r[T]=D+d*this.#$,this.#M=this.#r[this.#x-1491&2047],this.#D=p*this.#C+u*this.#D,this.#i[T]=D+d*this.#D,this.#C=this.#i[this.#x-1422&2047],this.#R=p*this.#T+u*this.#R,this.#n[T]=D+d*this.#R,this.#T=this.#n[this.#x-1356&2047],this.#O=p*this.#I+u*this.#O,this.#o[T]=D+d*this.#O,this.#I=this.#o[this.#x-1277&2047],this.#V=p*this.#z+u*this.#V,this.#a[T]=D+d*this.#V,this.#z=this.#a[this.#x-1188&2047],this.#U=p*this.#j+u*this.#U,this.#l[T]=D+d*this.#U,this.#j=this.#l[this.#x-1116&2047];let W=this.#j+this.#z+this.#I+this.#T+this.#C+this.#M+this.#_+this.#F,ne=this.#L-W,se=this.#K-ne,J=this.#W-se;this.#s[this.#x&1023]=W+.5*this.#L,this.#L=this.#s[this.#x-556&1023],this.#u[this.#x&511]=ne+.5*this.#K,this.#K=this.#u[this.#x-441&511],this.#c[this.#x&511]=se+.5*this.#W,this.#W=this.#c[this.#x-341&511],this.#d[this.#x&255]=J+.5*this.#Z,this.#Z=this.#d[this.#x-225&255],s[f]=this.dryGain*v+this.wetGain*(this.#Z-J),this.#q=p*this.#H+u*this.#q,this.#p[T]=R+d*this.#q,this.#H=this.#p[this.#x-1640&2047],this.#J=p*this.#Q+u*this.#J,this.#h[T]=R+d*this.#J,this.#Q=this.#h[this.#x-1580&2047],this.#Y=p*this.#X+u*this.#Y,this.#f[T]=R+d*this.#Y,this.#X=this.#f[this.#x-1514&2047],this.#ee=p*this.#te+u*this.#ee,this.#m[T]=R+d*this.#ee,this.#te=this.#m[this.#x-1445&2047],this.#re=p*this.#ie+u*this.#re,this.#w[T]=R+d*this.#re,this.#ie=this.#w[this.#x-1379&2047],this.#ne=p*this.#oe+u*this.#ne,this.#b[T]=R+d*this.#ne,this.#oe=this.#b[this.#x-1300&2047],this.#ae=p*this.#se+u*this.#ae,this.#A[T]=R+d*this.#ae,this.#se=this.#A[this.#x-1211&2047],this.#le=p*this.#ue+u*this.#le,this.#N[T]=R+d*this.#le,this.#ue=this.#N[this.#x-1139&2047];let fe=this.#ue+this.#se+this.#oe+this.#ie+this.#te+this.#X+this.#Q+this.#H,Q=this.#ce-fe,Re=this.#de-Q,Ie=this.#pe-Re;this.#B[this.#x&1023]=fe+.5*this.#ce,this.#ce=this.#B[this.#x-579&1023],this.#P[this.#x&511]=Q+.5*this.#de,this.#de=this.#P[this.#x-464&511],this.#k[this.#x&511]=Re+.5*this.#pe,this.#pe=this.#k[this.#x-364&511],this.#g[this.#x&255]=Ie+.5*this.#he,this.#he=this.#g[this.#x-248&255],l[f]=this.dryGain*m+this.wetGain*(this.#he-Ie),this.#x++}}clearBuffers(){this.#e.fill(0),this.#t.fill(0),this.#r.fill(0),this.#i.fill(0),this.#n.fill(0),this.#o.fill(0),this.#a.fill(0),this.#l.fill(0),this.#s.fill(0),this.#u.fill(0),this.#c.fill(0),this.#d.fill(0),this.#p.fill(0),this.#h.fill(0),this.#f.fill(0),this.#m.fill(0),this.#w.fill(0),this.#b.fill(0),this.#A.fill(0),this.#N.fill(0),this.#B.fill(0),this.#P.fill(0),this.#k.fill(0),this.#g.fill(0),this.#y.fill(0)}clearHistory(){this.#E=0,this.#F=0,this.#S=0,this.#_=0,this.#$=0,this.#M=0,this.#D=0,this.#C=0,this.#R=0,this.#T=0,this.#O=0,this.#I=0,this.#V=0,this.#z=0,this.#U=0,this.#j=0,this.#L=0,this.#K=0,this.#W=0,this.#Z=0,this.#q=0,this.#H=0,this.#J=0,this.#Q=0,this.#Y=0,this.#X=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#ne=0,this.#oe=0,this.#ae=0,this.#se=0,this.#le=0,this.#ue=0,this.#ce=0,this.#de=0,this.#pe=0,this.#he=0}};var Ay=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=new by;let{decay:i,preDelay:n,damp:o,wet:a,dry:s}=this.#t.namedParameter;this.#o=this.own(this.bindParameter(i)),this.#a=this.own(this.bindParameter(n)),this.#l=this.own(this.bindParameter(o)),this.#s=this.own(this.bindParameter(a)),this.#u=this.own(this.bindParameter(s)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=g.wrap(e),{terminate:()=>this.#c=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#c.isEmpty())return;this.#n.process(this.#r,this.#c.unwrap(),t,i);let[n,o]=this.#r.channels();this.#i.process(n,o,t,i)}parameterChanged(e){this.#o===e?this.#n.roomSize=this.#o.getValue():this.#a===e?this.#n.predelayInSamples=Math.ceil(this.#a.getValue()*sampleRate):this.#l===e?this.#n.damp=this.#l.getValue():this.#s===e?this.#n.wetGain=Oe(this.#s.getValue()):this.#u===e&&(this.#n.dryGain=Oe(this.#u.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var _y=class extends Me{#e;#t;#r;#i;#n;#o;#a;gain=1;release=1;loader=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new ve,this.#i=new Cn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#n=this.own(new _e(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.release)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.loader=i.targetVertex.map(({box:n})=>e.sampleManager.getOrCreate(n.address.uuid)))),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#i.introduceBlock(e)}setNoteEventSource(e){return this.#i.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear(),this.#i.clear(),this.#n.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}get adapter(){return this.#e}handleEvent(e){ye.isStart(e)?this.#t.push(new H_(this,e)):ye.isStop(e)&&this.#t.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,i){this.#r.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#r,t,i)&&this.#t.splice(n,1)}parameterChanged(e){e===this.#o?this.gain=Oe(this.#o.getValue()):e===this.#a&&(this.release=this.#a.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},H_=class{#e;#t;#r=1;#i=0;#n=.003*sampleRate|0;#o=0;#a=Number.POSITIVE_INFINITY;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.pow(2,(t.pitch+t.cent/100)/12-5)}event(){return this.#t}stop(){this.#a=this.#o}processAdd(e,t,i){let n=this.#e.loader;if(n.isEmpty())return!0;let o=n.unwrap();return o.data.isEmpty()?!0:this.processSimple(e.channels(),o.data.unwrap(),t,i)}processSimple(e,t,i,n){let[o,a]=e,s=t.frames[0],l=t.frames[1]??s,u=t.numberOfFrames,p=t.sampleRate/sampleRate,d=this.#e.gain*this.#t.velocity,f=this.#e.release,v=1/f;for(let m=i;m<n;m++){let y=this.#i|0;if(y>=u-1)return!0;let x=this.#i-y,F=this.#o<this.#n?this.#o/this.#n:1,D=(Math.min(1-(this.#o-this.#a)*v,1)*F)**2,R=s[y]*(1-x)+s[y+1]*x,T=l[y]*(1-x)+l[y+1]*x;if(o[m]+=R*d*D,a[m]+=T*d*D,this.#i+=this.#r*p,++this.#o-this.#a>f)return!0}return!1}};var Py=class extends Fr{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=new Cn(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}introduceBlock(e){this.#t.introduceBlock(e)}setNoteEventSource(e){return this.#t.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#t.clear()}processEvents(e,t,i){}handleEvent({index:e},t){ye.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t)):ye.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var Sy=class extends Me{#e;#t;#r;#i;#n;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=this.own(new _e(e.broadcaster,t.adapter.address)),this.#i=[],this.#n=new vc,this.own(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{O.remove(this.#i,e),this.#t.clear()}}}get audioOutput(){return this.#t}get eventInput(){return this.#n}processAudio(e,t,i){}reset(){this.#r.clear()}finishProcess(){this.#t.clear();let[e,t]=this.#t.channels();for(let i of this.#i){let[n,o]=i.channels();for(let a=0;a<128;a++)e[a]+=n[a],t[a]+=o[a]}this.#t.assertSanity(),this.#r.process(this.#t.getChannel(0),this.#t.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var Ey=class r{static create(e,t,i,n){return new r(e,t,i,n)}#e=new z;#t;#r;#i=[];#n=!0;constructor(e,t,i,n){this.#t=A.newSet(({device:o})=>o.uuid),this.#r=this.#e.own(new z),this.#e.ownAll(t.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let a=Nh.create(e,o.box),s=this.#t.add({device:a,subscription:a.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(s,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:a,subscription:s}=this.#t.removeByKey(o.uuid);s.terminate(),a.terminate()},onReorder:o=>this.invalidateWiring()}),e.subscribeProcessPhase(o=>{if(o===0&&this.#n){let a=i;O.replace(this.#i,t.adapters().map(({uuid:s})=>this.#t.get(s).device));for(let s of this.#i)s.adapter().enabledField.getValue()&&(this.#r.own(s.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,s.incoming)),a=s);this.#r.own(n.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,n.incoming)),this.#n=!1}}))}invalidateWiring(){this.#r.terminate(),this.#n=!0}terminate(){this.#e.terminate(),this.#t.forEach(({device:e})=>e.terminate()),this.#t.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var kh=Math.floor(.005*sampleRate),Fy=class{#e;#t;#r;#i;#n;#o;#a=0;#l=Number.POSITIVE_INFINITY;#s;#u;#c;#d;#p;#h;#f=!0;#m=!1;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#i=i,this.#r=n,this.#n=e.gate,this.#o=Xs(this.#r.velocity);let{attack:o,release:a,sampleStart:s,sampleEnd:l}=this.#t;this.#s=o.getValue()*sampleRate,this.#u=a.getValue()*sampleRate,this.#c=(i.numberOfFrames-1)*s.getValue(),this.#d=(i.numberOfFrames-1)*l.getValue(),this.#p=this.#c,this.#h=0}get sample(){return this.#e}get event(){return this.#r}get position(){return this.#p}get envelope(){return this.#h}release(e=!1){this.#f&&(e?(this.#u=kh,this.#w(),this.#f=!1):this.#n!==In.Off&&this.#w())}processAdd(e,t,i){let[n,o]=e,{frames:a,numberOfFrames:s}=this.#i,l=a[0],u=a[1]??l,{pitch:p}=this.#t,d=this.#d-this.#c,f=Math.sign(d),v=this.#i.sampleRate/sampleRate*f*2**(p.getValue()/1200),m=0;for(let y=t;y<i;y++){let x=this.#p|0,F=this.#p-x,D=l[x]*(1-F)+(l[x+1]??0)*F,R=u[x]*(1-F)+(u[x+1]??0)*F;if(m=Math.min(this.#a/this.#s,1-(this.#a-(this.#l+this.#s))/this.#u,1),this.#p+=v,f>0){if(this.#n===In.Off){if(this.#p>=s)return!0;!this.#m&&this.#p>=this.#d&&this.#w()}else if(this.#n===In.On){if(this.#p>=this.#d-kh){if(this.#p>=this.#d)return!0;m*=(this.#d-this.#p)/kh}}else if(this.#n===In.Loop)for(;this.#p>=this.#d;)this.#p-=d}else if(f<0){if(this.#n===In.Off){if(this.#p<=0)return!0;!this.#m&&this.#p<=this.#d&&this.#w()}else if(this.#n===In.On){if(this.#p<=this.#d+kh){if(this.#p<=this.#d)return!0;m*=(this.#d-this.#p)/kh}}else if(this.#n===In.Loop)for(;this.#p<=this.#d;)this.#p-=d}if(++this.#a-this.#l>this.#s+this.#u)return!0;m*=this.#o*m,n[y]+=D*m,o[y]+=R*m}return this.#h=m,!1}toString(){return"{PlayfieldSampleVoice}"}#w(){this.#m||(this.#m=!0,this.#l=this.#a<this.#s?this.#a-this.#s:this.#a)}};var Ny=class extends Me{#e;#t;#r;#i;#n;#o;constructor(e,t,i,n){super(e),this.#e=t,this.#t=i,this.#r=[],this.#i=new ve,this.#n=this.own(new _e(e.broadcaster,i.peakAddress));let{sampleStart:o,sampleEnd:a,attack:s,release:l,pitch:u}=i.namedParameter;this.#o=Object.freeze({sampleStart:this.own(this.bindParameter(o)),sampleEnd:this.own(this.bindParameter(a)),attack:this.own(this.bindParameter(s)),release:this.own(this.bindParameter(l)),pitch:this.own(this.bindParameter(u))});let p=new Float32Array(16);this.ownAll(Ey.create(e,i.audioEffects,this,n),e.broadcaster.broadcastFloats(i.address,p,()=>{let d=this.#r.length<p.length?this.#r:this.#r.slice(0,p.length);d.forEach(({position:f},v)=>p[v]=f),p[d.length]=-1}),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){if(ye.isStart(e)){let t=this.#t.file().flatMap(p=>p.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:i,solo:n,polyphone:o,exclude:a}=this.#t.namedParameter,s=i.getValue(),l=n.getValue();if(s||this.#e.hasSolo()&&!l)return;o.getValue()||this.#r.forEach(p=>p.release(!0)),a.getValue()&&this.#e.stopExcludeOthers(this.#t),this.#r.push(new Fy(this.#t,this.#o,t.unwrap(),e))}else ye.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#r.length-1;n>=0;n--)this.#r[n].processAdd(this.#i.channels(),t,i)&&this.#r.splice(n,1)}forceStop(){this.#r.forEach(e=>e.release(!0))}parameterChanged(e){}reset(){this.#r.length=0,this.#i.clear(),this.#n.clear()}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return`{PlayfieldSampleProcessor note: ${this.#t.indexField.getValue()}}`}};var ky=class{#e=new z;#t;#r;#i;#n;constructor(e,t){this.#t=t,this.#r=this.#e.own(new Py(e,this)),this.#i=this.#e.own(new Sy(e,this)),this.#n=A.newSet(i=>i.uuid),this.#e.ownAll(t.samples.catchupAndSubscribe({onAdd:i=>{let n=new Ny(e,this,i,this.#i);this.#n.add({uuid:i.uuid,processor:n,terminable:e.registerEdge(this.#r,n)}),e.sampleManager.getOrCreate(i.fileUUID())},onRemove:i=>{let{terminable:n,processor:o}=this.#n.removeByKey(i.uuid);n.terminate(),o.terminate()},onReorder:i=>{}}),{terminate:()=>{this.#n.forEach(({terminable:i,processor:n})=>{i.terminate(),n.terminate()}),this.#n.clear()}})}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this.#r}get outgoing(){return this.#i}optSampleProcessor(e){return this.#t.samples.getAdapterByIndex(e).flatMap(t=>this.#n.opt(t.uuid)).map(t=>t.processor)}hasSolo(){return this.#t.samples.adapters().some(e=>e.namedParameter.solo.getValue())}stopExcludeOthers(e){for(let t of this.#t.samples.adapters())t.exclude&&t!==e&&this.#n.opt(t.uuid).ifSome(({processor:i})=>i.forceStop())}get uuid(){return this.#t.uuid}get adapter(){return this.#t}get audioOutput(){return this.#i.audioOutput}parameterChanged(e){}terminate(){this.#e.terminate()}toString(){return"{PlayfieldDeviceProcessor}"}};var $y=class extends Me{#e;#t;#r;#i=Wt.stereoMatrix(sampleRate);#n={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#o;#a;#l;#s;#u;#c;#d=g.None;#p=nn.Linear;#h=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=this.own(new _e(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(t.namedParameter.volume)),this.#a=this.own(this.bindParameter(t.namedParameter.panning)),this.#l=this.own(this.bindParameter(t.namedParameter.stereo)),this.#s=this.own(this.bindParameter(t.namedParameter.invertL)),this.#u=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(i=>{this.#p=i.getValue(),this.#h=!0}),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#f=!1}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,i){if(this.#d.isEmpty())return;this.#h&&(this.#i.update(this.#n,this.#p,this.#f),this.#h=!1);let n=this.#d.unwrap().channels(),o=this.#t.channels();this.#i.processFrames(n,o,t,i),this.#r.processStereo(o,t,i),this.#f=!0}parameterChanged(e){switch(e){case this.#o:this.#n.gain=Oe(this.#o.getValue()),this.#h=!0;return;case this.#a:this.#n.panning=this.#a.getValue(),this.#h=!0;return;case this.#l:this.#n.stereo=this.#l.getValue(),this.#h=!0;return;case this.#s:this.#n.invertL=this.#s.getValue(),this.#h=!0;return;case this.#u:this.#n.invertR=this.#u.getValue(),this.#h=!0;return;case this.#c:this.#n.swap=this.#c.getValue(),this.#h=!0;return}}toString(){return`{${this.constructor.name}}`}};var My=class extends Fr{#e;#t;#r=g.None;#i=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(i=>{this.#r.ifSome(n=>n.terminate()),this.#r=g.wrap(i.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(i.targetVertex.unwrap().box,Ns.checkType))}),L.create(()=>{this.#r.ifSome(i=>i.terminate()),this.#r=g.None}),e.registerProcessor(this))}get uuid(){return this.#e.uuid}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}setNoteEventSource(e){return I(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),L.create(()=>this.#i=g.None)}*processNotes(e,t,i){if(this.#i.isEmpty())return;let n=this.#i.unwrap(),o=this.#r.mapOr(Sc,Dc.Identity);for(let a of n.processNotes(o.unwarp(e),o.unwarp(t),i))ye.isStart(a)?this.#t.noteOn(a.pitch):this.#t.noteOff(a.pitch),yield Mr.overwrite(a,{position:ce(o.warp(a.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),n=this.#r.mapOr(Sc,Dc.Identity);for(let o of i.iterateActiveNotesAt(n.unwarp(e),t))yield Mr.overwrite(o,{position:n.warp(o.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,i){}};var Iy=class extends Fr{#e;#t;#r=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=g.wrap(e),L.create(()=>this.#r=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#r.isEmpty())for(let n of this.#r.unwrap().processNotes(e,t,i))yield n}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().iterateActiveNotesAt(e,t))yield i}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Dy=(r,e)=>(r[e]??r[e.toString()])?.value,wc=(r,e,t)=>Dy(e,t)??Dy(r,t),GE=new Float32Array(128),Cy=class{event;sampleData;envelope;#e;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,i,n){this.event=e;let o=t.generators,a=i?.generators,s=Dy(a,53)??0,l=i?.sample??n.samples[s];this.sampleData=l.data,this.rootKey=Dy(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=wc(o,a,54)??0;this.shouldLoop=u===1||u===3,this.pan=(wc(o,a,17)??0)/1e3;let p=wc(o,a,34),d=wc(o,a,36),f=wc(o,a,37),v=wc(o,a,38),m=Dh(p)?Math.pow(2,p/1200):.005,y=Dh(d)?Math.pow(2,d/1200):.005,x=1-(f??0)/1e3,F=Dh(v)?Math.pow(2,v/1200):.005;this.envelope=new Ys(sampleRate),this.envelope.set(m,y,x,F),this.envelope.gateOn(),this.#e=new $i(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,i){let o=Mc(this.event.pitch+this.event.cent/100,440)/Mc(this.rootKey,440)*(this.sampleRate/sampleRate),a=Xs(this.event.velocity),s=Math.cos((this.pan+1)*Math.PI/4),l=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(GE,t,i);let u=e.getChannel(0),p=e.getChannel(1);for(let d=t;d<i;d++){let f=Math.floor(this.playbackPosition),m=this.#t(f)/32768*a*this.#e.process(GE[d]);if(u[d]+=m*s,p[d]+=m*l,this.playbackPosition+=o,this.shouldLoop)this.playbackPosition>=this.loopEnd&&this.loopEnd>this.loopStart&&(this.playbackPosition=this.loopStart+(this.playbackPosition-this.loopEnd));else if(this.playbackPosition>=this.sampleData.length-1)return!0}return this.envelope.complete&&this.#e.value<1e-4}#t(e){if(e>=this.sampleData.length-1)return this.sampleData[this.sampleData.length-1];let t=this.playbackPosition-e;return this.sampleData[e]*(1-t)+this.sampleData[e+1]*t}};var Ty=class extends Me{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new Cn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ve,this.#n=this.own(new _e(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.#o=i.targetVertex.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid))))}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}reset(){this.#r.clear(),this.#n.clear(),this.#t.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#o.flatMap(n=>n.soundfont);if(t.isEmpty())return;let i=t.unwrap();if(ye.isStart(e)){let n=i.presets[this.#e.presetIndex]??i.presets[0];if(nP(n)){console.warn("No preset available");return}let o=0;for(let a of n.zones){let s=Math.round(e.velocity*127);if(this.#a(e.pitch,s,a)){let l=a.instrument.zones;for(let u=0;u<l.length;u++){let p=l[u];this.#a(e.pitch,s,p)&&(this.#t.push(new Cy(e,a,p,i)),o++)}}}}else ye.isStop(e)&&this.#t.forEach(n=>{n.event.id===e.id&&n.release()})}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#i,t,i)&&this.#t.splice(n,1)}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#a(e,t,i){return this.#l(i.generators[44]?.range,t)&&this.#l(i.generators[43]?.range,e)}#l(e,t){return Ks(e)||t>=e.lo&&t<=e.hi}};var qE=r=>r>0?20*Math.log10(r):-100,HE=r=>Math.pow(10,r*.05);var Ry=class{#e=.08;#t=1;#r;#i;#n=0;#o=.14;#a=0;#l=.14;#s=0;#u=0;#c=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t,i){this.#s===0&&(this.#s=e[0]),this.#u===0&&(this.#u=e[0]),this.#a=0,this.#l=0;for(let o=t;o<i;++o){let a=e[o]*e[o];this.#s=Math.max(a,this.#r*this.#s+this.#i*a),this.#u=this.#r*this.#u+this.#i*a;let s=this.#s/this.#u;this.#c=s>0?s:0,this.#c>0&&(this.#n=2*(this.#e/this.#c),this.#o=2*(this.#t/this.#c)-this.#n,this.#a+=this.#n,this.#l+=this.#o)}let n=i-t;this.#a/=n,this.#l/=n}getAvgAttack(){return this.#a}getAvgRelease(){return this.#l}};var Oy=class{#e=[];#t;#r;#i;#n=0;constructor(e,t,i,n){this.#i=n,this.#r=Math.floor(e*t),this.#t=i+this.#r;for(let o=0;o<n;o++)this.#e[o]=new Float32Array(this.#t);this.#n=0}process(e,t,i){if(this.#r===0)return;let n=(this.#n-this.#r+this.#t)%this.#t;for(let o=0;o<this.#i;o++){let a=e.getChannel(o),s=this.#n,l=n;for(let u=t;u<i;u++){let p=this.#e[o][l];this.#e[o][s]=a[u],a[u]=p,s=(s+1)%this.#t,l=(l+1)%this.#t}}this.#n=(this.#n+(i-t))%this.#t}};var Vy=class{#e=-20;#t=2;#r=6;#i=3;#n=-.5;setThreshold(e){this.#e=e}setRatio(e){this.#t!==e&&(this.#t=e,this.#t>23.9&&(this.#t=-1/0),this.#n=1/e-1)}setKnee(e){e!==this.#r&&(this.#r=e,this.#i=e/2)}applyCompression(e){let t=e-this.#e;return t<=-this.#i?0:t>-this.#i&&t<=this.#i?.5*this.#n*((t+this.#i)*(t+this.#i))/this.#r:this.#n*t}applyCompressionToBuffer(e,t,i){for(let n=t;n<i;++n){let o=Math.max(Math.abs(e[n]),1e-6),a=qE(o);e[n]=this.applyCompression(a)}}};var Us=class{#e;#t=1;#r=0;#i=0;#n=!0;constructor(e){this.#e=e,this.#t=1,this.#r=1-this.#t}process(e){this.#n&&(this.#i=e,this.#n=!1),this.#i=this.#t*e+this.#r*this.#i}setAlpha(e){this.#t=e,this.#r=1-this.#t}setAlphaWithTime(e){this.#t=Math.exp(-1/(this.#e*e)),this.#r=1-this.#t}getState(){return this.#i}};var zy=class{#e;#t;#r;#i;#n=.01;#o=0;#a=.14;#l=0;#s=0;#u=0;#c=!1;#d=!1;constructor(e){this.#e=e,this.#t=new Ry(e),this.#r=new Us(e),this.#i=new Us(e),this.#o=Math.exp(-1/(e*this.#n)),this.#l=Math.exp(-1/(e*this.#a)),this.#s=0,this.#u=0}setAttack(e){e!==this.#n&&(this.#n=e,this.#o=Math.exp(-1/(this.#e*this.#n)))}setRelease(e){e!==this.#a&&(this.#a=e,this.#l=Math.exp(-1/(this.#e*this.#a)))}setAutoAttack(e){this.#c=e}setAutoRelease(e){this.#d=e}#p(e){return e<this.#s?this.#s=this.#o*this.#s+(1-this.#o)*e:this.#s=this.#l*this.#s+(1-this.#l)*e,this.#s}applyBallistics(e,t,i){for(let n=t;n<i;++n)e[n]=this.#p(e[n])}processCrestFactor(e,t,i){(this.#c||this.#d)&&(this.#t.process(e,t,i),this.#r.process(this.#t.getAvgAttack()),this.#i.process(this.#t.getAvgRelease()),this.#c&&this.setAttack(this.#r.getState()),this.#d&&this.setRelease(this.#i.getState()))}};var Uy=class{#e;#t;#r;#i=0;#n=0;constructor(e,t,i){this.#t=Math.floor(e*t),this.#r=i+this.#t,this.#e=new Float32Array(this.#r),this.#i=0}process(e,t,i){this.#o(e,t,i),this.#l(),this.#a(e,t,i)}#o(e,t,i){for(let n=t;n<i;n++)this.#e[this.#i]=e[n],this.#i=(this.#i+1)%this.#r;this.#n=i-t}#a(e,t,i){let n=this.#i-this.#n-this.#t;n<0&&(n+=this.#r);for(let o=t;o<i;o++)e[o]=this.#e[n],n=(n+1)%this.#r}#l(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,i=0;for(let o=0;o<this.#n;o++){let a=this.#e[e];a>t?(this.#e[e]=t,t+=i):(i=-a/this.#t,t=a+i),e=e-1,e<0&&(e+=this.#r)}let n=!1;for(let o=0;o<this.#t&&!n;o++){if(this.#e[e]>t)this.#e[e]=t,t+=i;else{n=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var jy=class r extends Me{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=128/sampleRate*.05;static ID=0;#e=r.ID++;#t;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d=.005;#p;#h;#f=g.None;#m=!1;#w=!1;#b=!1;#A=!1;#N=-10;#B=2;#P=6;#k=2;#g=140;#v=0;#y=1;#E=0;#F=0;#S=0;#_=0;#$=!1;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#p=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#h=Wt.linear(sampleRate);let{lookahead:i,automakeup:n,autoattack:o,autorelease:a,inputgain:s,threshold:l,ratio:u,knee:p,attack:d,release:f,makeup:v,mix:m}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(i)),this.parameterAutomakeup=this.own(this.bindParameter(n)),this.parameterAutoattack=this.own(this.bindParameter(o)),this.parameterAutorelease=this.own(this.bindParameter(a)),this.parameterInputgain=this.own(this.bindParameter(s)),this.parameterThreshold=this.own(this.bindParameter(l)),this.parameterRatio=this.own(this.bindParameter(u)),this.parameterKnee=this.own(this.bindParameter(p)),this.parameterAttack=this.own(this.bindParameter(d)),this.parameterRelease=this.own(this.bindParameter(f)),this.parameterMakeup=this.own(this.bindParameter(v)),this.parameterMix=this.own(this.bindParameter(m)),this.#n=new zy(sampleRate),this.#o=new Vy,this.#a=new Oy(sampleRate,.005,128,2),this.#l=new Uy(sampleRate,this.#d,128),this.#s=new Us(sampleRate),this.#s.setAlpha(.03),this.#u=new Float32Array(128),this.#c=[new Float32Array(128),new Float32Array(128)],this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.address.append(0),this.#p,()=>{this.#p[0]=Fx(this.#F),this.#p[1]=this.#_,this.#p[2]=Fx(this.#S)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#$=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#u.fill(0),this.#c[0].fill(0),this.#c[1].fill(0),this.#E=0,this.#F=0,this.#S=0,this.#_=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#f=g.wrap(e),{terminate:()=>this.#f=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#f.isEmpty())return;let n=this.#f.unwrap(),o=n.getChannel(0),a=n.getChannel(1),s=this.#r.getChannel(0),l=this.#r.getChannel(1);for(let u=t;u<i;u++){let p=this.#h.moveAndGet(),d=s[u]=o[u]*p,f=l[u]=a[u]*p,v=Math.max(Math.abs(d),Math.abs(f));this.#F<=v?this.#F=v:this.#F*=r.PEAK_DECAY_PER_SAMPLE}this.#u.fill(0,t,i);for(let u=t;u<i;u++)this.#u[u]=Math.max(Math.abs(s[u]),Math.abs(l[u]));this.#n.processCrestFactor(this.#u,t,i),this.#o.applyCompressionToBuffer(this.#u,t,i),this.#n.applyBallistics(this.#u,t,i);for(let u=t;u<i;u++){let p=this.#u[u];this.#_>=p?this.#_=p:this.#_+=r.REDUCTION_DECAY_PER_SAMPLE}this.#E=this.#M(this.#u,t,i),this.#m&&(this.#a.process(this.#r,t,i),this.#l.process(this.#u,t,i));for(let u=t;u<i;u++)this.#u[u]=HE(this.#u[u]+this.#v+this.#E);for(let u=t;u<i;u++)this.#c[0][u]=s[u],this.#c[1][u]=l[u];for(let u=t;u<i;u++)s[u]*=this.#u[u],l[u]*=this.#u[u];for(let u=t;u<i;u++){let p=s[u]*this.#y+this.#c[0][u]*(1-this.#y),d=l[u]*this.#y+this.#c[1][u]*(1-this.#y),f=Math.max(Math.abs(p),Math.abs(d));this.#S<=f?this.#S=f:this.#S*=r.PEAK_DECAY_PER_SAMPLE,s[u]=p,l[u]=d}this.#i.process(s,l,t,i),this.#$=!0}#M(e,t,i){let n=0;for(let o=t;o<i;o++)n+=e[o];return this.#s.process(-n/(i-t)),this.#w?this.#s.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#m=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#w=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#b=this.parameterAutoattack.getValue(),this.#n.setAutoAttack(this.#b),this.#b||this.#n.setAttack(this.#k*.001)):e===this.parameterAutorelease?(this.#A=this.parameterAutorelease.getValue(),this.#n.setAutoRelease(this.#A),this.#A||this.#n.setRelease(this.#g*.001)):e===this.parameterInputgain?this.#h.set(Oe(this.parameterInputgain.getValue()),this.#$):e===this.parameterThreshold?(this.#N=this.parameterThreshold.getValue(),this.#o.setThreshold(this.#N)):e===this.parameterRatio?(this.#B=this.parameterRatio.getValue(),this.#o.setRatio(this.#B)):e===this.parameterKnee?(this.#P=this.parameterKnee.getValue(),this.#o.setKnee(this.#P)):e===this.parameterAttack?(this.#k=this.parameterAttack.getValue(),this.#b||this.#n.setAttack(this.#k*.001)):e===this.parameterRelease?(this.#g=this.parameterRelease.getValue(),this.#A||this.#n.setRelease(this.#g*.001)):e===this.parameterMakeup?this.#v=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#y=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Ly=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=new Lh(sampleRate),this.#n=this.own(new _e(e.broadcaster,t.address));let{crush:i,bits:n,boost:o,mix:a}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(i)),this.parameterBitDepth=this.own(this.bindParameter(n)),this.parameterBoost=this.own(this.bindParameter(o)),this.parameterMix=this.own(this.bindParameter(a)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.reset(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#i.process(n.channels(),this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i)}parameterChanged(e){e===this.parameterCrusherRate?this.#i.setCrush(1-this.parameterCrusherRate.getValue()):e===this.parameterBitDepth?this.#i.setBitDepth(this.parameterBitDepth.getValue()):e===this.parameterBoost?this.#i.setBoost(this.parameterBoost.getValue()):e===this.parameterMix&&this.#i.setMix(this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var R$=[2,4,8],JE=8,Ky=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterDrive;parameterVolume;#o=g.None;#a=!1;#l;#s;#u;#c;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=[new Float32Array(128*JE),new Float32Array(128*JE)],this.#n=this.own(new _e(e.broadcaster,t.address));let{drive:i,volume:n}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(i)),this.parameterVolume=this.own(this.bindParameter(n)),this.ownAll(e.registerProcessor(this),t.box.overSampling.catchupAndSubscribe(o=>{let a=R$[o.getValue()];this.#l=new Yh(a),this.#u=Wt.linear(sampleRate*a),this.#u.set(Oe(this.parameterDrive.getValue()),this.#a),this.#c=Wt.linear(sampleRate*a),this.#c.set(Oe(this.parameterVolume.getValue()),this.#a),this.#s=a})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){console.debug("reset"),this.#a=!1,this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;this.#l.upsample(this.#o.unwrap().channels(),this.#i,t,i);let n=(i-t)*this.#s,[o,a]=this.#i;for(let s=0;s<n;s++){let l=this.#c.moveAndGet(),u=this.#u.moveAndGet();o[s]=Nx(o[s]*u)*l,a[s]=Nx(a[s]*u)*l}this.#l.downsample(this.#i,this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i),this.#a=!0}parameterChanged(e){e===this.parameterDrive?this.#u.set(Oe(this.parameterDrive.getValue()),this.#a):e===this.parameterVolume&&this.#c.set(Oe(this.parameterVolume.getValue()),this.#a)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Wy=class extends Me{#e;#t;#r=[];#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#i=[];let{midiDevice:i,box:n,parameters:o}=t;this.#n=n.channel.getValue(),this.ownAll(n.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:a})=>this.#i.push(this.bindParameter(o.parameterAt(Be(a,Ci).value.address)))),onRemoved:(({box:a})=>O.removeIf(this.#i,s=>s.address===Be(a,Ci).value.address))}),n.channel.subscribe(a=>{i.ifSome(s=>this.#r.forEach(l=>e.sendMIDIData(s.id.getValue(),it.noteOff(this.#n,l),s.delayInMs.getValue()))),this.#r.length=0,this.#n=a.getValue()}),e.registerProcessor(this)),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock({p0:e,p1:t,s0:i,flags:n,bpm:o}){if(this.#o.isEmpty())return;let{box:{channel:a,device:s}}=this.#e,l=s.targetVertex.match({none:()=>g.None,some:({box:p})=>g.wrap(Be(p,Di))}),u=l.mapOr(p=>p.delayInMs.getValue(),0);for(let p of this.#o.unwrap().processNotes(e,t,n))if(p.pitch>=0&&p.pitch<=127){let d=i/sampleRate,f=Y.pulsesToSeconds(p.position-e,o),v=(d+f)*1e3+u,m=a.getValue();if(ye.isStart(p)){let y=Math.round(p.velocity*127);this.#r.push(p.pitch),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),it.noteOn(m,p.pitch,y),v))}else if(ye.isStop(p)){let y=this.#r.indexOf(p.pitch);y>-1&&this.#r.splice(y,1),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),it.noteOff(m,p.pitch),v))}}}setNoteEventSource(e){return this.#o=g.wrap(e),L.create(()=>this.#o=g.None)}get incoming(){return this}get outgoing(){return this}reset(){}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}get adapter(){return this.#e}handleEvent(e){}processAudio(e,t,i){}parameterChanged(e,t=0){let{box:{channel:i,device:n}}=this.#e;if(n.isEmpty())return;let{id:o,delayInMs:a}=Be(n.targetVertex.unwrap().box,Di),s=t*1e3*a.getValue(),l=Be(e.adapter.field.box,Ci).controller.getValue(),u=Math.round(e.getValue()*127),p=it.control(i.getValue(),l,u);this.context.sendMIDIData(o.getValue(),p,s)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var Zy=class extends Fr{#e;#t;#r;#i=g.None;#n;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.#r=new Int32Array(1024),this.#n=0;let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:l}=t.namedParameter;this.ownAll(this.bindParameter(i),this.bindParameter(n),this.bindParameter(o),this.bindParameter(a),this.bindParameter(s),this.bindParameter(l),e.broadcaster.broadcastIntegers(t.address.append(0),this.#r,()=>{this.#r[this.#n]=0,this.#n=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),L.create(()=>this.#i=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#i.isEmpty())for(let n of this.#i.unwrap().processNotes(e,t,i))if(ye.isStart(n)){this.#t.noteOn(n.pitch);let o=this.#e.computeVelocity(n.position,n.velocity);this.#r[this.#n++]=Math.round(n.velocity*127)|Math.round(o*127)<<8|65536,yield Mr.overwrite(n,{velocity:o})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#i.isEmpty())for(let i of this.#i.unwrap().iterateActiveNotesAt(e,t))i.type==="note-event"&&(yield Mr.overwrite(i,{velocity:this.#e.computeVelocity(i.position,i.velocity)}))}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Gy=class r extends Me{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h=g.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new ve,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=new Kh,this.#o=new $i(.003,sampleRate),this.#a=new $i(.003,sampleRate);let{rate:i,depth:n,slope:o,symmetry:a,offset:s,channelOffset:l}=t.namedParameter;this.#l=this.bindParameter(i),this.#s=this.bindParameter(n),this.#u=this.bindParameter(o),this.#c=this.bindParameter(a),this.#d=this.bindParameter(s),this.#p=this.bindParameter(l),this.ownAll(e.broadcaster.broadcastFloat(t.address.append(0),()=>this.#m),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#m=0,this.#f=!0,this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#h=g.wrap(e),{terminate:()=>this.#h=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:i},n,o){if(this.#h.isEmpty())return;let a=this.#h.unwrap(),[s,l]=a.channels(),[u,p]=this.#r.channels();this.#f&&(this.#n.set(this.#s.getValue(),this.#u.getValue(),this.#c.getValue()),this.#f=!1);let{RateFractions:d}=Yi,f=Y.samplesToPulses(1,t,sampleRate),m=1/er.toPPQN(d[this.#l.getValue()]),y=this.#d.getValue()/360,x=y+this.#p.getValue()/360;for(let F=n;F<o;F++){let D=(e+F*f)*m+y,R=(e+F*f)*m+x;u[F]=s[F]*this.#o.process(this.#n.compute(D-Math.floor(D))),p[F]=l[F]*this.#a.process(this.#n.compute(R-Math.floor(R)))}this.#i.process(u,p),nt.every(i,5)&&(this.#m=(e+(o-n)*f)*m)}parameterChanged(e){(e===this.#s||e===this.#u||e===this.#c)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var qy=class{#e;#t=[];#r;#i;#n;#o=0;#a=0;#l=0;#s=0;#u=0;#c=0;#d=.9999;#p=.75;#h=.625;#f=.5;#m=.7;#w=.5;#b=.005;#A=.5;#N=.7;#B=.3;#P=.6;constructor(e){this.#e=e,this.#n=e+1,this.#r=new Float32Array(this.#n),[.004771345,.003595309,.012734787,.009307483,.022579886,.149625349,.060481839,.1249958,.030509727,.141695508,.089244313,.106280031].forEach(n=>this.#k(n));let i=[.008937872,.099929438,.064278754,.067067639,.066866033,.006283391,.035818689,.011861161,.121870905,.041262054,.08981553,.070931756,.011256342,.004065724];this.#i=Int16Array.from(i,n=>Math.round(n*e))}#k(e){let t=Math.round(e*this.#e),i=2**Math.ceil(Math.log2(t));this.#t.push([new Float32Array(i),t-1,0,i-1])}#g(e,t){return this.#t[e][0][this.#t[e][1]]=t}#v(e){return this.#t[e][0][this.#t[e][2]]}#y(e,t){let i=this.#t[e];return i[0][i[2]+t&i[3]]}#E(e,t){let i=this.#t[e],n=t-~~t,o=~~t+i[2]-1,a=i[3],s=i[0][o++&a],l=i[0][o++&a],u=i[0][o++&a],p=i[0][o&a],d=(3*(l-u)-s+p)*.5,f=2*u+s-(5*l+p)*.5,v=(u-s)*.5;return((d*n+f)*n+v)*n+l}set preDelayMs(e){this.#c=Math.floor(e/1e3*this.#e)}set bandwidth(e){this.#d=e*.9999}set inputDiffusion1(e){this.#p=e}set inputDiffusion2(e){this.#h=e}set decay(e){this.#f=e}set decayDiffusion1(e){this.#m=e*.999999}set decayDiffusion2(e){this.#w=e*.999999}set damping(e){this.#b=e}set excursionRate(e){this.#A=e*2}set excursionDepth(e){this.#N=e*2}set wetGain(e){this.#B=e}set dryGain(e){this.#P=e}reset(){this.#r.fill(0),this.#t.forEach(e=>e[0].fill(0)),this.#o=0,this.#a=0,this.#l=0,this.#s=0,this.#u=0}process(e,t,i,n){let o=this.#c,a=this.#d,s=this.#p,l=this.#h,u=this.#f,p=this.#m,d=this.#w,f=1-this.#b,v=this.#A/this.#e,m=this.#N*this.#e/1e3,y=this.#B*.6,x=this.#P,F=e[0],D=e[1],R=t[0],T=t[1];for(let W=i;W<n;W++){let ne=F[W],se=D[W];this.#r[this.#o]=(ne+se)*.5,R[W]=ne*x,T[W]=se*x;let J=this.#r[(this.#n+this.#o-o)%this.#n];this.#a+=a*(J-this.#a);let fe=this.#g(0,this.#a-s*this.#v(0));fe=this.#g(1,s*(fe-this.#v(1))+this.#v(0)),fe=this.#g(2,s*fe+this.#v(1)-l*this.#v(2)),fe=this.#g(3,l*(fe-this.#v(3))+this.#v(2));let Q=l*fe+this.#v(3),Re=m*(1+Math.cos(this.#u*6.28)),Ie=m*(1+Math.sin(this.#u*6.2847)),ze=this.#g(4,Q+u*this.#v(11)+p*this.#E(4,Re));this.#g(5,this.#E(4,Re)-p*ze),this.#l+=f*(this.#v(5)-this.#l),ze=this.#g(6,u*this.#l-d*this.#v(6)),this.#g(7,this.#v(6)+d*ze),ze=this.#g(8,Q+u*this.#v(7)+p*this.#E(8,Ie)),this.#g(9,this.#E(8,Ie)-p*ze),this.#s+=f*(this.#v(9)-this.#s),ze=this.#g(10,u*this.#s-d*this.#v(10)),this.#g(11,this.#v(10)+d*ze);let Nr=this.#y(9,this.#i[0])+this.#y(9,this.#i[1])-this.#y(10,this.#i[2])+this.#y(11,this.#i[3])-this.#y(5,this.#i[4])-this.#y(6,this.#i[5])-this.#y(7,this.#i[6]),kr=this.#y(5,this.#i[7])+this.#y(5,this.#i[8])-this.#y(6,this.#i[9])+this.#y(7,this.#i[10])-this.#y(9,this.#i[11])-this.#y(10,this.#i[12])-this.#y(11,this.#i[13]);R[W]+=Nr*y,T[W]+=kr*y,this.#u+=v,this.#o=(this.#o+1)%this.#n;for(let Ne=0;Ne<this.#t.length;Ne++){let Ct=this.#t[Ne];Ct[1]=Ct[1]+1&Ct[3],Ct[2]=Ct[2]+1&Ct[3]}}}};var Hy=class r extends Me{static ID=0;#e=r.ID++;#t;parameterPreDelay;parameterBandwidth;parameterInputDiffusion1;parameterInputDiffusion2;parameterDecay;parameterDecayDiffusion1;parameterDecayDiffusion2;parameterDamping;parameterExcursionRate;parameterExcursionDepth;parameterWet;parameterDry;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#i=new ve,this.#n=this.own(new _e(e.broadcaster,t.address)),this.#r=new qy(sampleRate);let{preDelay:i,bandwidth:n,inputDiffusion1:o,inputDiffusion2:a,decay:s,decayDiffusion1:l,decayDiffusion2:u,damping:p,excursionRate:d,excursionDepth:f,wet:v,dry:m}=t.namedParameter;this.parameterPreDelay=this.own(this.bindParameter(i)),this.parameterBandwidth=this.own(this.bindParameter(n)),this.parameterInputDiffusion1=this.own(this.bindParameter(o)),this.parameterInputDiffusion2=this.own(this.bindParameter(a)),this.parameterDecay=this.own(this.bindParameter(s)),this.parameterDecayDiffusion1=this.own(this.bindParameter(l)),this.parameterDecayDiffusion2=this.own(this.bindParameter(u)),this.parameterDamping=this.own(this.bindParameter(p)),this.parameterExcursionRate=this.own(this.bindParameter(d)),this.parameterExcursionDepth=this.own(this.bindParameter(f)),this.parameterWet=this.own(this.bindParameter(v)),this.parameterDry=this.own(this.bindParameter(m)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.reset(),this.#i.clear(),this.#n.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#r.process(n.channels(),this.#i.channels(),t,i),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1),t,i)}parameterChanged(e){e===this.parameterPreDelay?this.#r.preDelayMs=this.parameterPreDelay.getValue():e===this.parameterBandwidth?this.#r.bandwidth=this.parameterBandwidth.getValue():e===this.parameterInputDiffusion1?this.#r.inputDiffusion1=this.parameterInputDiffusion1.getValue():e===this.parameterInputDiffusion2?this.#r.inputDiffusion2=this.parameterInputDiffusion2.getValue():e===this.parameterDecay?this.#r.decay=this.parameterDecay.getValue():e===this.parameterDecayDiffusion1?this.#r.decayDiffusion1=this.parameterDecayDiffusion1.getValue():e===this.parameterDecayDiffusion2?this.#r.decayDiffusion2=this.parameterDecayDiffusion2.getValue():e===this.parameterDamping?this.#r.damping=this.parameterDamping.getValue():e===this.parameterExcursionRate?this.#r.excursionRate=this.parameterExcursionRate.getValue():e===this.parameterExcursionDepth?this.#r.excursionDepth=this.parameterExcursionDepth.getValue():e===this.parameterWet?this.#r.wetGain=Oe(this.parameterWet.getValue()):e===this.parameterDry&&(this.#r.dryGain=Oe(this.parameterDry.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var J_;(e=>e.create=(t,i)=>i.accept({visitAudioBusBox:n=>new yc(t,t.boxAdapters.adapterFor(n,sr)),visitVaporisateurDeviceBox:n=>new dy(t,t.boxAdapters.adapterFor(n,Eu)),visitNanoDeviceBox:n=>new _y(t,t.boxAdapters.adapterFor(n,Nu)),visitTapeDeviceBox:n=>new gy(t,t.boxAdapters.adapterFor(n,Su)),visitPlayfieldDeviceBox:n=>new ky(t,t.boxAdapters.adapterFor(n,aa)),visitSoundfontDeviceBox:n=>new Ty(t,t.boxAdapters.adapterFor(n,Uu)),visitMIDIOutputDeviceBox:n=>new Wy(t,t.boxAdapters.adapterFor(n,qu))}))(J_||={});var Q_;(e=>e.create=(t,i)=>X(i.accept({visitUnknownMidiEffectDeviceBox:n=>new Iy(t,t.boxAdapters.adapterFor(n,Ou)),visitArpeggioDeviceBox:n=>new yy(t,t.boxAdapters.adapterFor(n,Zi)),visitPitchDeviceBox:n=>new xy(t,t.boxAdapters.adapterFor(n,Bu)),visitVelocityDeviceBox:n=>new Zy(t,t.boxAdapters.adapterFor(n,Hu)),visitZeitgeistDeviceBox:n=>new My(t,t.boxAdapters.adapterFor(n,Tu))}),`Could not create midi-effect for'${i.name}'`))(Q_||={});var Nh;(e=>e.create=(t,i)=>X(i.accept({visitUnknownAudioEffectDeviceBox:n=>new Ph(t,t.boxAdapters.adapterFor(n,Ru)),visitStereoToolDeviceBox:n=>new $y(t,t.boxAdapters.adapterFor(n,Du)),visitCompressorDeviceBox:n=>new jy(t,t.boxAdapters.adapterFor(n,ju)),visitDelayDeviceBox:n=>new oy(t,t.boxAdapters.adapterFor(n,li)),visitDattorroReverbDeviceBox:n=>new Hy(t,t.boxAdapters.adapterFor(n,Ju)),visitTidalDeviceBox:n=>new Gy(t,t.boxAdapters.adapterFor(n,Yi)),visitCrusherDeviceBox:n=>new Ly(t,t.boxAdapters.adapterFor(n,Lu)),visitFoldDeviceBox:n=>new Ky(t,t.boxAdapters.adapterFor(n,Wu)),visitReverbDeviceBox:n=>new Ay(t,t.boxAdapters.adapterFor(n,ou)),visitRevampDeviceBox:n=>new wy(t,t.boxAdapters.adapterFor(n,au)),visitModularDeviceBox:n=>new Ph(t,t.boxAdapters.adapterFor(n,ea))}),`Could not create audio-effect for'${i.name}'`))(Nh||={});var Jy=class extends Me{#e;#t;#r;#i;#n;#o;#a=g.None;#l=!0;#s=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=Wt.linear(sampleRate),this.#i=Wt.linear(sampleRate),this.#n=this.own(this.bindParameter(t.sendGain)),this.#o=this.own(this.bindParameter(t.sendPan)),this.own(e.registerProcessor(this)),this.readAllParameters()}reset(){this.#t.clear()}get adapter(){return this.#e}setAudioSource(e){return this.#a=g.wrap(e),{terminate:()=>this.#a=g.None}}get audioOutput(){return this.#t}processAudio(e,t,i){if(this.#a.isEmpty())return;if(this.#l){let u=Oe(this.#n.getValue()),p=this.#o.getValue();this.#r.set((1-Math.max(0,p))*u,this.#s),this.#i.set((1+Math.min(0,p))*u,this.#s),this.#l=!1}let n=this.#t.getChannel(0),o=this.#t.getChannel(1),a=this.#a.unwrap(),s=a.getChannel(0),l=a.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let u=t;u<i;u++)n[u]=s[u]*this.#r.moveAndGet(),o[u]=l[u]*this.#i.moveAndGet();else{let u=this.#r.get(),p=this.#i.get();for(let d=t;d<i;d++)n[d]=s[d]*u,o[d]=l[d]*p}this.#s=!0}parameterChanged(e){this.#l=!0}};var Qy=class extends Me{#e;#t;#r;#i;#n;#o;#a;#l;#s=Wt.linear(sampleRate);#u=Wt.linear(sampleRate);#c=Wt.linear(sampleRate);#d=g.None;#p=!0;#h=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ve,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new _e(e.broadcaster,this.#e.address)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.panning)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.mute)),this.#l=this.own(this.bindParameter(this.#e.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this)),this.readAllParameters()}reset(){this.#i.clear(),this.#t.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#h=!1}get isMute(){return this.#a.getValue()}get isSolo(){return this.#l.getValue()}get adapter(){return this.#e}get audioOutput(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#d.isEmpty())return;if(this.#p){let d=this.context.mixer;d.updateSolo();let f=this.isSolo||d.isVirtualSolo(this),v=this.isMute||d.hasChannelSolo()&&!f&&!this.#e.isOutput,m=Oe(this.#n.getValue()),y=this.#o.getValue();this.#s.set((1-Math.max(0,y))*m,this.#h),this.#u.set((1+Math.min(0,y))*m,this.#h),this.#c.set(v?0:1,this.#h),this.#p=!1}let n=this.#d.unwrap(),[o,a]=n.channels(),[s,l]=this.#t.channels(),[u,p]=this.#r;if(this.#s.isInterpolating()||this.#u.isInterpolating()||this.#c.isInterpolating())for(let d=t;d<i;d++){let f=this.#c.moveAndGet(),v=o[d]*this.#s.moveAndGet(),m=a[d]*this.#u.moveAndGet();s[d]=v*f,l[d]=m*f,u[d]=v,p[d]=m}else{let d=this.#s.get(),f=this.#u.get(),v=this.#c.get();for(let m=t;m<i;m++){let y=o[m]*d,x=a[m]*f;u[m]=y,p[m]=x,s[m]=y*v,l[m]=x*v}}this.#i.process(u,p,t,i),this.#h=!0}finishProcess(){this.#t.assertSanity()}parameterChanged(e){e===this.#n?this.requestGainUpdate():e===this.#o?this.requestGainUpdate():e===this.#a?this.requestGainUpdate():e===this.#l&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#p=!0}requestSoloUpdate(){this.#p=!0}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}toString(){return`{${this.constructor.name}}`}};var Yy=class{#e=new z;#t;#r;#i;#n;#o;#a;#l=[];#s=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=A.newSet(i=>i.adapter.uuid),this.#n=this.#e.own(new Qy(this.#t.context,this.#t.adapter)),this.#o=A.newSet(({device:i})=>i.uuid),this.#a=this.#e.own(new z),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=Nh.create(this.#t.context,i.box),o=this.#o.add({device:n,subscription:n.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(o,"Could not add.")},onRemove:i=>{this.invalidateWiring();let{device:n,subscription:o}=this.#o.removeByKey(i.uuid);o.terminate(),n.terminate()},onReorder:i=>this.invalidateWiring()}),this.#t.adapter.auxSends.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=this.#i.add(new Jy(this.#t.context,i));I(n,"Could not add.")},onRemove:({uuid:i})=>{this.invalidateWiring(),this.#i.removeByKey(i).terminate()},onReorder:i=>{}}),this.#t.adapter.output.catchupAndSubscribe(i=>this.invalidateWiring()),this.#t.context.subscribeProcessPhase(i=>{i===0&&this.#s&&(this.#u(),this.#s=!1)}))}get channelStrip(){return this.#n}invalidateWiring(){this.#a.terminate(),this.#s=!0}terminate(){this.#e.terminate(),this.#o.forEach(({device:e})=>e.terminate()),this.#o.clear(),this.#l=[]}toString(){return`{${this.constructor.name}}`}#u(){let e=this.#t.adapter.isOutput,t=this.#t.context,i=this.#t.input(),n=this.#t.adapter.output.adapter.map(a=>t.getAudioUnit(a.deviceHost().uuid).inputAsAudioBus());if(i.isEmpty()||n.isEmpty()&&!e)return;let o=i.unwrap();if(this.#r.includeAudioEffects){O.replace(this.#l,this.#t.adapter.audioEffects.adapters().map(({uuid:a})=>this.#o.get(a).device));for(let a of this.#l)a.adapter().enabledField.getValue()&&(this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a.incoming)),o=a)}if(this.#r.includeSends&&this.#i.forEach(a=>{let s=t.getAudioUnit(a.adapter.targetBus.deviceHost().uuid);this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(s.inputAsAudioBus().addAudioSource(a.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a)),this.#a.own(t.registerEdge(a,s.inputAsAudioBus()))}),this.#a.own(this.#n.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,this.#n)),n.nonEmpty()&&!e){let a=n.unwrap();this.#a.own(a.addAudioSource(this.#n.audioOutput)),this.#a.own(t.registerEdge(this.#n,a))}}};var Xy=class{#e=new z;#t;#r;#i;#n;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=qs.create(268431651),this.#n=new Set,this.#o=new el,this.#e.ownAll(this.#t.subscribeProcessPhase(i=>{if(i===1)for(let n of this.#n)n.gate||this.#n.delete(n)}))}get uuid(){return this.#r.uuid}terminate(){this.#e.terminate()}pushRawNoteOn(e,t){this.#n.add({pitch:e,velocity:t,gate:!0,running:g.None})}pushRawNoteOff(e){for(let t of this.#n)if(t.running.isEmpty())this.#n.delete(t);else if(t.pitch===e){t.gate=!1;return}}*processNotes(e,t,i){let n=nt.every(i,5);if(this.#o.nonEmpty()&&(!n||nt.every(i,2)?yield*this.#u(e):yield*this.#c(e,t)),this.#n.size>0)for(let o of this.#n){if(o.running.isEmpty()){let{pitch:a,velocity:s}=o,l=Number.POSITIVE_INFINITY,u=ye.start(e,l,a,s);o.running=g.wrap(u),yield u}o.gate||(this.#n.delete(o),yield ye.stop(o.running.unwrap("raw note never started"),e))}if(n){let o=this.#r.tracks.collection.adapters().filter(a=>a.type===re.Notes&&a.enabled.getValue());for(let a of o)for(let{optClip:s,sectionFrom:l,sectionTo:u}of this.#t.clipSequencing.iterate(a.uuid,e,t))s.isEmpty()?yield*this.#l(a,l,u):yield*this.#a(s.unwrap(),l,u);yield*this.#c(e,t)}}*iterateActiveNotesAt(e,t){if(this.#n.size>0)for(let{pitch:i,velocity:n}of this.#n)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:i,velocity:n,cent:0};t||(yield*this.#o.overlapping(e,tr.Comparator))}reset(){this.#o.clear(),this.#n.clear()}toString(){return`{${this.constructor.name}}`}*#a(e,t,i){if(e.optCollection.isEmpty())return;let n=e.optCollection.unwrap(),o=e.duration,a=On(t,o),s=a+o;i>s?(yield*this.#s(n,t,s,a),yield*this.#s(n,s,i,s)):yield*this.#s(n,t,i,a)}*#l(e,t,i){for(let n of e.regions.collection.iterateRange(t,i)){if(this.#t.ignoresRegion(n.address.uuid)||n.mute||!De(n,jo))continue;let o=n.optCollection;if(o.isEmpty())continue;let a=o.unwrap();for(let{resultStart:s,resultEnd:l,rawStart:u}of Kt.locateLoops(n,t,i))yield*this.#s(a,s,l,u)}}*#s(e,t,i,n){let o=t-n,a=i-n;for(let s of e.events.iterateRange(o-e.maxDuration,a)){if(!tr.isOfType(s))continue;let{position:l,duration:u,chance:p,playCount:d,playCurve:f}=s;if(!(p<100&&this.#i.nextDouble(0,100)>p)){if(d>1){let v=tr.inverseCurveFunc((o-l)/u,f),m=tr.inverseCurveFunc((a-l)/u,f),y=Math.floor(v*d),x=y/d;for(;x<m;){if(x>=v){let F=tr.curveFunc(x,f)*u;if(F>=u)break;let D=tr.curveFunc(x+1/d,f)*u,R=ye.startWith(s,l+F+n,D-F);this.#o.addAndRetain({...R}),yield R}x=++y/d}}else if(o<=l&&l<a){let v=ye.startWith(s,l+n);this.#o.addAndRetain({...v}),yield v}}}}*#u(e){for(let t of this.#o.releaseAll())yield ye.stop(t,e)}*#c(e,t){for(let i of this.#o.releaseLinearCompleted(t)){let n=ce(i.position+i.duration,e,t);yield ye.stop(i,n)}}};var ex=class{#e=new z;#t;#r;#i;#n;#o=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new Xy(this.#t.context,this.#t.adapter)),this.#i=A.newSet(({device:t})=>t.uuid),this.#n=this.#e.own(new z),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let i=Q_.create(this.#t.context,t.box),n=this.#i.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(n,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:i,subscription:n}=this.#i.removeByKey(t.uuid);n.terminate(),i.terminate()},onReorder:t=>this.invalidateWiring()}),this.#t.context.subscribeProcessPhase(t=>{t===0&&this.#o&&(this.#a(),this.#o=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#n.terminate(),this.#o=!0}terminate(){this.#e.terminate()}toString(){return`{${this.constructor.name}}`}#a(){let e=this.#t.input().flatMap(n=>n.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),i=this.#r;this.#t.adapter.midiEffects.adapters().map(n=>this.#i.get(n.uuid).device).forEach(n=>{n.adapter().enabledField.getValue()&&(this.#n.ownAll(n.setNoteEventSource(i),this.#t.context.registerEdge(n,t.incoming)),i=n)}),this.#n.own(t.setNoteEventSource(i))}};var tx=class r{static ID=0;#e=r.ID++;#t=new z;#r;#i;#n;#o;#a=g.None;constructor(e,t,i){this.#r=e,this.#i=t,this.#n=this.#t.own(new ex(this)),this.#o=this.#t.own(new Yy(this,i)),this.#t.ownAll(this.#i.input.catchupAndSubscribe(n=>{this.#n.invalidateWiring(),this.#o.invalidateWiring(),this.#a.ifSome(o=>o.terminate()),this.#a=n.getValue().flatMap(o=>g.wrap(J_.create(e,o.box.box)))}))}input(){return this.#a}inputAsAudioBus(){return Be(this.#a.unwrap("No input available"),yc)}audioOutput(){return this.#o.channelStrip.audioOutput}get midiDeviceChain(){return this.#n}get audioDeviceChain(){return this.#o}get context(){return this.#r}get adapter(){return this.#i}terminate(){console.debug(`terminate ${this}`),this.#t.terminate(),this.#a.ifSome(e=>e.terminate()),this.#a=g.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var rx=class{#e;#t;#r;#i=!1;constructor(){this.#e=A.newSet(e=>e.adapter.uuid),this.#t=new Set,this.#r=new Set}attachChannelStrip(e){return this.#e.add(e),L.many(e.adapter.input.subscribe(()=>this.#n()),e.adapter.output.subscribe(()=>this.#n()),{terminate:()=>{this.#t.delete(e),this.#e.removeByValue(e),this.#n()}})}onChannelStripSoloChanged(e){e.isSolo?this.#t.add(e):this.#t.delete(e),this.#n()}hasChannelSolo(){return this.#t.size>0}isVirtualSolo(e){return this.#r.has(e)}#n(){this.#i||(this.#i=!0,this.#e.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=i=>{e.has(i)||(e.add(i),i.adapter.input.getValue().ifSome(n=>{n.type==="bus"&&n.box.input.pointerHub.filter(c.AudioOutput).map(o=>X(o.box.accept({visitAudioUnitBox:({address:{uuid:a}})=>this.#e.get(a),visitAuxSendBox:({audioUnit:{targetVertex:a}})=>this.#e.get(a.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(o=>{o.isSolo||this.#r.add(o),t(o)})}))};this.#e.forEach(i=>{i.isSolo&&t(i)}),this.#i=!1}};var ba;(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"})(ba||(ba={}));var $h;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})($h||($h={}));var bc;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(bc||(bc={}));var ix=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Et.create(0);#o=g.None;#a=g.None;#l=-1;#s=-1;#u=!1;#c=!1;constructor(e){this.#i=jn.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(i){t(this.sendShareLock,i)}sendUpdateData(i){t(this.sendUpdateData,i)}sendUpdateStructure(i){t(this.sendUpdateStructure,i)}})}flush(){let e=this.#d();if(e.nonEmpty()){this.#c||(this.#i.sendShareLock(this.#t),this.#c=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#p();if(this.#n.remaining<t){let i=fo(t),n=new SharedArrayBuffer(i);this.#n=Et.use(n),this.#o=g.wrap(n),this.#i.sendUpdateData(n)}}this.#o.isEmpty()||Atomics.load(this.#r,0)===$h.WRITE&&(this.#h(this.#n),this.#n.position=0,Atomics.store(this.#r,0,$h.READ))}broadcastFloat(e,t){return this.#m(new class{type=ba.Float;address=e;capacity=8;put(i){i.writeFloat(t())}})}broadcastInteger(e,t){return this.#m(new class{type=ba.Integer;address=e;capacity=8;put(i){i.writeInt(t())}})}broadcastFloats(e,t,i,n){return this.#m(new class{type=ba.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(o){_(i),o.writeInt(t.length);for(let a of t)o.writeFloat(a);_(n)}})}broadcastIntegers(e,t,i){return this.#m(new class{type=ba.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(n){i(),n.writeInt(t.length),t.forEach(o=>n.writeInt(o))}})}broadcastByteArray(e,t,i){return this.#m(new class{type=ba.ByteArray;address=e;capacity=4+t.byteLength;put(n){i(),n.writeInt(t.byteLength),n.writeBytes(t)}})}#d(){if(this.#u){try{this.#a=g.wrap(this.#b())}catch(e){throw e}this.#u=!1}if(this.#a.nonEmpty()){let e=this.#a;return this.#a=g.None,e}return g.None}#p(){return this.#s===-1&&(this.#s=this.#f()+12),this.#s}terminate(){O.clear(this.#e),this.#a=g.None,this.#u=!1,this.#s=0}#h(e){I(!this.#u&&this.#a.isEmpty(),"Cannot flush while update is available");let t=this.#p();I(e.remaining>=t,"Insufficient data"),e.writeInt(this.#l),e.writeInt(bc.START);for(let i of this.#e)i.put(e);e.writeInt(bc.END)}#f(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#m(e){return this.#e.push(e),this.#w(),{terminate:()=>{O.removeOpt(this.#e,e),this.#w()}}}#w(){this.#s=-1,this.#u=!0}#b(){let e=Et.create();e.writeInt(bc.ID),e.writeInt(++this.#l),e.writeInt(this.#e.length);for(let{address:t,type:i}of this.#e)t.write(e),e.writeByte(i);return e.toArrayBuffer()}};var nx=class{#e;#t;#r=new ve;#i=[];constructor(e,t){this.#e=e,this.#t=t}process({blocks:e}){e.forEach(({p0:t,p1:i,bpm:n,s0:o,s1:a,flags:s})=>{if(this.#t.metronomeEnabled&&nt.every(s,1)){let[l,u]=this.#e.signature,p=Y.fromSignature(1,u);for(let d of rn.iterate(t,i,p)){I(t<=d&&d<i,()=>`${d} out of bounds (${t}, ${i})`);let f=Math.floor(Y.pulsesToSamples(d-t,n,sampleRate));this.#i.push(new Y_(d,o+f,l,u))}}this.#r.clear(o,a);for(let l=this.#i.length-1;l>=0;l--)this.#i[l].processAdd(this.#r,o,a)&&this.#i.splice(l,1)})}get output(){return this.#r}},Y_=class{#e;#t=0;#r=0;constructor(e,t,i,n){I(t>=0&&t<128,`${t} out of bounds`),this.#e=Y.toParts(e,i,n).beats===0?880:440,this.#r=t}processAdd(e,t,i){let[n,o]=e.channels(),a=Math.floor(.002*sampleRate),s=Math.floor(.05*sampleRate);for(let l=Math.max(this.#r,t);l<i;l++){let u=Math.min(this.#t/a,1-(this.#t-a)/s),p=Math.sin(this.#t/sampleRate*ki*this.#e)*.25*u*u;if(n[l]+=p,o[l]+=p,++this.#t>a+s)return!0}return this.#r=0,!1}};var ox=class{#e;#t;#r=!0;#i=!1;#n=null;#o=!1;#a=0;constructor(e,t){this.#e=e,this.#e.timelineBoxAdapter.markerTrack.subscribe(()=>this.#o=!0),this.#e.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#t=new Gs}setCallback(e,t){return this.#t.add(e,t),L.create(()=>this.#t.remove(e,t))}reset(){this.#i=!1,this.#o=!1,this.#a=0,this.#n=null}process(e){let t=!1,{timeInfo:i,timelineBoxAdapter:{box:n,markerTrack:o}}=this.#e,a=n.bpm.getValue(),s=i.transporting;if(s){let l=[],u=i.position,p=0,d=0,f=i.getLeapStateAndReset();for(;p<128;){if(this.#o||f){this.#o=!1;let J=o.events.lowerEqual(u);(this.#n?.at(0)??null)!==J&&(this.#n=Z(J)?[J,0]:null,t=!0)}let v=128-p,m=u+Y.samplesToPulses(v,a,sampleRate),y=null,x=Number.POSITIVE_INFINITY;if(o.enabled){let J=Array.from(Je.take(o.events.iterateFrom(u),2));if(J.length>0){let[fe,Q]=J;this.#n===null?fe.position>=u&&fe.position<m&&(y={type:"marker",prev:fe,next:Q},x=fe.position):Z(Q)&&Q!==this.#n[0]&&fe.position<u&&Q.position<m&&(y={type:"marker",prev:fe,next:Q},x=Q.position)}}let{isRecording:F,isCountingIn:D}=this.#e.timeInfo,{from:R,to:T,enabled:W}=n.loopArea;if(W.getValue()&&!(F||D)||this.#r){let J=T.getValue();u<J&&m>J&&J<x&&(y={type:"loop",target:R.getValue()},x=J)}if(this.#t.keyCount()>0)for(let J of this.#t.keys())u<J&&m>J&&J<x&&(y={type:"callback",position:J,callbacks:this.#t.get(J)},x=J);let se=!i.isCountingIn;if(y===null){let J=p+v;l.push({index:d++,p0:u,p1:m,s0:p,s1:J,bpm:a,flags:gc.create(s,f,se,this.#i)}),f=!1,u=m,p=J}else{let J=()=>{if(x>u){let Q=p+Y.pulsesToSamples(x-u,a,sampleRate)|0;Q>p&&(l.push({index:d++,p0:u,p1:x,s0:p,s1:Q,bpm:a,flags:gc.create(s,f,se,this.#i)}),f=!1),u=x,p=Q}},fe=()=>{if(p<128){let Q=p+Y.pulsesToSamples(m-u,a,sampleRate)|0;l.push({index:d++,p0:u,p1:x,s0:p,s1:Q,bpm:a,flags:gc.create(!1,!1,!1,this.#i)}),p=Q}};switch(y.type){case"loop":{J(),this.#r?(this.#e.timeInfo.pause(),fe()):(u=y.target,f=!0);break}case"marker":{let{prev:Q,next:Re}=y;!Z(this.#n)||this.#n[0]!==Q?this.#n=[Q,0]:++this.#n[1]<Q.plays||Q.plays===0?(J(),u=Q.position,f=!0):this.#n=[Re,0],t=!0;break}case"callback":{J(),y.callbacks.forEach(Q=>Q());break}}}this.#i=!1}e({blocks:l}),i.advanceTo(u),this.#a=u}else{if(this.#o||i.getLeapStateAndReset()){this.#o=!1;let d=o.events.lowerEqual(i.position);d!==null&&this.#n?.at(0)!==d&&(this.#n=[d,0],t=!0)}let l=this.#a,u=l+Y.samplesToPulses(128,a,sampleRate),p={blocks:[{index:0,p0:l,p1:u,s0:0,s1:128,bpm:a,flags:gc.create(!1,!1,!1,!1)}]};e(p),this.#a=u}t&&this.#e.engineToClient.switchMarkerState(Z(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}};var X_=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get data(){return this.#t}get state(){return this.#e}subscribe(e){return L.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},ax=class{#e;#t;constructor(e){this.#e=e,this.#t=A.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#t.getOrCreate(e,t=>new X_(t,this.#e))}remove(e){}invalidate(e){}};var sx=class{constructor(e){this.uuid=e}waiting=g.None;playing=g.None},lx=class{#e;#t;#r=[];#i=[];#n=[];constructor(e){this.#e=e,this.#e.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let i=t.uuid;this.#t.opt(i).ifSome(n=>{n.playing.ifSome(o=>this.#a(o.uuid)),n.playing=g.None,n.waiting=g.None}),this.#t.forEach(n=>{n.playing.nonEmpty()&&A.equals(n.playing.unwrap().uuid,i)&&(n.playing=g.None,this.#a(i));let o=n.waiting.flatMap(Sc);o.nonEmpty()&&A.equals(o.unwrap().uuid,i)&&(n.waiting=g.None)})}}}),this.#t=A.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let i=this.#t.getOrCreate(t,o=>new sx(o));if(i.playing.nonEmpty()&&i.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let n=i.waiting.flatMap(o=>o);n.nonEmpty()&&(console.debug("obsolete",n.unwrap()),this.#n.push(n.unwrap().uuid),i.waiting=g.None),console.debug(`schedulePlay(${A.toString(i.uuid)} > ${e})`),O.removeOpt(this.#n,e.uuid),i.waiting=g.wrap(g.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,n=>new sx(n)),i=t.waiting.flatMap(n=>n);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#n.push(i.unwrap().uuid),t.waiting=g.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${A.toString(e)})`),t.waiting=g.wrap(g.None))}reset(){this.#t.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(i=>this.#n.push(i.uuid))),e.waiting=g.None,e.playing.ifSome(t=>this.#a(t.uuid)),e.playing=g.None}),this.#t.clear()}*iterate(e,t,i){let n=this.#t.getOrNull(e);if(n===null){yield{optClip:g.None,sectionFrom:t,sectionTo:i};return}if(n.waiting.nonEmpty()){let o=n.waiting.unwrap(),a=n.playing.mapOr(l=>l.duration,Y.Bar),s=On(i,a);s>=t?(t<s&&(yield{optClip:n.playing,sectionFrom:t,sectionTo:s}),n.waiting=g.None,n.playing.ifSome(l=>this.#a(l.uuid)),o.nonEmpty()?(n.playing=o,this.#o(o.unwrap().uuid)):n.playing=g.None,yield{optClip:n.playing,sectionFrom:s,sectionTo:i}):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}else if(n.playing.nonEmpty()){let o=n.playing.unwrap();if(o.box.triggerMode.loop.getValue())yield{optClip:n.playing,sectionFrom:t,sectionTo:i};else{let a=On(t,o.duration)+o.duration;a<=i?(yield{optClip:n.playing,sectionFrom:t,sectionTo:a},n.playing=g.None,this.#a(o.uuid),a<i&&(yield{optClip:g.None,sectionFrom:a,sectionTo:i})):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}}else yield{optClip:g.None,sectionFrom:t,sectionTo:i}}changes(){if(this.#r.length>0||this.#i.length>0||this.#n.length>0){let e=g.wrap({started:this.#r.slice(),stopped:this.#i.slice(),obsolete:this.#n.slice()});return this.#r.length=0,this.#i.length=0,this.#n.length=0,e}return g.None}terminate(){this.#t.clear(),this.#r.length=0,this.#i.length=0,this.#n.length=0}#o(e){this.#r.push(e)}#a(e){this.#i.push(e)}};var eP;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(eP||={});var tP=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get soundfont(){return this.#t}get state(){return this.#e}subscribe(e){return L.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},ux=class{#e;#t;constructor(e){this.#e=e,this.#t=A.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new tP(t,this.#e))}remove(e){}invalidate(e){}};var cx=class r extends Yt{static ClockRate=Y.fromSignature(1,96);#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=[],this.own(this.context.registerProcessor(this))}schedule(e){this.#t.push(e)}reset(){this.eventInput.clear()}process({blocks:e}){let t=this.#e.midiOutputDevices;if(t.length===0){this.#t.length=0;return}let i=t.filter(n=>n.sendTransportMessages.getValue()&&n.id.getValue()!=="");if(i.length===0){this.#t.length=0;return}i.forEach(n=>{let o=n.id.getValue(),a=n.delayInMs.getValue();this.#t.forEach(s=>this.context.sendMIDIData(o,s,a)),this.#t.length=0}),e.forEach(({p0:n,p1:o,s0:a,bpm:s,flags:l})=>{let u=a/sampleRate;if(nt.every(l,1))for(let p of rn.iterate(n,o,r.ClockRate)){let d=Y.pulsesToSeconds(p-n,s);i.forEach(f=>{let v=f.id.getValue(),m=f.delayInMs.getValue(),y=(u+d)*1e3+m;this.context.sendMIDIData(v,it.Clock,y)})}})}toString(){return`{${this.constructor.name}}`}};var dx=class{#e;#t;#r;#i;#n=new Map;#o=[];constructor(e,t){this.#e=e,this.#t=new Uint32Array(t,0,2),this.#r=new Uint32Array(t,8),this.#i=(this.#r.length>>1)-1}send(e,t,i){let n=this.#n.get(e);if(Ks(n)){if(n=this.#o.length,n>=64)return console.error(`Too many MIDI devices: ${n}, max is 64`),!1;this.#n.set(e,n),this.#o.push(e),this.#e.postMessage({registerDevice:e,id:n})}let o=Atomics.load(this.#t,0),a=o+1&this.#i;if(a===Atomics.load(this.#t,1))return!1;let s=t.length,l=t[0]??0,u=t[1]??0,p=t[2]??0,d=s<<30|n<<24|l<<16|u<<8|p,f=i|0,v=o<<1;return this.#r[v]=d,this.#r[v+1]=f,Atomics.store(this.#t,0,a),this.#e.postMessage(null),!0}};var O$=!1,px=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#w;#b;#A;#N;#B;#P;#k;#g;#v;#y;#E;#F;#S;#_=g.None;#$=g.None;#M=g.None;#D=g.None;#C=!1;#R=!0;#T=!1;#O=0;#I=0;#V=!0;#z=1;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:i,exportConfiguration:n,options:o}}){super();let{boxGraph:a,mandatoryBoxes:{rootBox:s,timelineBox:l}}=pa.decode(i);this.#e=new z,this.#t=wP.for(this.port),this.#r=a,this.#i=new cf,this.#E=new Int32Array(t),this.#n=jn.sender(this.#t.channel("engine-to-client"),d=>new class{log(f){d.dispatchAndForget(this.log,f)}error(f){d.dispatchAndForget(this.error,f)}fetchAudio(f){return d.dispatchAndReturn(this.fetchAudio,f)}fetchSoundfont(f){return d.dispatchAndReturn(this.fetchSoundfont,f)}notifyClipSequenceChanges(f){d.dispatchAndForget(this.notifyClipSequenceChanges,f)}switchMarkerState(f){d.dispatchAndForget(this.switchMarkerState,f)}ready(){d.dispatchAndForget(this.ready)}}),this.#a=new ax(this.#n),this.#l=new ux(this.#n),this.#s=A.newSet(d=>d.adapter.uuid),this.#p=new Lg,this.#d=new ef(l.bpm),this.#o=this.#e.own(new Og(this)),this.#u=this.#o.adapterFor(s,Pu),this.#c=this.#o.adapterFor(l,Pn),this.#h=new Zh,this.#f=new Gh(this.#h),this.#m=new te,this.#w=new rx,this.#k=new nx(this.#c,this.#i),this.#g=new cx(this,this.#u),this.#v=new ox(this,o),this.#S=A.newSet(d=>d),this.#y=Qs.writer(v1(),e,d=>{let{transporting:f,isCountingIn:v,isRecording:m,position:y}=this.#i,x=this.#c.box.signature.denominator.getValue();d.position=y,d.playbackTimestamp=this.#I,d.countInBeatsRemaining=v?(this.#O-y)/Y.fromSignature(1,x):0,d.isPlaying=f,d.isRecording=m,d.isCountingIn=v}),this.#b=this.#e.own(ix.create(this.#t,"engine-live-data")),this.#N=new iy(this),this.#B=this.#e.own(new _e(this.#b,Qu.PEAKS)),this.#P=new Ls;let u=new Float32Array(this.#P.numBins()),p=new Float32Array(this.#P.numBins());this.#e.own(this.#b.broadcastFloats(Qu.SPECTRUM,u,()=>{u.set(this.#P.bins()),this.#P.decay=!0})),this.#e.own(this.#b.broadcastFloats(Qu.WAVEFORM,p,()=>p.set(this.#P.waveform()))),this.#A=this.#e.own(new lx(this.#r)),this.#e.ownAll(bP(this.#r,this.#t.channel("engine-sync")),jn.executor(this.#t.channel("engine-commands"),{play:()=>this.#U(),stop:d=>this.#j(d),setPosition:d=>this.#L(d),prepareRecordingState:d=>this.#K(d),stopRecording:()=>this.#W(),setMetronomeEnabled:d=>this.#i.metronomeEnabled=this.#T=d,setPlaybackTimestampEnabled:d=>this.#V=d,setCountInBarsTotal:d=>this.#z=d,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(d=>d.accept({visitAudioFileBox:f=>this.#a.getOrCreate(f.address.uuid).data.nonEmpty()&&f.pointerHub.nonEmpty()})??!0)),panic:()=>this.#C=!0,noteSignal:d=>{if(ca.isOn(d)){let{uuid:f,pitch:v,velocity:m}=d;this.optAudioUnit(f).ifSome(y=>y.midiDeviceChain.noteSequencer.pushRawNoteOn(v,m))}else if(ca.isOff(d)){let{uuid:f,pitch:v}=d;this.optAudioUnit(f).ifSome(m=>m.midiDeviceChain.noteSequencer.pushRawNoteOff(v))}},ignoreNoteRegion:d=>this.#S.add(d),scheduleClipPlay:d=>{d.forEach(f=>{let v=this.#r.findBox(f);if(v.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${A.toString(f)}'`);else{let m=mm.for(this.#o,v.unwrap());this.#A.schedulePlay(m)}}),this.#i.transporting=!0,this.#g.schedule(it.Start)},scheduleClipStop:d=>{d.forEach(f=>{let v=this.#r.findBox(f);v.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${A.toString(f)}'`):this.#A.scheduleStop(this.#o.adapterFor(v.unwrap(),pt))})},setupMIDI:(d,f)=>{this.#D=g.wrap(new dx(d,f))},terminate:()=>{this.#M.ifSome(d=>d.terminate()),this.#M=g.None,this.#R=!1,this.#S.clear(),this.#e.terminate()}}),this.#u.audioUnits.catchupAndSubscribe({onAdd:d=>{let f=A.toString(d.uuid),v=Z(n?.[f])?n[f]:eP.Default,m=new tx(this,d,v),y=this.#s.add(m);if(I(y,`Could not add ${m}`),m.adapter.isOutput){I(this.#$.isEmpty(),"Output can only assigned once."),this.#$=g.wrap(m);return}},onRemove:({uuid:d})=>this.#s.removeByKey(d).terminate(),onReorder:Ni})),this.#F=g.wrap(n).match({none:()=>O.empty(),some:d=>Object.keys(d).map(f=>this.#s.get(A.parse(f)))}),this.#n.ready(),console.log=(...d)=>this.#n.log(d.join(", "))}ignoresRegion(e){return this.#S.hasKey(e)}process(e,t){if(!this.#R)return!1;if(Atomics.load(this.#E,0)===1)return!0;try{return this.render(e,t)}catch(i){return console.debug(i),this.#R=!1,this.#n.error(i),this.terminate(),!1}}render(e,[t]){if(!this.#R)return!1;if(this.#C)return N("Manual Panic");let i=this.#i.metronomeEnabled;this.#m.notify(0),this.#_.isEmpty()&&(this.#f.update(),this.#_=g.wrap(this.#f.sorted().concat()),O$&&console.debug(`%cAudio-Graph%c
|
|
26
|
+
${this.#_.unwrap().map((o,a)=>`${a+1}: ${o}`).join(`
|
|
27
|
+
`)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let n=this.#_.unwrap();return this.#v.process(o=>{n.forEach(a=>a.process(o)),i&&this.#k.process(o)}),this.#F.length===0?(this.#$.unwrap().audioOutput().replaceInto(t),i&&this.#k.output.mixInto(t),this.#B.process(t[0],t[1]),this.#P.process(t[0],t[1],0,128)):this.#F.forEach((o,a)=>{let[s,l]=o.audioOutput().channels();t[a*2].set(s),t[a*2+1].set(l)}),this.#m.notify(1),this.#A.changes().ifSome(o=>this.#n.notifyClipSequenceChanges(o)),this.#y.tryWrite(),this.#b.flush(),!0}getAudioUnit(e){return this.#s.get(e)}optAudioUnit(e){return this.#s.opt(e)}subscribeProcessPhase(e){return this.#m.subscribe(e)}registerProcessor(e){return this.#h.addVertex(e),this.#_=g.None,{terminate:()=>{this.#h.removeVertex(e),this.#_=g.None}}}registerEdge(e,t){return this.#h.addEdge([e,t]),this.#_=g.None,{terminate:()=>{this.#h.removeEdge([e,t]),this.#_=g.None}}}get boxGraph(){return this.#r}get boxAdapters(){return this.#o}get sampleManager(){return this.#a}get soundfontManager(){return this.#l}get rootBoxAdapter(){return this.#u}get timelineBoxAdapter(){return this.#c}get signatureDuration(){return this.timelineBoxAdapter.signatureDuration}get tempoMap(){return this.#d}get liveStreamBroadcaster(){return this.#b}get liveStreamReceiver(){return N("Only available in main thread")}get parameterFieldAdapters(){return this.#p}get clipSequencing(){return this.#A}get broadcaster(){return this.#b}get updateClock(){return this.#N}get timeInfo(){return this.#i}get mixer(){return this.#w}get engineToClient(){return this.#n}get isMainThread(){return!1}get isAudioContext(){return!0}sendMIDIData(e,t,i){this.#D.ifSome(n=>n.send(e,t,i))}terminate(){console.trace(`terminate: ${this}`),this.#e.terminate(),this.#s.forEach(e=>e.terminate()),this.#s.clear()}#U(){this.#V&&(this.#i.position=this.#I,this.#g.schedule(it.positionInPPQN(this.#i.position))),this.#i.transporting=!0,this.#g.schedule(it.Start)}#j(e){(this.#i.isRecording||this.#i.isCountingIn)&&(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.position=this.#V?this.#I:0,this.#g.schedule(it.positionInPPQN(this.#i.position)));let t=this.#i.transporting;this.#i.transporting=!1,this.#i.metronomeEnabled=this.#T,this.#S.clear(),(e||!t)&&this.#Z(),this.#g.schedule(it.Stop)}#L(e){this.#i.isRecording||(this.#i.position=this.#I=e,this.#g.schedule(it.positionInPPQN(this.#i.position)))}#K(e){if(!(this.#i.isRecording||this.#i.isCountingIn))if(!this.#i.transporting&&e){let t=this.#i.position,[i,n]=this.#c.signature;this.#O=On(t,Y.fromSignature(i,n)),this.#i.isCountingIn=!0,this.#i.metronomeEnabled=!0,this.#i.transporting=!0,this.#i.position=this.#O-Y.fromSignature(this.#z*i,n);let o=this.#v.setCallback(this.#O,()=>{this.#i.isCountingIn=!1,this.#i.isRecording=!0,this.#i.metronomeEnabled=this.#T,o.terminate()});this.#g.schedule(it.positionInPPQN(this.#i.position))}else this.#i.transporting=!0,this.#i.isRecording=!0,this.#g.schedule(it.Start)}#W(){!this.#i.isRecording&&!this.#i.isCountingIn||(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#T,this.#i.transporting=!1,this.#S.clear(),this.#g.schedule(it.Stop))}#Z(){this.#I=0,this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#T,this.#i.position=0,this.#i.transporting=!1,this.#v.reset(),this.#A.reset(),this.#f.sorted().forEach(e=>e.reset()),this.#B.clear()}};var hx=class extends AudioWorkletProcessor{#e;constructor({processorOptions:e}){super(),this.#e=Wg.writer(e)}process(e){return this.#e.write(e[0]),!0}};registerProcessor("meter-processor",nf);registerProcessor("engine-processor",px);registerProcessor("recording-processor",hx);
|
|
30
28
|
//# sourceMappingURL=processors.js.map
|