@opendaw/studio-core-wasm 0.0.2
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/WasmEngine.d.ts +14 -0
- package/dist/WasmEngine.d.ts.map +1 -0
- package/dist/WasmEngine.js +152 -0
- package/dist/boot.d.ts +14 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +91 -0
- package/dist/device-linker.d.ts +47 -0
- package/dist/device-linker.d.ts.map +1 -0
- package/dist/device-linker.js +109 -0
- package/dist/engine-exports.d.ts +86 -0
- package/dist/engine-exports.d.ts.map +1 -0
- package/dist/engine-exports.js +13 -0
- package/dist/engine-modules.d.ts +26 -0
- package/dist/engine-modules.d.ts.map +1 -0
- package/dist/engine-modules.js +62 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/nam-bridge.d.ts +7 -0
- package/dist/nam-bridge.d.ts.map +1 -0
- package/dist/nam-bridge.js +265 -0
- package/dist/nam-loader.d.ts +4 -0
- package/dist/nam-loader.d.ts.map +1 -0
- package/dist/nam-loader.js +1 -0
- package/dist/protocol.d.ts +22 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +3 -0
- package/dist/script-bridge.d.ts +11 -0
- package/dist/script-bridge.d.ts.map +1 -0
- package/dist/script-bridge.js +343 -0
- package/dist/script-spielwerk.d.ts +24 -0
- package/dist/script-spielwerk.d.ts.map +1 -0
- package/dist/script-spielwerk.js +179 -0
- package/dist/soundfont-simplify.d.ts +28 -0
- package/dist/soundfont-simplify.d.ts.map +1 -0
- package/dist/soundfont-simplify.js +143 -0
- package/dist/sync/loopback.d.ts +8 -0
- package/dist/sync/loopback.d.ts.map +1 -0
- package/dist/sync/loopback.js +23 -0
- package/dist/sync/serialize-update-tasks.d.ts +4 -0
- package/dist/sync/serialize-update-tasks.d.ts.map +1 -0
- package/dist/sync/serialize-update-tasks.js +40 -0
- package/dist/utf8.d.ts +2 -0
- package/dist/utf8.d.ts.map +1 -0
- package/dist/utf8.js +19 -0
- package/dist/wasm/engine.wasm +0 -0
- package/dist/wasm/plugins/device_apparat.wasm +0 -0
- package/dist/wasm/plugins/device_arpeggio.wasm +0 -0
- package/dist/wasm/plugins/device_compressor.wasm +0 -0
- package/dist/wasm/plugins/device_crusher.wasm +0 -0
- package/dist/wasm/plugins/device_dattorro_reverb.wasm +0 -0
- package/dist/wasm/plugins/device_delay.wasm +0 -0
- package/dist/wasm/plugins/device_fold.wasm +0 -0
- package/dist/wasm/plugins/device_gate.wasm +0 -0
- package/dist/wasm/plugins/device_maximizer.wasm +0 -0
- package/dist/wasm/plugins/device_nano.wasm +0 -0
- package/dist/wasm/plugins/device_neural_amp.wasm +0 -0
- package/dist/wasm/plugins/device_pitch.wasm +0 -0
- package/dist/wasm/plugins/device_playfield_sample.wasm +0 -0
- package/dist/wasm/plugins/device_revamp.wasm +0 -0
- package/dist/wasm/plugins/device_reverb.wasm +0 -0
- package/dist/wasm/plugins/device_soundfont.wasm +0 -0
- package/dist/wasm/plugins/device_spielwerk.wasm +0 -0
- package/dist/wasm/plugins/device_stereo_tool.wasm +0 -0
- package/dist/wasm/plugins/device_tidal.wasm +0 -0
- package/dist/wasm/plugins/device_vaporisateur.wasm +0 -0
- package/dist/wasm/plugins/device_velocity.wasm +0 -0
- package/dist/wasm/plugins/device_vocoder.wasm +0 -0
- package/dist/wasm/plugins/device_waveshaper.wasm +0 -0
- package/dist/wasm/plugins/device_werkstatt.wasm +0 -0
- package/dist/wasm/plugins/device_zeitgeist.wasm +0 -0
- package/dist/wasm-offline-worker.js +97 -0
- package/dist/wasm-offline-worker.js.map +7 -0
- package/dist/wasm-processor.js +97 -0
- package/dist/wasm-processor.js.map +7 -0
- package/dist/worklet-scope.d.ts +2 -0
- package/dist/worklet-scope.d.ts.map +1 -0
- package/dist/worklet-scope.js +10 -0
- package/package.json +53 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var YI=Object.defineProperty;var Ta=(t,e)=>{for(var r in e)YI(t,r,{get:e[r],enumerable:!0})};var K=t=>t!=null,Yn=t=>t===null;var th=t=>t===void 0,ab=t=>t!==void 0,ob=t=>t==null,sb=(t,e)=>t!=null?e(t):void 0,ze=(t,e="asDefined failed")=>t??V(Qn(e)),kt=(t,e)=>t instanceof e,Ie=(t,e)=>t instanceof e?t:V(`${t} is not instance of ${e}`),lb=(t,e)=>{t instanceof e||V(`${t} is not instance of ${e}`)};var Qn=t=>t instanceof Function?t():t;var S=(t,...e)=>t?.apply(null,e),rh=t=>K(t)&&typeof t=="object";var ih=t=>{throw new Error(`Unhandled ${t}`)},V=t=>{throw typeof t=="string"?new Error(t):t},re=(t,e)=>t?void 0:V(Qn(e));var Ud=t=>new Proxy({},{get(){return V(t)}});var ib=class{value;status="success";constructor(e){this.value=e}error=Ud("Cannot access error when succeeded")},nb=class{error;status="failure";constructor(e){this.error=e}value=Ud("Cannot access value when failed")},Ht=t=>{try{return new ib(t())}catch(e){return new nb(e)}};var Da=(t,e)=>Object.keys(e).length===0?V("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:V(`Invalid enum value: ${String(t)}`),jd=()=>{};var ub;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(ub||(ub={}));var se=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,r)=>{e.length=0,e.push(...r)};static consume=(e,r)=>{for(let n=0;n<e.length;)r(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,r)=>ze(e.at(0),r);static getLast=(e,r)=>ze(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?V(`${r} not found in ${e}`):ze(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?V(`${r} not found in ${e}`):ze(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>ze(e.pop(),r);static create=(e,r)=>{let n=new Array(r);for(let i=0;i<r;i++)n[i]=e(i);return n};static equals=(e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0};static satisfy=(e,r)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!r(n,e[i]))return!1;return!0};static remove=(e,r)=>{let n=e.indexOf(r);if(n===-1)return V(`${r} not found in ${e}`);e.splice(n,1)};static removeIf=(e,r)=>{for(let n=e.length-1;n>=0;n--)r(e[n])&&e.splice(n,1)};static removeOpt=(e,r)=>{let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let r=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[r++]=i);return e.length=r,e};static removeDuplicateKeys=(e,r)=>{let n=0,i=new Set;for(let a of e){let o=a[r];i.has(o)||(i.add(o),e[n++]=a)}return e.length=n,e};static partition(e,...r){let n=r.map(()=>[]);for(let i of e)for(let a=0;a<r.length;a++)r[a](i)&&n[a].push(i);return n}static subtract(e,r,n){return e.filter(i=>!r.some(a=>n(i,a)))}static intersect(e,r,n){return e.filter(i=>r.some(a=>n(i,a)))}static merge(e,r,n){return[...e.filter(i=>!r.some(a=>n(i,a))),...r]}static*iterate(e){for(let r=0;r<e.length;r++)yield e[r]}static*iterateReverse(e){for(let r=e.length-1;r>=0;r--)yield e[r]}static*iterateStateFull(e){let r=e.length-1;for(let n=0;n<=r;n++)yield{value:e[n],isFirst:n===0,isLast:n===r}}static*iterateAdjacent(e){if(!(e.length<=1))for(let r=1,n=e[0];r<e.length;r++){let i=e[r];yield[n,i],n=i}}static isSorted(e,r=ub.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let a=e[i];if(Math.sign(n-a)===r)return!1;n=a}return!0}static toRecord(e,r){return e.reduce((n,i)=>(n[r(i)]=i,n),{})}static concatArrayBuffers(e,r){let n=new ArrayBuffer(e.byteLength+r.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(r),e.byteLength),n}};var b;(function(t){t.wrap=r=>K(r)?new e(r):t.None,t.from=r=>t.wrap(r()),t.tryCatch=r=>{try{return t.wrap(r())}catch{return t.None}},t.execute=(r,...n)=>t.wrap(r?.apply(null,n)),t.async=r=>r.then(n=>t.wrap(n),()=>t.None);class e{#e;constructor(n){this.#e=ze(n)}unwrap(){return this.#e}unwrapOrElse(n){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(n){return n===this.#e}match(n){return n.some(this.#e)}ifSome(n){return n(this.#e)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return t.wrap(n(this.#e))}mapOr(n,i){return n(this.#e)}flatMap(n){return n(this.#e)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}t.Some=e,t.None=new class{unwrap=r=>V(K(r)?Qn(r):"unwrap failed");unwrapOrElse=r=>Qn(r);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=r=>!1;match=r=>r.none();ifSome=r=>{};ifAbsent=r=>r(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=r=>t.None;mapOr=(r,n)=>Qn(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>V(Qn(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var Mr;(function(t){t.async=e=>e.then(r=>t.ok(r),r=>t.err(r)),t.tryGet=e=>{try{return t.ok(e())}catch(r){return t.err(r)}},t.ok=e=>new class{value;constructor(r){this.value=r}asOption=()=>b.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=r=>{try{return t.ok(r(this.value))}catch(n){return t.err(n)}};mapOr=(r,n)=>r(this.value);unwrapOrElse=r=>this.value;flatMap=r=>r(this.value);match=r=>r.ok(this.value);toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),t.Ok=new class{constructor(){}asOption=()=>b.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>t.ok(e());mapOr=(e,r)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},t.err=e=>new class{reason;constructor(r){this.reason=r}asOption=()=>b.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>V(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>Qn(n);unwrapOrElse=r=>Qn(r);flatMap=()=>this;match=r=>r.err(this.reason);toVoid=()=>t.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Mr||(Mr={}));var ht;(function(t){t.exact=(e,r,n)=>{let i=0,a=e.length-1;for(;i<=a;){let o=i+a>>>1,s=n(e[o],r);if(s===0)return o;s<0?i=o+1:a=o-1}return-1},t.exactMapped=(e,r,n,i)=>{let a=0,o=e.length-1;for(;a<=o;){let s=a+o>>>1,u=n(i(e[s]),r);if(u===0)return s;u<0?a=s+1:o=s-1}return-1},t.leftMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}return i},t.rightMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<=0?i=o+1:a=o}return a-1},t.stableInsert=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}for(;i<e.length&&n(e[i],r)===0;)i++;return i},t.leftMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<0?a=s+1:o=s}return a},t.rightMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<=0?a=s+1:o=s}return o-1},t.rangeMapped=(e,r,n,i)=>[t.leftMostMapped(e,r,n,i),t.rightMostMapped(e,r,n,i)]})(ht||(ht={}));var nh=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 qt=class t{static parseCssRgbOrRgba(e){let r=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(K(r)&&r.every(n=>!isNaN(n))){if(r.length===3)return[r[0]/255,r[1]/255,r[2]/255,1];if(r.length===4)return[r[0]/255,r[1]/255,r[2]/255,r[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,r,n){let i=u=>(u+e/30)%12,a=r*Math.min(n,1-n),o=u=>n-a*Math.max(-1,Math.min(i(u)-3,Math.min(9-i(u),1))),s=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${s(o(0))}${s(o(8))}${s(o(4))}`}static hexToHsl(e){let r=e.startsWith("#")?e.slice(1):e,n=parseInt(r.slice(0,2),16)/255,i=parseInt(r.slice(2,4),16)/255,a=parseInt(r.slice(4,6),16)/255,o=Math.max(n,i,a),s=Math.min(n,i,a),u=(o+s)/2,d=0,m=0;if(o!==s){let x=o-s;switch(m=u>.5?x/(2-o-s):x/(o+s),o){case n:d=((i-a)/x+(i<a?6:0))*60;break;case i:d=((a-n)/x+2)*60;break;case a:d=((n-i)/x+4)*60;break}}return{h:d,s:m,l:u}}static hslStringToHex(e){let[r,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return t.hslToHex(r,n/100,i/100)}#e;#t;#r;#i;constructor(e,r,n,i=1){this.#e=e,this.#t=r,this.#r=n,this.#i=i}opacity(e){return new t(this.#e,this.#t,this.#r,e)}brightness(e){let r=Math.max(0,Math.min(100,this.#r+e));return new t(this.#e,this.#t,r,this.#i)}saturate(e){return new t(this.#e,this.#t*e,this.#r,this.#i)}fade(e){let r=this.#t*(1-Math.sqrt(e)),n=this.#r+(100-this.#r)*e**3;return new t(this.#e,r,n,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var mo=(t,e)=>t-e;var q2=Math.PI*2,J2=Math.PI/2,X2=Math.PI/4,Y2=1/Math.sqrt(2),at=(t,e,r)=>Math.max(e,Math.min(t,r)),yS=t=>Math.max(0,Math.min(t,1)),wS=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),cb=(t,e)=>Math.floor(t/e)*e;var bS=(t,e,r)=>t+(e-t)*r;var Fs=(t,e)=>QI(t/e)*e,QI=t=>t-Math.floor(t),ah=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var db=(t,e)=>t*e/((2*e-1)*(t-1)+e);var Jt;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},u)=>t.normalizedAt(u/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=at(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=at(a,1e-15,.999999999999999);return Math.log(i*(1-2*o)/(o*o)+1)/(2*Math.log((1-o)/o))},t.coefficients=i=>{let a=t.valueAt(i,1),s=(t.valueAt(i,2)-a)/(a-i.y0),u=a-s*i.y0;return{m:s,q:u}};function*r(i,a,o,s){let{m:u,q:d}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let m=0,x=o;m<a;m++)yield x=u*x+d}t.walk=r,t.run=(i,a,o,s,u)=>{let{m:d,q:m}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let x=0,g=o;x<a;x++)u(g=d*g+m)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),d=(t.normalizedAt(2*o,i)-s)/s;for(let m=0,x=0;m<a;m++)yield x=d*x+s}t.walkNormalized=n,t.byHalf=(i,a,o,s)=>({slope:t.slopeByHalf(a,o,s),steps:i,y0:a,y1:s}),t.slopeByHalf=(i,a,o)=>Math.abs(o-i)<1e-6?.5:(a-i)/(o-i)})(Jt||(Jt={}));var ea=new DataView(new ArrayBuffer(8)),yr;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(ea.setInt8(0,e),ea.getInt8(0)),t.toShort=e=>(ea.setInt16(0,e),ea.getInt16(0)),t.toInt=e=>(ea.setInt32(0,e),ea.getInt32(0))})(yr||(yr={}));var Ra;(function(t){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),a=new Int32Array(n);t.floatToIntBits=o=>{let s=t.floatToRawIntBits(o);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},t.intBitsToFloat=o=>(a[0]=o,i[0]),t.floatToRawIntBits=o=>(i[0]=o,a[0]),t.toFloat32=o=>(ea.setFloat32(0,o),ea.getFloat32(0))})(Ra||(Ra={}));var _S;(function(t){t.floatToIntBits=e=>{let r=Ra.floatToIntBits(e),n=r>>>16&32768,i=(r&2147483647)+4096;return i>=1199570944?(r&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(r&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(r&2147483647)>>>23,n|(r&8388607|8388608)+(8388608>>>i-102)>>>126-i)},t.intBitsToFloat=e=>{let r=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,r===0&&n>115712)return Ra.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(r!==0){n=115712;do r<<=1,n-=1024;while((r&1024)===0);r&=1023}return Ra.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(_S||(_S={}));var oh;(function(t){let e=9218868437227405312n,r=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),a=new BigInt64Array(n);t.float64ToLongBits=o=>{let s=t.float64ToRawLongBits(o);return(s&e)===e&&(s&r)!==0n?0x7ff8000000000000n:s},t.longBitsToFloat64=o=>(a[0]=o,i[0]),t.float64ToRawLongBits=o=>(i[0]=o,a[0]),t.clamp=o=>(ea.setFloat64(0,o),ea.getFloat64(0))})(oh||(oh={}));var Xt=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){re(K(r)||e>=0,()=>`range count must be non-negative, got ${e}`);let i=K(r)?e:0,a=K(r)?r:e;if(n!==0)if(n>0)for(let o=i;o<a;o+=n)yield o;else for(let o=i;o>a;o+=n)yield o}static count(e){let r=0;for(let n of e)r++;return r}static some(e,r){for(let n of e)if(r(n))return!0;return!1}static every(e,r){for(let n of e)if(!r(n))return!1;return!0}static reduce(e,r,n){let i=n,a=0;for(let o of e)i=r(i,o,a++);return i}static includes(e,r){for(let n of e)if(n===r)return!0;return!1}static forEach(e,r){for(let n of e)r(n)}static*map(e,r){let n=0;for(let i of e)yield r(i,n++)}static*take(e,r){let n=0;for(let i of e){if(n++>=r)return;yield i}}static filter(e,r){let n=[];for(let i of e)r(i)&&n.push(i);return n}static filterMap(e,r){let n=[];for(let i of e){let a=r(i);K(a)&&n.push(a)}return n}static reverse(e){let r=[];for(let n of e)r.push(n);return r.reverse()}static*pairWise(e){let r=e[Symbol.iterator](),{done:n,value:i}=r.next(),a=i;if(n!==!0)for(;;){let{done:o,value:s}=r.next();if(o===!0){yield[a,null];return}yield[a,s],a=s}}};var Ct=class t{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,r=0){return new t(new DataView(e,r))}littleEndian=!1;#e;#t=0;constructor(e){this.#e=e}get remaining(){return this.#e.byteLength-this.#t}get position(){return this.#t}set position(e){e<0?V(`position(${e}) cannot be negative.`):e>this.#e.byteLength?V(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#e.setInt8(this.#t++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#e.setInt16(this.#t,e,this.littleEndian),this.#t+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#e.setInt32(this.#t,e,this.littleEndian),this.#t+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#e.setBigInt64(this.#t,e,this.littleEndian),this.#t+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#e.setFloat32(this.#t,e,this.littleEndian),this.#t+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#e.setFloat64(this.#t,e,this.littleEndian),this.#t+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let r=0;r<e.length;++r)this.#e.setInt8(this.#t++,e[r])}writeString(e){let r=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+r*Int16Array.BYTES_PER_ELEMENT),this.writeInt(r);for(let n=0;n<r;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let r=this.#e.byteLength;if(this.#t+e>r){let n=this.#e;this.#e=new DataView(new ArrayBuffer(ah(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},au=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}},sh=class{#e;#t=0;constructor(e=32){this.#e=new Int8Array(e)}result(){return this.#e}equals(e){return e===this?!0:this.#e.every((r,n)=>e.#e[n]===r)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#t>=this.#e.length&&(this.#t=0),this.#e[this.#t++]^=e}writeInt(e){this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBytes(e){e.forEach(r=>this.writeByte(r))}writeFloat(e){this.writeInt(Ra.floatToIntBits(e))}writeDouble(e){this.writeLong(oh.float64ToLongBits(e))}writeLong(e){this.writeByte(Number(e)&255),this.writeByte(Number(e>>8n)&255),this.writeByte(Number(e>>16n)&255),this.writeByte(Number(e>>24n)&255),this.writeByte(Number(e>>32n)&255),this.writeByte(Number(e>>40n)&255),this.writeByte(Number(e>>48n)&255),this.writeByte(Number(e>>56n)&255)}writeString(e){for(let r=0;r<e.length;r++)this.writeShort(e.charCodeAt(r))}toHexString(){return Array.from(Xt.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},rt=class{littleEndian=!1;#e;#t=0;constructor(e,r=0){this.#e=new DataView(e,r)}get position(){return this.#t}set position(e){e<0?V(`position(${e}) cannot be negative.`):e>this.#e.byteLength?V(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}readByte(){return this.#e.getInt8(this.#t++)}readShort(){let e=this.#e.getInt16(this.#t,this.littleEndian);return this.#t+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#e.getInt32(this.#t,this.littleEndian);return this.#t+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#e.getBigInt64(this.#t,this.littleEndian);return this.#t+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#e.getFloat32(this.#t,this.littleEndian);return this.#t+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#e.getFloat64(this.#t,this.littleEndian);return this.#t+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let r=0;r<e.length;r++)e[r]=this.readByte()}readString(){let e=this.readInt(),r="";for(let n=0;n<e;n++)r+=String.fromCharCode(this.readShort());return r}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var eB=t=>K(t)?t.value!==void 0?"value":t.get!==void 0?"get":V(`Cannot resolve method key of ${t}`):V("Cannot resolve method key of undefined descriptor"),ou=(t,e,r)=>{if(!K(r))return function(a,o){if(o&&o.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!K(s?.get))return V(`Cannot find getter for property '${e}'`);let u=s.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let n=eB(r),i=ze(r[n]);return{[n]:function(...a){if(a.length>0)return V("lazy accessory must not have any construction parameters");let o=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?o:()=>o,configurable:!1,writable:!1,enumerable:!1}),o}}};var Ca;(function(t){function*e(){}t.empty=e;function*r(...n){for(let i of n)for(let a of i)yield a}t.flatten=r})(Ca||(Ca={}));var Yt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?S(i[r],...n):i[r]?.apply(i,n))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var Kd=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var Wd=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var lh=class t{map;constructor(e){this.map=new Map(e?.map(r=>{let n=r[0],i=r[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,r){return Xt.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return Xt.includes(this.map.keys(),e)}containsValue(e){return Xt.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??Wd.empty()}isEmpty(){return this.keyCount()===0}add(e,r){Kd.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=Kd.createIfAbsent(this.map,e,()=>new Set);for(let i of r)n.add(i)}remove(e,r){let n=this.map.get(e);return n===void 0?!1:n.delete(r)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let r=new Set;for(let[n,i]of this.map.entries()){for(let a of i)e(a)&&(i.delete(a),r.add(a));i.size===0&&this.map.delete(n)}return r}removeFromKeyIf(e,r){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(r(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let r=this.map.get(e);return this.map.delete(e),r??Wd.empty()}forEach(e){Xt.forEach(this.map.entries(),r=>e(r[0],r[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let r=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,r.get(i));return this}clone(){let e=new t;return this.map.forEach((r,n)=>{e.map.set(n,new Set(Array.from(r)))}),e}};var fe=Object.freeze({Empty:{terminate:jd},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),ee=class t{#e=[];isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}own(e){return this.#e.push(e),e}ownAll(...e){for(let r of e)this.#e.push(r)}spawn(){let e=new t;return e.own({terminate:()=>se.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var me=class{static subscribeMany(e,...r){return fe.many(...r.map(n=>n.subscribe(()=>e(n))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(r=>r(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var uh;(function(t){let e=Object.freeze({});t.empty=()=>e,t.mergeNoOverlap=(r,n)=>{let i=new Set(Object.keys(r));for(let a of Object.keys(n))if(i.has(a))return V(`'${a}' is an overlapping key`);return{...r,...n}},t.include=(r,...n)=>{let i={};for(let a of n)i[a]=r[a];return i},t.exclude=(r,...n)=>{let i=new Set(n);return Object.entries(r).reduce((a,[o,s])=>(i.has(o)||(a[o]=s),a),{})},t.overwrite=(r,n)=>Object.assign(r,n),t.entries=r=>Object.entries(r)})(uh||(uh={}));var AS;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return fe.Empty}catchupAndSubscribe(r){return r(this),fe.Empty}}})(AS||(AS={}));var FS;(function(t){t.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return fe.Empty}catchupAndSubscribe(e){return e(this),fe.Empty}},t.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(r){e.setValue(!r)}subscribe(r){return e.subscribe(r)}catchupAndSubscribe(r){return r(this),this.subscribe(r)}}})(FS||(FS={}));var wr=class{#e;#t=b.None;constructor(e){this.#e=new me,this.wrap(e)}wrap(e){this.wrapOption(b.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(K(e)&&e(this.#t.unwrap()),this.#t=b.None,this.#e.notify(this))}assert(e){return this.#t.assert(e),this}contains(e){return this.#t.contains(e)}equals(e){return this.#t.equals(e)}flatMap(e){return this.#t.flatMap(e)}ifSome(e){return this.#t.ifSome(e)}ifAbsent(e){return this.#t.ifAbsent(e)}isEmpty(){return this.#t.isEmpty()}map(e){return this.#t.map(e)}mapOr(e,r){return this.#t.mapOr(e,r)}match(e){return this.#t.match(e)}nonEmpty(){return this.#t.nonEmpty()}unwrap(e){return this.#t.unwrap(e)}unwrapOrElse(e){return this.#t.unwrapOrElse(e)}unwrapOrNull(){return this.#t.unwrapOrNull()}unwrapOrUndefined(){return this.#t.unwrapOrUndefined()}subscribe(e){return this.#e.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#e.subscribe(()=>e(this))}terminate(){this.#e.terminate()}};var Wi=class{#e;#t=b.None;#r;constructor(e,r){this.#e=new me,this.#r=r?.guard(e)??e,this.#t=b.wrap(r)}setValue(e){this.#t.nonEmpty()&&(e=this.#t.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#e.notify(this))}getValue(){return this.#r}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#e.subscribe(e)}terminate(){this.#e.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var pb=class{#e;#t;constructor(e,r){re(e<r,"Linear is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return at(e,this.#e,this.#t)}floating(){return!0}},fb=class{#e;#t;#r;constructor(e,r){this.#e=at(Math.round(e),yr.MIN_VALUE,yr.MAX_VALUE),this.#t=at(Math.round(r),yr.MIN_VALUE,yr.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(at(e,0,1)*this.#r)}clamp(e){return at(Math.round(e),this.#e,this.#t)}floating(){return!1}},mb=class{#e;#t;constructor(e,r){re(e<r,"Exponential is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},ch=class{#e;#t;#r;#i;constructor(e,r,n){re(r!==n,"Power min === max"),this.#e=e,this.#t=r,this.#r=n,this.#i=n-r}x(e){return e<=this.#t?0:e>=this.#r?1:Math.pow((e-this.#t)/this.#i,1/this.#e)}y(e){return e<=0?this.#t:e>=1?this.#r:this.#t+Math.pow(e,this.#e)*this.#i}clamp(e){return Math.min(this.#r,Math.max(this.#t,e))}floating(){return!0}},hb=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?V(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(at(e,0,1)*(this.#e.length-1));return r>-1?ze(this.#e.at(r),`Could not find value for ${e}`):V(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},gb=class{#e;#t;#r;#i;#n;constructor(e,r,n){this.#e=e,this.#t=n;let i=e*e,a=n*n,o=r*r,s=e+n-2*r,u=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(u*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-u/s}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#n)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},E;(function(t){t.linear=(a,o)=>new pb(a,o),t.linearInteger=(a,o)=>new fb(a,o),t.exponential=(a,o)=>new mb(a,o),t.power=(a,o,s)=>new ch(a,o,s),t.powerByCenter=(a,o,s)=>{let u=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(u))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new ch(u,o,s)},t.values=a=>new hb(a),t.decibel=(a,o,s)=>new gb(a,o,s);let e=new class{x(a){return a?1:0}y(a){return a>=.5}clamp(a){return a}floating(){return!1}},r=t.linear(0,1),n=t.linear(-1,1);t.bool=e;let i=t.decibel(-72,-12,0);t.unipolar=()=>r,t.bipolar=()=>n,t.DefaultDecibel=i})(E||(E={}));var P;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:u}={})=>new e(a,o,s,u),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let u=o.indexOf(s);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},t.values=(a,o,s)=>new class{x(u){return{unit:a,value:s.at(o.indexOf(u))??"N/A"}}y(u){let d=s.indexOf(u);return d===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:o[d]}}},t.bool=new class{y(a){switch(a.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}},t.boolValues=(a,o)=>new class{y(s){switch(s.trim()){case o:case"on":case"yes":case"true":return{type:"explicit",value:!0};case a:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(o,s,u,d){this.#e=o??"",this.#t=s??0,this.#r=u??!1,this.#i=d??!1}y(o){let s=o.trim();this.#e.length>0&&this.#e!=="%"&&s.endsWith(this.#e)&&(s=s.slice(0,-this.#e.length).trim());let u=parseFloat(s);if(isNaN(u))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:u/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?at(u/200+.5,0,1):at(u/100,0,1)};{let m=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(K(m)){let x=r.indexOf(m);if(x>-1)return{type:"explicit",value:u*Math.pow(10,(x-4)*3)}}return{type:"explicit",value:u}}}x(o){if(Number.isNaN(o))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(o)){if(this.#e==="%")return this.#i?{value:(o*200-100).toFixed(this.#t),unit:this.#e}:{value:(o*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:u}=i(o);return{value:s.toFixed(this.#t),unit:`${u}${this.#e}`}}else return{value:o.toFixed(this.#t),unit:this.#e}}else return{value:o===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let r=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=a=>Math.log(a)/Math.log(9.999999999999998),i=a=>{let o=Math.floor(n(a)/3),s=r[o+4];return K(s)?{value:a*Math.pow(10,o*-3),prefix:s}:{value:a,prefix:""}};t.decible=t.numeric({unit:"db",fractionDigits:2}),t.panning=t.percent({unit:"%",fractionDigits:0})})(P||(P={}));var su;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})(su||(su={}));var dh;(function(t){t.create=(e=252854082)=>new vb(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return V("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let u=Math.floor(n.uniform()*(1+r))+1;e[s]=u,a+=u}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(dh||(dh={}));var vb=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,r){return e+this.uniform()*(r-e)}nextInt(e,r){return e+Math.floor(this.uniform()*(r-e))}nextElement(e){return e[Math.floor(this.uniform()*e.length)]}nextBoolean(){return this.uniform()<.5}uniform(){let e=this.#e+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}};var bi;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,u])=>{u instanceof e?o[s]=u.initialValue():typeof u=="object"&&(o[s]=i(u))}),o};return()=>new r(n,Object.seal(i(n)))},t.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},t.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},t.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},t.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},t.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},t.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},t.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},t.floats=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readFloat();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeFloat(a[o])}initialValue(){return new Float32Array(n)}},t.doubles=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readDouble();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeDouble(a[o])}initialValue(){return new Float64Array(n)}};class r{#e;#t;#r;constructor(i,a){this.#e=i,this.#t=a,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?m[u]=d.read(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?d.write(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}#i(){let i=new au;return this.write(i),i.count}}})(bi||(bi={}));var lu=class{#e;#t;#r;constructor(e,r){this.#e=e,this.#t=r,this.#r=[]}add(e,r=!1){let n=this.#e(e),i=ht.leftMostMapped(this.#r,n,this.#t,this.#e),a=this.#r[i];return K(a)&&this.#t(this.#e(a),n)===0?r?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,r){let n=ht.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(K(i)&&this.#t(this.#e(i),e)===0)return i;let a=r(e);return this.#r.splice(n,0,a),a}addMany(e){for(let r of e)this.#r.push(r);try{return this.#r.sort((r,n)=>{let i=this.#t(this.#e(r),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(r){if(r==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,a)=>this.#t(this.#e(i),this.#e(a))),!1}return V(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=ht.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):V(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=ht.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):null}removeRange(e,r){this.#r.splice(e,(r??this.#r.length)-e)}removeByPredicate(e){let r=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),r++);return r}get(e,r){return ze(this.#i(e),r??`Unknown key: ${e}`)}getOrThrow(e,r){let n=this.#i(e);if(K(n))return n;throw r()}opt(e){return b.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return K(this.#i(e))}hasValue(e){return K(this.#i(this.#e(e)))}size(){return this.#r.length}isEmpty(){return this.#r.length===0}forEach(e){this.values().forEach(e)}values(){return this.#r}entries(){return this.#r.map(e=>[this.#e(e),e])}clear(){se.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=ht.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var uu=(()=>{let t=b.None;return{info:e=>t.match({none:()=>Promise.resolve(),some:r=>r.info(e)}),approve:e=>t.match({none:()=>Promise.resolve(!0),some:r=>r.approve(e)}),progress:e=>t.match({none:()=>({message:"",terminate:jd}),some:r=>r.progress(e)}),notify:e=>t.match({none:jd,some:r=>r.notify(e)}),install:e=>{re(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var Es=class t{static createEstimator=()=>{let e=performance.now(),r=t.millis(Number.POSITIVE_INFINITY),n=0;return i=>{if(i===0)return t.POSITIVE_INFINITY;if(i>=1)return t.millis(0);let a=performance.now()-e;return a>n*1e3&&(r=t.millis(a/i-a),n++),r}};static POSITIVE_INFINITY=new t(Number.POSITIVE_INFINITY);static millis=e=>new t(e);static seconds=e=>new t(e*t.#e);static minutes=e=>new t(e*t.#t);static hours=e=>new t(e*t.#r);static days=e=>new t(e*t.#i);static toHHMMSS=e=>((e/3600|0)+100).toString().slice(1)+":"+((e/60|0)%60+100).toString().slice(1)+":"+(e%60+100).toString().slice(1);static#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/t.#e}absMinutes(){return Math.abs(this.#n)/t.#t}absHours(){return Math.abs(this.#n)/t.#r}absDays(){return Math.abs(this.#n)/t.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,r,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),a=Math.floor(i/60),o=Math.floor(a/24);return n<60?(e=n,r="second"):i<60?(e=i,r="minute"):a<24?(e=a,r="hour"):(e=o,r="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),r)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:r,m:n,s:i}=this.split();return e>0?[t.#a("d",e),t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):r>0?[t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):n>0?[t.#a("m",n),t.#a("s",i)].join(", "):i>0?t.#a("s",i):"now"}static#a=(e,r)=>{switch(e){case"d":return`${r} ${r<2?"day":"days"}`;case"h":return`${r} ${r<2?"hour":"hours"}`;case"m":return`${r} ${r<2?"minute":"minutes"}`;case"s":return`${r} ${r<2?"second":"seconds"}`;default:return ih(e)}}};var ph;(function(t){let e;(function(r){r[r.READING=0]="READING",r[r.READ=1]="READ",r[r.WRITING=2]="WRITING",r[r.WRITTEN=3]="WRITTEN"})(e||(e={})),t.writer=(r,n,i)=>{if(r.bytesTotal+1>n.byteLength)return V("Insufficient memory allocated.");let a=new Uint8Array(n),o=Ct.use(n,1);return Atomics.store(a,0,e.READ),{tryWrite:()=>Atomics.compareExchange(a,0,e.READ,e.WRITING)===e.WRITING?(i(r.object),o.position=0,r.write(o),Atomics.store(a,0,e.WRITTEN),!0):!1}},t.reader=(r,n)=>{let i=new SharedArrayBuffer(r.bytesTotal+1),a=new Uint8Array(i),o=new rt(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(a,0,e.WRITTEN,e.READING)===e.READING?(o.position=0,r.read(o),n(r.object),Atomics.store(a,0,e.READ),!0):!1}}})(ph||(ph={}));var k;(function(t){t.length=16,t.generate=()=>r(crypto.getRandomValues(new Uint8Array(t.length))),t.sha256=async n=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(n.slice(0)):n).then(a=>r(new Uint8Array(a.slice(0,t.length))))},t.validateBytes=n=>t.parse(t.toString(n)),t.validateString=n=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n),t.asString=n=>t.validateString(n)?n:V(`Invalid UUID format: ${n}`),t.fromDataInput=n=>{let i=new Uint8Array(t.length);return n.readBytes(new Int8Array(i.buffer)),i},t.toDataOutput=(n,i)=>n.writeBytes(new Int8Array(i.buffer));let e=se.create(n=>(n+256).toString(16).substring(1),256);t.toString=n=>e[n[0]]+e[n[1]]+e[n[2]]+e[n[3]]+"-"+e[n[4]]+e[n[5]]+"-"+e[n[6]]+e[n[7]]+"-"+e[n[8]]+e[n[9]]+"-"+e[n[10]]+e[n[11]]+e[n[12]]+e[n[13]]+e[n[14]]+e[n[15]],t.parse=n=>{let i=n.replace(/-/g,"").toLowerCase();if(i.length!==32)return V(`Invalid UUID format (${n})`);let a=new Uint8Array(t.length);for(let o=0,s=0;o<32;o+=2,s++)a[s]=parseInt(i.slice(o,o+2),16);return a},t.Comparator=(n,i)=>{if(n.length!==t.length||i.length!==t.length)return V("Unexpected array length for uuid(v4)");for(let a=0;a<t.length;a++){let o=n[a]-i[a];if(o!==0)return o}return 0},t.equals=(n,i)=>t.Comparator(n,i)===0,t.newSet=n=>new lu(n,t.Comparator),t.Lowest=t.parse("00000000-0000-4000-8000-000000000000"),t.Highest=t.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),t.fromInt=n=>{let i=new Uint8Array(t.Lowest),a=new Uint8Array(new Uint32Array([n]).buffer);for(let o=0;o<4;o++)i[o]=a[o];return i},t.zType=n=>n.string().refine(i=>t.validateString(i),{message:"Invalid UUID format (Zod)"}).transform(i=>i);let r=n=>(re(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(k||(k={}));var ho;(function(t){class e{value;constructor(s){this.value=s}}t.Transfer=e,t.makeTransferable=o=>new e(o),t.sender=(o,s)=>s(new i(o)),t.executor=(o,s)=>new a(o,s);let r=o=>{let s=[];for(let u of o)u instanceof e?s.push(u.value):(u instanceof MessagePort||typeof ImageBitmap<"u"&&u instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&u instanceof OffscreenCanvas)&&s.push(u);return s},n=o=>o instanceof e?o.value:o;class i{#e;#t=new Map;#r;#i=0;constructor(s){this.#e=s,this.#r=s.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(s,...u)=>{let d=r(u);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(Xt.map(u,m=>({value:n(m)})))},d)};dispatchAndReturn=(s,...u)=>new Promise((d,m)=>{let x=Xt.reduce(u,(w,_,N)=>(typeof _=="function"&&w.push([N,_]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:d,reject:m},callbacks:new Map(x)});let g=r(u);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(Xt.map(u,(w,_)=>typeof w=="function"?{callback:_}:{value:n(w)}))},g),this.#i++});#n=s=>{let u=this.#t.get(s.returnId);K(u)?s.type==="resolve"?(u.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(u.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&u.callbacks?.get(s.funcAt).apply(this,s.args):V(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,u){this.#e=s,this.#t=u,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{re(s.type==="send",()=>"Message type must be 'send'");let u=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),d=ze(u[s.func],`${s.func.toString()} does not exists on ${this.#t}`),m=s.returnId;if(m===!1)d.apply(this.#t,s.args.map(x=>"value"in x?x.value:V(`${s.func.toString()} has no promise.`)));else try{d.apply(this.#t,s.args.map(g=>"callback"in g?(...w)=>this.#o(m,g.callback,w):g.value)).then(g=>{try{this.#n(m,g)}catch(w){this.#a(m,w)}},g=>this.#a(m,g))}catch(x){this.#a(m,x)}};#n=(s,u)=>this.#e.send({type:"resolve",returnId:s,resolve:u});#a=(s,u)=>this.#e.send({type:"reject",returnId:s,reject:u});#o=(s,u,d)=>this.#e.send({type:"callback",returnId:s,funcAt:u,args:d})}t.Executor=a})(ho||(ho={}));var wb={for:t=>new xb(t)},tB=[],xb=class{#e;#t=new me;constructor(e){if(this.#e=e,K(e.onmessage)||K(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=r=>this.#t.notify(r.data),e.onmessageerror=r=>{throw new Error(r.type)}}send(e,r){this.#e.postMessage(e,r??tB)}channel(e){return new yb(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},yb=class t{#e;#t;#r=new me;#i;constructor(e,r){this.#e=e,this.#t=r,this.#i=e.subscribe(n=>{"__id__"in n&&n.__id__==="42"&&"message"in n&&"channel"in n&&n.channel===r&&this.#r.notify(n.message)})}send(e,r){this.#e.send({__id__:"42",channel:this.#t,message:e},r)}channel(e){return new t(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var Ss;(function(t){t.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),t.frames=e=>new Promise(r=>{let n=e,i=()=>{--n<=0?r():requestAnimationFrame(i)};requestAnimationFrame(i)}),t.timeSpan=(e,...r)=>new Promise(n=>setTimeout(n,e.millis(),...r)),t.event=(e,r)=>new Promise(n=>e.addEventListener(r,n,{once:!0})),t.observable=e=>new Promise(r=>{let n=e.subscribe(()=>{n.terminate(),r()})}),t.complete=e=>new Promise((r,n)=>{let i=setInterval(()=>{let{status:a,value:o,error:s}=Ht(()=>e.next());if(a==="success"){let{done:u,value:d}=o;u&&(clearInterval(i),r(d))}else clearInterval(i),n(s)},0)})})(Ss||(Ss={}));var bb=class{maxRetry;timeSpan;#e=0;constructor(e,r){this.maxRetry=e,this.timeSpan=r}retry(e,r){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(r,this.timeSpan.millis()),!0)}},fh;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=Ud("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=Ud("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let u=!0;return o.own(fe.create(()=>u=!1)),new Promise((d,m)=>s.then(x=>{u&&d(x)},x=>{u&&m(x)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new bb(3,Es.seconds(3));t.retry=(o,s=n)=>o().catch(u=>new Promise((d,m)=>{let x=g=>{s.retry(g,()=>o().then(w=>d(w),x))||m(g)};x(u)})),t.guardedRetry=(o,s)=>{let u=async(d=0)=>{try{return await o()}catch(m){if(s(m,++d))return console.debug(`retry after failure (online: ${navigator.onLine}):`,m),await Ss.timeSpan(Es.seconds(1)),u(d);throw new Error(`Failed after ${d} retries: ${m}`)}};return u()},t.approvedRetry=(o,s)=>{let u=async()=>{try{return await o()}catch(d){if(await uu.approve(s(d)))return u();throw d}};return u()},t.delay=(o,s)=>Promise.all([o,Ss.timeSpan(s)]).then(([u])=>u),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,u)=>new Promise((d,m)=>{let x=!0,g=setTimeout(()=>{x=!1,m(new Error(u??"timeout"))},s.millis());o.then(w=>{x&&d(w)},w=>{x&&m(w)}).finally(()=>clearTimeout(g))}),t.sequentialAll=o=>o.reduce((s,u)=>s.then(async d=>[...d,await u()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return u=>{let d=()=>o(u),m=s.then(d,d);return s=m.catch(()=>{}),m}},t.memoizeAsync=(o,s)=>{let u=null,d=Date.now();return()=>{let m=Date.now();return(Yn(u)||K(s)&&m-d>s.millis())&&(d=m,u=o(),u.catch(x=>(u=null,x))),u}},t.allWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=!1,x=async()=>{for(;d<o.length&&!m;){let g=d++;try{let w=await o[g]();m||(u[g]=w)}catch(w){throw m=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},x)),u},t.allSettledWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=async()=>{for(;d<o.length;){let x=d++;try{let g=await o[x]();u[x]={status:"fulfilled",value:g}}catch(g){u[x]={status:"rejected",reason:g}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},m)),u};class i{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let u=Promise.withResolvers();return this.#e.push([s,u]),u.promise.finally(()=>this.#r())}}#r(){if(re(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:u,reject:d}]=this.#e.shift();this.#t++,s().then(u,d)}}}t.Limit=i;class a{#e;#t;#r;#i=b.None;constructor(s,u,d){this.#e=s,this.#t=u,this.#r=d}update(s){this.#i=b.wrap(s),s.then(u=>{this.#i.contains(s)&&this.#e(u)}).catch(u=>{this.#i.contains(s)&&this.#t(u)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),S(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(fh||(fh={}));var mh=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#u;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#u=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new hh(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=Ld.create(Ld.Type.Blackman,this.#e),this.#t=e,this.#o=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#o.fill(0),this.#i.fill(0),this.#s.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#o}waveform(){return this.#s}process(e,r,n,i){for(let a=n;a<i;++a)this.#i[this.#l]=e[a]+r[a],++this.#l===this.#e&&this.#c()}#c(){for(let r=0;r<this.#t;++r)this.#s[r]=this.#i[r<<1];for(let r=0;r<this.#e;++r)this.#i[r]*=this.#a[r];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let r=0;r<this.#t;++r){let n=this.#i[r],i=this.#n[r],a=Math.sqrt(n*n+i*i)*e;this.#o[r]<a?this.#o[r]=a:this.decay&&(this.#o[r]*=this.#u)}this.#l=0,this.#n.fill(0),this.decay=!1}};var _b=(t,e)=>Math.floor(3840/e)*t,ES=(t,e=4,r=4)=>{let n=_b(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-_b(a*e,r))%n,u=Math.floor(s/240),d=s%240;return{bars:a,beats:i-a*e,semiquavers:u,ticks:d}},SS=(t,e)=>t*e/60*960,PS=(t,e)=>t*60/960/e,rB=(t,e)=>e*60/960/t,iB=(t,e,r)=>SS(t/r,e),nB=(t,e,r)=>PS(t,e)*r,Me={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:_b,toParts:ES,secondsToPulses:SS,pulsesToSeconds:PS,secondsToBpm:rB,samplesToPulses:iB,pulsesToSamples:nB,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=ES(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var _i=128,gh=Me.fromSignature(1,48);var aB=Math.log(10)/20;var $S=t=>Math.exp(t*aB);var Zd;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(Zd||(Zd={}));var Gd;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(Gd||(Gd={}));var za;(function(t){t.globalToLocal=(r,n)=>Fs(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{let u=r-i,d=u+a;if(u>=s||d<=o)return b.None;let m=Math.max(u,o),x=Math.min(d,s);return b.wrap({index:0,rawStart:u,rawEnd:d,regionStart:Math.max(u,r),regionEnd:Math.min(d,n),resultStart:m,resultEnd:x,resultStartValue:u<m?(m-u)/a:0,resultEndValue:d>x?(x-u)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){let u=r-i,d=Math.max(r,o),m=Math.min(n,s),x=Math.floor((d-u)/a),g=u+x*a;for(;g<m;){let w=g+a,_=Math.max(g,r),N=Math.min(w,n),j=Math.max(g,d),W=Math.min(w,m),O=g<j?(j-g)/a:0,te=w>W?(W-g)/a:1;yield{index:x++,rawStart:g,rawEnd:w,regionStart:_,regionEnd:N,resultStart:j,resultEnd:W,resultStartValue:O,resultEndValue:te},g=w}}t.locateLoops=e})(za||(za={}));var ri=class t{static DefaultComparator=(e,r)=>e.position-r.position;static create(e){return new t(e??t.DefaultComparator)}#e;constructor(e){this.#e=new vh(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?Ca.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?Ca.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),r,n)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},go=class t{static Comparator=(e,r)=>e.position-r.position;static create(e){return new t(e)}#e;constructor(e=t.Comparator){this.#e=new vh(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?Ca.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return Ca.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return Ca.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return Ca.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var vh=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){if(this.#e.includes(e))throw new Error(`Duplicate event added: ${e}`);++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let r=this.#e.indexOf(e);return r===-1?!1:(this.#e.splice(r,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let n=e.position,i=ht.leftMostMapped(this.#e,n,mo,Zd.PositionExtractor);for(let a=i;a<this.#e.length;a++){let o=this.#e[a];if(o===e)return!0;if(o.position!==n)return!1}return!1}clear(){++this.modCount,se.clear(this.#e),this.#t=!1}optAt(e){return e<0||e>=this.#e.length?null:(this.#t&&this.#r(),this.#e[e])}asArray(){return this.#t&&this.#r(),this.#e}lowerEqual(e,r){if(r===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(r(i))return i}return null}greaterEqual(e,r){if(r===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(r(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),ht.rightMostMapped(this.#e,e,mo,Zd.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),ht.leftMostMapped(this.#e,e,mo,Zd.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,yr.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,yr.MAX_VALUE,r);i--}return this.iterate(n,yr.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=su.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=r)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var xh;(function(t){t.hasFading=e=>e.in>0||e.out>0,t.gainAt=(e,r,n)=>{let{in:i,out:a,inSlope:o,outSlope:s}=n,u=1,d=1;i>0&&e<i&&(u=Jt.normalizedAt(e/i,o));let m=r-a;if(a>0&&e>m){let x=(e-m)/a;d=1-Jt.normalizedAt(x,s)}return Math.min(u,d)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:u,inSlope:d,outSlope:m}=o;if(e.fill(1,0,a),s<=0&&u<=0)return;let x=i-u;if(r>=s&&n<=x)return;let g=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),_=Math.min(a,Math.ceil((w-r)/g));if(_>0){let N=r/s,j=w/s,W=Jt.walk(d,_,N,j);for(let O=0;O<_;O++)e[O]=W.next().value}}if(u>0&&n>x){let w=Math.max(r,x),_=Math.max(0,Math.floor((w-r)/g)),N=a-_;if(N>0){let j=(w-x)/u,W=(n-x)/u,O=Jt.walk(m,N,1-j,1-W);for(let te=_;te<a;te++)e[te]=Math.min(e[te],O.next().value)}}}})(xh||(xh={}));var hh=class t{static reverse(e){return e=(e&1431655765)<<1|e>>>1&1431655765,e=(e&858993459)<<2|e>>>2&858993459,e=(e&252645135)<<4|e>>>4&252645135,e=e<<24|(e&65280)<<8|e>>>8&65280|e>>>24,e}#e;#t;#r;#i;constructor(e){this.#e=e;let r=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(r),this.#i=new Float32Array(r);for(let n=0;n<r;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,r){let n,i,a,o;for(let d=0;d<this.#e;++d)i=t.reverse(d)>>>this.#t,i>d&&(o=e[d],e[d]=e[i],e[i]=o,o=r[d],r[d]=r[i],r[i]=o);let s=this.#r,u=this.#i;for(let d=2;d<=this.#e;d<<=1){let m=d>>1,x=this.#e/d;for(n=0;n<this.#e;n+=d){let g=n+m;for(i=n,a=0;i<g;i++,a=a+x|0){let w=i+m|0,_=s[a],N=u[a],j=e[w],W=r[w],O=j*_+W*N,te=W*_-j*N,ie=e[i],be=r[i];e[w]=ie-O,r[w]=be-te,e[i]=ie+O,r[i]=be+te}}if(d===this.#e)break}}inverse(e,r){let n=this.#e;for(let a=0;a<n;a++)r[a]=-r[a];this.process(e,r);let i=1/n;for(let a=0;a<n;a++)e[a]*=i,r[a]=-r[a]*i}};var vo;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>Me.fromSignature(r,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(n)-t.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(i)-t.toDouble(n))}}})(vo||(vo={}));var kS;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(kS||(kS={}));var yh=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,r){let n=this.#e.duration(),i=cb(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var ta;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(ta||(ta={}));var cu;(function(t){t.isOfType=e=>e.type==="note-event",t.Comparator=(e,r)=>{let n=e.position-r.position;if(n!==0)return n;let i=e.pitch-r.pitch;return i!==0?i:0},t.curveFunc=(e,r)=>r<0?e**2**-r:1-(1-e)**2**r,t.inverseCurveFunc=(e,r)=>r<0?e**2**r:1-Math.max(0,1-e)**2**-r,t.CompleteComparator=(e,r)=>{let n=Gd.complete(e)-Gd.complete(r);return n!==0?n:e.pitch-r.pitch}})(cu||(cu={}));var wh=class t{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(t.#e*e)),this.#i=Math.pow(.01,1/(t.#t*e))}clear(){this.#n=0}replace(e,r,n){let i=this.#r,a=this.#i,[o,s]=e.channels(),u=this.#n;for(let d=r;d<n;++d){let m=o[d],x=s[d],g=Math.max(Math.abs(m),Math.abs(x));if(u=g>u?i*(u-g)+g:a*(u-g)+g,u>1){let w=1/u;o[d]=m*w,s[d]=x*w}}this.#n=u}};var Kr;(function(t){t.Musical="musical",t.Seconds="seconds"})(Kr||(Kr={}));var Ps;(function(t){function e(r,n,i){return new Ab(r,n,i)}t.aware=e})(Ps||(Ps={}));var Ab=class{#e;#t;#r;constructor(e,r,n){this.#r=n,this.#t=r,this.#e=e}toPPQN(e){let r=this.#r.getValue();if(this.getTimeBase()===Kr.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===Kr.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(r,r+e);this.#r.setValue(n)}}toSeconds(e){let r=this.#r.getValue();return this.getTimeBase()===Kr.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return Da(this.#t.getValue(),Kr)}};var MS=Me.fromSignature(1,384);var ii={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?ii.Linear:{type:"curve",slope:t}},bh;(function(t){t.Comparator=(i,a)=>{let o=i.position-a.position;if(o!==0)return o;let s=i.index-a.index;return s!==0?s:i===a?0:V(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return Xt.empty();for(let s of i.iterateFrom(a))if(yield s,s.position>=o)return}t.iterateWindow=e,t.nextEvent=(i,a)=>{let o=i.asArray(),s=ht.rightMost(o,a,t.Comparator);return s===-1?null:o[s+1]??null},t.valueAt=(i,a,o)=>{if(i.isEmpty())return o;let s=i.iterateFrom(a),{done:u,value:d}=s.next();if(u)return o;if(d.position<=a){let{done:m,value:x}=s.next();if(m)return d.value;if(a<x.position)return n(d,x,a);if(d.interpolation===ii.None)return d.value}return d.value};function*r(i,a,o,s){if(i.isEmpty())return;let u=i.iterateFrom(a),{done:d,value:m}=u.next();if(d)return;let x=o/s,g=m;if(g.position>a){for(;a<g.position;)if(yield{position:a,value:g.value},a+=x,a>o)return;g.position<=o&&(yield g)}for(;a<=o;){let{done:w,value:_}=u.next();if(w)break;for(;a<_.position;){if(a>o)return;yield{position:a,value:n(g,_,a)},a+=x}_.position<o&&(g.interpolation===ii.None&&(yield{position:_.position,value:g.value}),yield _),g=_}for(;a<=o;)yield{position:a,value:g.value},a+=x}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,u)=>o.type==="none"?i:o.type==="linear"?i+(u-a)/(s.position-a)*(s.value-i):o.type==="curve"?Jt.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},u-a):V("Unknown interpolation")})(bh||(bh={}));var Ld;(function(t){let e;(function(r){r[r.Bartlett=0]="Bartlett",r[r.Blackman=1]="Blackman",r[r.BlackmanHarris=2]="BlackmanHarris",r[r.Hamming=3]="Hamming",r[r.Hanning=4]="Hanning"})(e=t.Type||(t.Type={})),t.create=(r,n)=>{let i=new Float32Array(n),a=Math.PI/(n-1);switch(r){case e.Bartlett:{let o=(n>>1)-1,s=0;for(;s<=o;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let o=2*a,s=4*a;for(let u=0;u<n;++u)i[u]=.42323-.49755*Math.cos(o*u)+.07922*Math.cos(s*u);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,u=6*a;for(let d=0;d<n;++d)i[d]=.35875-.48829*Math.cos(o*d)+.14128*Math.cos(s*d)-.01168*Math.cos(u*d);return i}case e.Hamming:{let o=2*a;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(o*s);return i}case e.Hanning:{let o=2*a;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(o*s);return i}}}})(Ld||(Ld={}));var Re=class t{static newSet(e){return new lu(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return re(n.every((i,a)=>i===r[a]),`fieldKeys (${n.join(",")}) only allows i16`),new t(e,n)};static decode(e){let r=e.split("/");return re(r.length>0,"Unable to parse Address"),t.compose(k.parse(r[0]),...r.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,r,n){let i=e.values(),a=ht.leftMostMapped(i,r,k.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(k.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=k.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return e.#r.length-r.#r.length};static MinimalComparator=(e,r)=>{let n=k.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return 0};static LengthComparator=(e,r)=>{let n=k.Comparator(e.#t,r.#t);return n!==0?n:r.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,r){this.#t=e,this.#r=r}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return t.Comparator(this,e)===0}compareTo(e){return t.Comparator(this,e)}append(e){return new t(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return k.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((r,n)=>this.#r[n]===r)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(r=>e.writeShort(r))}moveTo(e){return new t(e,this.#r)}decompose(){return[this.#t,this.#r]}toJSON(){return{uuid:Array.from(this.#t.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(k.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,k.length),e.buffer}toString(){return[k.toString(this.#t),...this.#r].join("/")}static read(e){let r=k.fromDataInput(e),n=e.readByte();return t.compose(r,...se.create(()=>e.readShort(),n))}},$s;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>Re.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=ht.rangeMapped(r,e,Re.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=ht.rangeMapped(r,e,Re.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=ht.leftMostMapped(r,e,Re.LengthComparator,t.AddressReader),i=ht.rightMostMapped(r,e,Re.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})($s||($s={}));var ra=class t{static validate(e,r){if(e.address.equals(r.address))return b.wrap(`PointerField cannot point to itself: ${e}`);if(!r.pointerRules.accepts.some(n=>n===e.pointerType)){let n=r.pointerRules.accepts.join(", ");return b.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return b.None}#e;#t;constructor(e){this.#e=e,this.#t=new Yt}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=Re.newSet(i=>i.address);return n.addMany(this.filter(...r)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{n.removeByKey(i.address),e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():Xt.filter(this.incoming().values(),r=>e.some(n=>n===r.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(r=>e.address.equals(r.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let r=t.validate(e,this.#e);if(r.nonEmpty())return V(r.unwrap());this.#t.proxy.onAdded(e)}onRemoved(e){this.#t.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#e.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,r,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onRemoved(i)}})}};var Fb=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},du=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},H=class t{static hook(e){return new t(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:r,fieldName:n,pointerRules:i,deprecated:a}){this.#e=e,this.#t=r,this.#r=n,this.#i=i,this.#n=a,(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}accept(e){return S(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 ra(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 se.empty()}record(){return uh.empty()}getField(e){return V()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return V("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(r=>{r.defer(),(r.mandatory||this.pointerRules.mandatory&&e.length===1)&&(console.warn(`[Field.disconnect] Deleting ${r.box} because pointer.mandatory=${r.mandatory} or (field.mandatory=${this.pointerRules.mandatory} and lastPointer=${e.length===1})`),r.box.delete())})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};Fb([ou,du("design:type",ra),du("design:paramtypes",[])],H.prototype,"pointerHub",null);Fb([ou,du("design:type",Re),du("design:paramtypes",[])],H.prototype,"address",null);Fb([ou,du("design:type",String),du("design:paramtypes",[])],H.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var _h=class t extends H{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=se.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return S(e.visitArrayField,this)}fields(){return this.#e}record(){return se.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return ze(this.#e[e])}optField(e){return b.wrap(this.#e[e])}read(e){this.#e.forEach(r=>r.read(e))}write(e){this.#e.filter(r=>!r.deprecated).forEach(r=>r.write(e))}size(){return this.#e.length}toJSON(){if(!this.deprecated)return Object.values(this.#e).map(e=>e.toJSON()??null)}fromJSON(e){if(!this.deprecated)if(Array.isArray(e))e.forEach((r,n)=>this.#e[n].fromJSON(r));else return V("Type mismatch")}};var xo;(function(t){t.writeFields=(r,n)=>{let i=Object.entries(n).filter(([a,o])=>!o.deprecated);r.writeInt(1179403347),r.writeShort(i.length),i.forEach(([a,o])=>{let s=Ct.create();o.write(s);let u=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(u.length),r.writeBytes(u)})},t.readFields=(r,n)=>{re(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(th(n[o]))continue;let s=r.readInt(),u=new Int8Array(s);r.readBytes(u);let{status:d,error:m}=Ht(()=>n[o]?.read(new rt(u.buffer)));d==="failure"&&console.warn(n,m)}}})(xo||(xo={}));var oB=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},NS=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},D=class t{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#a;#o;#s=t.Index++;constructor({uuid:e,graph:r,name:n,pointerRules:i,resource:a,ephemeral:o}){this.#e=Re.compose(e),this.#t=r,this.#r=n,this.#i=i,this.#n=a,this.#a=o===!0,this.#o=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return ze(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return b.wrap(this.#o[e])}subscribe(e,r){return this.graph.subscribeVertexUpdates(e,this.address,r)}subscribeDeletion(e){return this.graph.subscribeDeletion(this.address.uuid,e)}get box(){return this}get name(){return this.#r}get graph(){return this.#t}get parent(){return this}get address(){return this.#e}get pointerRules(){return this.#i}get resource(){return this.#n}get ephemeral(){return this.#a}get creationIndex(){return this.#s}get pointerHub(){return new ra(this)}estimateMemory(){let e=new au;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ie(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){xo.readFields(e,this.#o)}write(e){xo.writeFields(e,this.#o)}serialize(){let e=Ct.create();return e.writeInt(this.#s),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=Ct.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[r,n])=>{let i=n.toJSON();return K(i)&&(e[r]=i),e},{})}fromJSON(e){if(rh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];K(n)&&i.fromJSON(n)});else return V("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return se.empty();let n=this.getField(r[0]),i=[e(n)];for(let a=1;a<r.length;a++)n=n.getField(r[a]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return b.wrap(this);let r=this.optField(e[0]);if(r.isEmpty())return b.None;for(let n=1;n<e.length;n++)if(r=r.unwrap().optField(e[n]),r.isEmpty())return b.None;return r}delete(){if(!this.isAttached())return;let{boxes:e,pointers:r}=this.graph.dependenciesOf(this);t.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...r].map(n=>n.toString()).join(`
|
|
2
|
+
`)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
|
|
3
|
+
`),this));for(let n of r)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=r=>r.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};oB([ou,NS("design:type",ra),NS("design:paramtypes",[])],D.prototype,"pointerHub",null);var Hd;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(Hd||(Hd={}));var Oe;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(Oe||(Oe={}));var Ah;(function(t){t.create=()=>new Eb})(Ah||(Ah={}));var Eb=class{#e=new qd($s.equals);#t=new qd($s.startsWith);#r=new qd($s.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new Sb(r,e,this.#n++,n);if(this.#a){let a=new Pb(i,e);return this.#i.push(a),a}else return this.subscribeMonitor(i,e)}dispatch(e){this.#a=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#a=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,r){switch(r){case Oe.This:return this.#e.subscribe(e);case Oe.Parent:return this.#t.subscribe(e);case Oe.Children:return this.#r.subscribe(e);default:return ih(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Sb=class{address;propagation;order;procedure;constructor(e,r,n,i){this.address=e,this.propagation=r,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${Oe[this.propagation]}, order: ${this.order} }`}},qd=class{filterStrategy;#e=[];#t=!0;constructor(e){this.filterStrategy=e}subscribe(e){return this.#e.push(e),this.#t=this.#e.length<2,{terminate:()=>{let r=this.#e.length;for(;--r>=0;)this.#e[r]===e&&this.#e.splice(r,1)}}}stations(){return this.#t||(this.#e.sort($s.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Pb=class{monitor;propagation;#e=new ee;#t=!1;constructor(e,r){this.monitor=e,this.propagation=r}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var zt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(zt||(zt={}));var Ms={[zt.Boolean]:{type:zt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[zt.Float32]:{type:zt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[zt.Int32]:{type:zt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[zt.String]:{type:zt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[zt.Bytes]:{type:zt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},ks=class extends H{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return S(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Oe.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#e}get initValue(){return this.#t}setInitValue(e){re(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let r=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,r,n))}writeValue(e,r){re(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,r)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?V("not implemented"):e}fromJSON(e){return V("Type mismatch")}reset(){this.setValue(this.#t)}},R=class t extends ks{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,zt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return Ms[zt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){re(!this.deprecated,"BooleanField.write: deprecated field"),e.writeBoolean(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString()))}},F=class t extends ks{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,zt.Float32,i),this.#e=r,this.#t=n}serialization(){return Ms[zt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Hd.clampFloat32(this.#e,Ra.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){re(!this.deprecated,"FLoat32Field.write: deprecated field"),e.writeFloat(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString()))}},$=class t extends ks{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,zt.Int32,i),this.#e=r,this.#t=n}serialization(){return Ms[zt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Hd.clampInt32(this.#e,yr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){re(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=yr.MIN_VALUE&&e<=yr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},B=class t extends ks{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,zt.String,r)}serialization(){return Ms[zt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){re(!this.deprecated,"StringField.write: deprecated field"),e.writeString(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString()))}},IS=class t extends ks{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,zt.Bytes,r)}serialization(){return Ms[zt.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let r=new Int8Array(e.readInt());e.readBytes(r),this.setValue(r)}write(e){re(!this.deprecated,"ByteArrayField.write: deprecated field");let r=this.getValue();e.writeInt(r.length),e.writeBytes(r)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(r=>typeof r=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var TS=t=>{let e=k.newSet(i=>i),r=k.newSet(i=>i);for(let i of t)i instanceof Ns?e.add(i.uuid):i instanceof Ts&&r.add(i.uuid);let n=k.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof Ns||i instanceof Ts?!n.hasKey(i.uuid):i instanceof Bs||i instanceof Is?!n.hasKey(i.address.uuid):!0)},BS;(function(t){t.decode=e=>{let r=e.readInt();return se.create(()=>{switch(e.readString()){case"new":{let i=k.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Ns(i,a,o.buffer)}case"pointer":{let i=Re.read(e),a=e.readBoolean()?b.wrap(Re.read(e)):b.None,o=e.readBoolean()?b.wrap(Re.read(e)):b.None;return new Bs(i,a,o)}case"primitive":{let i=Re.read(e),a=e.readString(),o=Ms[a],s=o.decode(e),u=o.decode(e);return new Is(i,o,s,u)}case"delete":{let i=k.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Ts(i,a,o.buffer)}}},r)}})(BS||(BS={}));var Ns=class{type="new";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,r=>r.read(new rt(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),k.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${k.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Is=class{type="primitive";#e;#t;#r;#i;constructor(e,r,n,i){this.#e=e,this.#t=r,this.#r=n,this.#i=i}get address(){return this.#e}get 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}`}},Bs=class{type="pointer";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get address(){return this.#e}get oldAddress(){return this.#t}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#t}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PointerField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),this.#t.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},Ts=class{type="delete";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}inverse(e){e.createBox(this.#t,this.#e,r=>r.read(new rt(this.#r)))}write(e){e.writeString(this.type),k.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${k.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var LO=Symbol("Unreferenceable"),M=class t extends H{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){re(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=b.wrap(e);let n=Ht(r);if(this.#e=b.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){re(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=b.wrap(e);let n=Ht(r);if(this.#t=b.None,n.status==="failure")throw n.error;return n.value}static#e=b.None;static#t=b.None;#r;#i;#n=b.None;#a=b.None;constructor(e,r,n){super(e),this.#r=r,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return V(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return S(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Oe.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=b.wrap(e)}defer(){this.targetVertex=b.None}get targetVertex(){return this.graph.inTransaction()?this.#a.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let r=ra.validate(this,e.unwrap());r.nonEmpty()&&V(r.unwrap())}this.targetAddress=e.map(r=>r.address)}get targetAddress(){return this.#a}set targetAddress(e){let r=this.#a;r.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&r.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#a=e,this.graph.onPointerAddressUpdated(this,r,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap("targetVertex"))}resolvedTo(e){this.#n=e}read(e){let r=e.readBoolean()?b.wrap(Re.read(e)):b.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){re(!this.deprecated,"PointerField.write: deprecated field"),t.#e.match({none:()=>this.#a,some:r=>r.map(this)}).match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toJSON(){if(!this.deprecated)return t.#e.match({none:()=>this.#a,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(Yn(e)||typeof e=="string"){let r=b.wrap(Yn(e)?null:Re.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return V(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var Fh=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=Re.newSet(e=>e.address),this.#t=Re.newSet(e=>e.address),this.#r=Re.newSet(e=>e.address),this.#i=Re.newSet(([e])=>e),this.#n=Re.newSet(([e])=>e.address),this.#a=k.newSet(e=>e)}watchVertex(e){if(kt(e,M)){if(!e.mandatory)return V("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return V("watchVertex called but has no edge requirement");r&&this.#t.add(e),n&&this.#r.add(e)}this.#a.add(e.address.uuid)}unwatchVerticesOf(...e){let r=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return V(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return V(`${n} has incoming edges from: ${a.map(o=>o.toString())}`)}}forgetVerticesOf(e){let r=({box:{address:{uuid:i}}})=>i,{address:{uuid:n}}=e;this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r)}connect(e,r){this.#n.add([e,r]),this.#i.opt(r).match({none:()=>this.#i.add([r,[e]]),some:([,n])=>n.push(e)}),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}disconnect(e){let[,r]=this.#n.removeByKey(e.address),[,n]=this.#i.get(r,"incoming by address");se.remove(n,e),n.length===0&&this.#i.removeByKey(r),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}isConnected(e,r){return this.#n.opt(e.address).mapOr(([,n])=>n.equals(r),!1)}outgoingEdgesOf(e){return this.#o(this.#n,e.address.uuid,([{box:{address:{uuid:r}}}])=>r)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#i,e.address.uuid,([{uuid:r}])=>r).flatMap(([r,n])=>n):this.#i.opt(e.address).mapOr(([r,n])=>n,se.empty())}clearAffected(){this.#a.clear()}tryValidateAffected(){let e=({box:{address:{uuid:r}}})=>r;for(let r of this.#a.values()){let n=this.#o(this.#e,r,e);for(let o of n)if(o.isEmpty())return this.#a.clear(),o.mandatory?b.wrap(new Error(`Pointer ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let i=this.#o(this.#t,r,e);for(let o of i)if(o.pointerHub.isEmpty())return this.#a.clear(),o.pointerRules.mandatory?b.wrap(new Error(`Target ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let a=this.#o(this.#r,r,e);for(let o of a){let s=o.pointerHub.size();if(s>1)return this.#a.clear(),b.wrap(new Error(`Target ${o.toString()} is exclusive but has ${s} incoming pointers.`))}}return this.#a.clear(),b.None}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),V(`Pointer ${e.toString()} requires an edge.`)):V(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?(console.warn(e),console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} requires an edge.`),V(`Target ${e.toString()} requires an edge.`)):V(`Illegal state: ${e} has no edge requirements.`)}),this.#r.forEach(e=>{let r=e.pointerHub.size();if(r>1)return console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} is exclusive but has ${r} incoming pointers.`),V(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#o(e,r,n){let i=Re.boxRange(e,r,n);return K(i)?e.values().slice(i[0],i[1]):se.empty()}#s(e,r,n){let i=Re.boxRange(e,r,n);K(i)&&e.removeRange(i[0],i[1])}};var Oa=class{#e;#t;#r;#i;#n;#a;#o;#s;#u;#l;#c;#h;#v;#g=!1;#d=!1;#p=!1;constructor(e=b.None){this.#e=e,this.#t=k.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#u=Ah.create(),this.#a=new Yt,this.#o=new Yt,this.#s=new Yt,this.#l=new Fh,this.#c=Re.newSet(({pointer:r})=>r.address),this.#h=[],this.#v=k.newSet(r=>r.uuid)}beginTransaction(){re(!this.#g,"Transaction already in progress"),this.#g=!0,this.#n.length=0,this.#s.proxy.onBeginTransaction()}abortTransaction(){re(this.#g,"No transaction in progress"),this.#b(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#m()}endTransaction(){re(this.#g,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>{this.#n.push(r),this.#f(e,r)}),this.#r.length=0),!this.#p&&this.#e.nonEmpty()&&this.#l.tryValidateAffected().ifSome(e=>{throw this.#b(),this.#m(),e}),this.#x(),this.#m()}inTransaction(){return this.#g}constructingBox(){return this.#d}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#w(),re(!this.#d,"Cannot construct box while other box is constructing"),K(r)){this.#d=!0;let a=Ht(()=>r(e));if(this.#d=!1,a.status==="failure")throw this.#_(e),a.error}if(!this.#t.add(e))return this.#_(e),V(`${e.name} ${e.address.toString()} already staged`);let i=new Ns(e.address.uuid,e.name,e.toArrayBuffer());return this.#p||this.#n.push(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#s.subscribe(e)}subscribeToAllUpdates(e){return this.#a.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#o.subscribe(e)}subscribeVertexUpdates(e,r,n){return this.#u.subscribe(e,r,n)}subscribeEndTransaction(e){this.#h.push(e)}subscribeDeletion(e,r){let n=this.#v.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#v.removeByKeyIfExist(e)}}}unstageBox(e){this.#w();let r=this.#t.removeByKey(e.address.uuid);re(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new Ts(e.address.uuid,e.name,e.toArrayBuffer());this.#p||this.#n.push(n),this.#v.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#a.proxy.onUpdate(n),this.#o.proxy.onUpdate(n)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(r=>r.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#l}checksum(){let e=new sh;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#w(),e.isAttached()&&!this.#d){let i=new Is(e.address,e.serialization(),r,n);this.#p||this.#n.push(i),this.#u.dispatch(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#w(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new Bs(e.address,r,n);this.#d?this.#r.push({pointerField:e,update:i}):(this.#p||this.#n.push(i),this.#y(e,i),this.#o.proxy.onUpdate(i))}#y(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#u.dispatch(r),this.#a.proxy.onUpdate(r)}#f(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#u.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#m(){for(this.#c.values().toSorted((e,r)=>e.index-r.index).forEach(({pointer:e,initial:r,final:n})=>{r.equals(n)||(r.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#c.clear(),this.#g=!1;this.#h.length>0;)this.#h.splice(0).forEach(e=>e()),this.#h.length>0&&console.debug(`${this.#h.length} new observers while notifying`);this.#s.proxy.onEndTransaction(this.#p),this.#p=!1}#b(){this.#p=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=TS(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof Bs||n instanceof Is)&&this.findVertex(n.address).isEmpty()){console.warn(`[BoxGraph] rollback skips ${n.type}-update, vertex not found at ${n.address.toString()}`);continue}n.inverse(this)}this.#i.length=0,this.#l.clearAffected(),this.#c.clear(),this.#n.length=0}#_(e){for(let r=this.#r.length-1;r>=0;r--)this.#r[r].pointerField.box===e&&this.#r.splice(r,1);this.#l.outgoingEdgesOf(e).forEach(([r])=>this.#l.disconnect(r)),this.#l.forgetVerticesOf(e)}findOrphans(e){let r=this.#A(e);return this.boxes().filter(n=>!r.has(n))}#A(e){let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!r.has(i)){r.add(i),this.#F(i).forEach(a=>{a.targetAddress.ifSome(o=>{this.findBox(o.uuid).ifSome(s=>{r.has(s)||n.push(s)})})});for(let a of i.incomingEdges())r.has(a.box)||n.push(a.box)}}return r}#F(e){let r=[],n=i=>{for(let a of i)a.accept({visitPointerField:o=>r.push(o),visitObjectField:o=>n(o.fields()),visitArrayField:o=>n(o.fields())})};return n(e.fields()),r}dependenciesOf(e,r={}){let n=K(r.excludeBox)?r.excludeBox:su.alwaysFalse,i=K(r.alwaysFollowMandatory)?r.alwaysFollowMandatory:!1,a=K(r.stopAtResources)?r.stopAtResources:!1,o=new Set,s=new Set,u=(m,x=!1)=>{if(!(o.has(m)||!x&&n(m))){if(o.add(m),a&&K(m.resource)){m.incomingEdges().forEach(g=>{s.add(g);let w=g.targetAddress.mapOr(_=>!_.isBox(),!1);if(g.mandatory&&w){if(m.resource==="shared"&&g.targetAddress.flatMap(N=>this.findVertex(N)).mapOr(N=>N.pointerRules.mandatory,!1))return;u(g.box)}});return}m.outgoingEdges().filter(([g])=>!s.has(g)).forEach(([g,w])=>{let _=this.findVertex(w).unwrap(`Could not find target of ${g.toString()}`);if(s.add(g),_.pointerRules.mandatory&&(i||_.pointerHub.incoming().filter(N=>N.targetAddress.mapOr(j=>j.equals(w),!1)).every(N=>s.has(N))))return u(_.box)}),m.incomingEdges().forEach(g=>{s.add(g),g.mandatory&&u(g.box)})}},d=Array.isArray(e)?e:[e];return d.forEach(m=>u(m,!0)),d.forEach(m=>o.delete(m)),{boxes:o,pointers:Array.from(s).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,r=n=>{for(let i of n.fields())i.accept({visitPointerField:a=>{if(a.targetAddress.nonEmpty()){let o=a.targetVertex.nonEmpty(),s=this.findVertex(a.targetAddress.unwrap()).nonEmpty();re(o,`pointer ${a.address} is broken`),re(s,`Cannot find target for pointer ${a.address}`),e++}},visitObjectField:a=>r(a)})};return this.#t.forEach(n=>r(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,r)=>(e[k.toString(r.address.uuid)]={class:r.name,"incoming links":r.incomingEdges().length,"outgoing links":r.outgoingEdges().length,"est. memory (bytes)":r.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let r of this.dependenciesOf(e).boxes)console.debug(` ${r}`)})}addressToDebugPath(e){return e.flatMap(r=>r.isBox()?this.findBox(r.uuid).map(n=>n.name):this.findBox(r.uuid).flatMap(n=>n.searchVertex(r.fieldKeys).map(i=>i.isField()?i.debugPath:V("Unknown address"))))}toArrayBuffer(){let e=Ct.create(),r=this.#t.values();return e.writeInt(r.length),r.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e,r=!0){re(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new rt(e),i=n.readInt();this.beginTransaction();let a=[];for(let o=0;o<i;o++){let s=n.readInt(),u=new Int8Array(s);n.readBytes(u);let d=new rt(u.buffer),m=d.readInt(),x=d.readString(),g=k.fromDataInput(d);a.push({creationIndex:m,name:x,uuid:g,boxStream:d})}a.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:u})=>this.createBox(o,s,d=>d.read(u))),r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:o,update:s})=>this.#y(o,s)),this.#r.length=0),this.#l.clearAffected(),this.#m())}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:ze(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return V("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,k.parse(i),s=>{let u=Ht(()=>s.fromJSON(o));u.status==="failure"&&console.warn(u.error)});r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:i,update:a})=>this.#y(i,a)),this.#r.length=0),this.#l.clearAffected(),this.#m())}#w(){re(this.#g,()=>"Modification only prohibited in transaction mode.")}};var ni;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=at(r,0,n.length);if(i<n.length)for(let a=i;a<n.length;a++)n[a].index.setValue(a+1);return i},t.removeOrder=(e,r)=>{let n=t.collectIndexedBoxes(e);if(r<n.length)for(let i=r+1;i<n.length;i++)n[i].index.setValue(i-1)},t.moveIndex=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=i[r];if(n<0){let o=at(r+n,0,i.length-1);for(let s=o;s<r;s++)i[s].index.setValue(s+1);a.index.setValue(o)}else if(n>1){let o=at(r+(n-1),0,i.length-1);for(let s=r;s<o;s++)i[s+1].index.setValue(s);a.index.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${r}, delta: ${n}`)},t.moveIndices=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=new Set(r),o=0;for(;o<r.length&&r[o]<n;)o++;let s=n-o,u=s,d=s+r.length,m=0,x=0,g=0;for(let w=0;w<i.length;w++){let _=i[w],N=a.has(w)?u+x++:w<n?m++:d+g++;_.index.setValue(N)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof $,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:V(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(ni||(ni={}));var Je=class extends H{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return S(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return ze(this.#e[e])}optField(e){return b.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Oe.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){xo.readFields(e,this.#e)}write(e){xo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[r,n])=>(e[r]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(rh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];K(n)&&i.fromJSON(n)});else return V("Type mismatch")}};var yo;(function(t){t[t.Float=0]="Float",t[t.FloatArray=1]="FloatArray",t[t.Integer=2]="Integer",t[t.IntegerArray=3]="IntegerArray",t[t.ByteArray=4]="ByteArray"})(yo||(yo={}));var Jd;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(Jd||(Jd={}));var pu;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(pu||(pu={}));var Eh=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Ct.create(0);#a=b.None;#o=b.None;#s=b.None;#u=-1;#l=-1;#c=!1;#h=!1;#v=0;constructor(e){this.#i=ho.sender(e,({dispatchAndForget:r})=>new class{sendShareLock(n){r(this.sendShareLock,n)}sendUpdateData(n){r(this.sendUpdateData,n)}sendUpdateStructure(n){r(this.sendUpdateStructure,n)}})}flush(){let e=this.#g();if(e.nonEmpty()){this.#h||(this.#i.sendShareLock(this.#t),this.#h=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#d(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#v){let o=ah(i),s=new SharedArrayBuffer(o);this.#o=b.wrap(new Uint8Array(s,0,r)),this.#n=Ct.use(s,r),this.#a=b.wrap(s),this.#v=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===Jd.WRITE&&(this.#p(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Jd.READ))}broadcastFloat(e,r){return this.#f(new class{type=yo.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#f(new class{type=yo.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#f(new class{type=yo.FloatArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n?.(a),i.writeInt(r.length);for(let o of r)i.writeFloat(o)}})}broadcastIntegers(e,r,n){return this.#f(new class{type=yo.IntegerArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n(a),i.writeInt(r.length),r.forEach(o=>i.writeInt(o))}})}broadcastByteArray(e,r,n){return this.#f(new class{type=yo.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#g(){if(this.#c){try{this.#s=b.wrap(this.#m())}catch(e){throw e}this.#c=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=b.None,e}return b.None}#d(){return this.#l===-1&&(this.#l=this.#y()+12),this.#l}terminate(){se.clear(this.#e),this.#s=b.None,this.#c=!1,this.#l=0}#p(e){re(!this.#c&&this.#s.isEmpty(),"Cannot flush while update is available");let r=this.#d();re(e.remaining>=r,"Insufficient data"),e.writeInt(this.#u),e.writeInt(pu.START);let n=this.#o;for(let i=0;i<this.#e.length;i++){let a=n.nonEmpty()&&n.unwrap()[i]!==0;this.#e[i].put(e,a)}e.writeInt(pu.END)}#y(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#f(e){return this.#e.push(e),this.#x(),{terminate:()=>{se.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#c=!0}#m(){let e=Ct.create();e.writeInt(pu.ID),e.writeInt(++this.#u),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};var DS;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(DS||(DS={}));var RS;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(RS||(RS={}));var Ft;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Ft||(Ft={}));var wo={white:new qt(0,0,100),blue:new qt(189,100,65),green:new qt(150,77,69),yellow:new qt(60,100,84),cream:new qt(65,20,83),orange:new qt(31,100,73),red:new qt(354,100,65),purple:new qt(314,100,78),bright:new qt(197,5,95),gray:new qt(197,31,88),dark:new qt(197,15,70),shadow:new qt(197,10,55),black:new qt(197,10,20),background:new qt(197,8,7),panelBackground:new qt(197,14,9),panelBackgroundBright:new qt(197,13,15),panelBackgroundDark:new qt(197,14,7)};var Ze;(function(t){t[t.Add=0]="Add",t[t.Adsr=1]="Adsr",t[t.ArrowDown=2]="ArrowDown",t[t.ArrowLeft=3]="ArrowLeft",t[t.ArrowRight=4]="ArrowRight",t[t.ArrowUp=5]="ArrowUp",t[t.AudioBus=6]="AudioBus",t[t.AudioDevice=7]="AudioDevice",t[t.AudioFile=8]="AudioFile",t[t.AutoGain=9]="AutoGain",t[t.Automation=10]="Automation",t[t.BassGuitar=11]="BassGuitar",t[t.Book=12]="Book",t[t.Box=13]="Box",t[t.Browse=14]="Browse",t[t.Bug=15]="Bug",t[t.Capture=16]="Capture",t[t.Chain=17]="Chain",t[t.ChatEmpty=18]="ChatEmpty",t[t.ChatMessage=19]="ChatMessage",t[t.Copy=20]="Copy",t[t.Maximizer=21]="Maximizer",t[t.Fold=22]="Fold",t[t.Folder=23]="Folder",t[t.Charts=24]="Charts",t[t.Checkbox=25]="Checkbox",t[t.Clips=26]="Clips",t[t.Close=27]="Close",t[t.CloudFolder=28]="CloudFolder",t[t.Code=29]="Code",t[t.CollapseDown=30]="CollapseDown",t[t.Compressor=31]="Compressor",t[t.Connected=32]="Connected",t[t.Cube=33]="Cube",t[t.Cursor=34]="Cursor",t[t.Curve=35]="Curve",t[t.Dattorro=36]="Dattorro",t[t.Delete=37]="Delete",t[t.Dial=38]="Dial",t[t.DinSlot=39]="DinSlot",t[t.Disconnected=40]="Disconnected",t[t.Divide=41]="Divide",t[t.DragConnections=42]="DragConnections",t[t.Dropdown=43]="Dropdown",t[t.Dropbox=44]="Dropbox",t[t.DrumSet=45]="DrumSet",t[t.Tidal=46]="Tidal",t[t.Duration=47]="Duration",t[t.EditBox=48]="EditBox",t[t.Effects=49]="Effects",t[t.Embed=50]="Embed",t[t.EQ=51]="EQ",t[t.Eraser=52]="Eraser",t[t.Exclude=53]="Exclude",t[t.Exit=54]="Exit",t[t.ExpandWidth=55]="ExpandWidth",t[t.FileList=56]="FileList",t[t.Film=57]="Film",t[t.Flask=58]="Flask",t[t.Focus=59]="Focus",t[t.Fullscreen=60]="Fullscreen",t[t.Gate=61]="Gate",t[t.Generator=62]="Generator",t[t.GoogleDrive=63]="GoogleDrive",t[t.Nextcloud=64]="Nextcloud",t[t.Groove=65]="Groove",t[t.Guitar=66]="Guitar",t[t.GuitarTab=67]="GuitarTab",t[t.Headphone=68]="Headphone",t[t.Heart=69]="Heart",t[t.Help=70]="Help",t[t.HighPass=71]="HighPass",t[t.HighShelf=72]="HighShelf",t[t.Insert=73]="Insert",t[t.InsertDown=74]="InsertDown",t[t.Invert=75]="Invert",t[t.Info=76]="Info",t[t.Lock=77]="Lock",t[t.Loop=78]="Loop",t[t.LoopEnd=79]="LoopEnd",t[t.LoopStart=80]="LoopStart",t[t.LowPass=81]="LowPass",t[t.LowShelf=82]="LowShelf",t[t.Magnet=83]="Magnet",t[t.MainMenu=84]="MainMenu",t[t.Maximized=85]="Maximized",t[t.Menu=86]="Menu",t[t.Merge=87]="Merge",t[t.Metronome=88]="Metronome",t[t.Microphone=89]="Microphone",t[t.Midi=90]="Midi",t[t.Minimized=91]="Minimized",t[t.Mix=92]="Mix",t[t.Mixing=93]="Mixing",t[t.Mute=94]="Mute",t[t.NanoWave=95]="NanoWave",t[t.NeuralAmp=96]="NeuralAmp",t[t.New=97]="New",t[t.NoAudio=98]="NoAudio",t[t.Note=99]="Note",t[t.NotePad=100]="NotePad",t[t.Notification=101]="Notification",t[t.OpenDAW=102]="OpenDAW",t[t.Panel=103]="Panel",t[t.Paste=104]="Paste",t[t.Peak=105]="Peak",t[t.Pencil=106]="Pencil",t[t.Piano=107]="Piano",t[t.Play=108]="Play",t[t.Playfield=109]="Playfield",t[t.PlayOnce=110]="PlayOnce",t[t.PlayRepeat=111]="PlayRepeat",t[t.PlayAlternate=112]="PlayAlternate",t[t.Pointer=113]="Pointer",t[t.Popout=114]="Popout",t[t.Primary=115]="Primary",t[t.Random=116]="Random",t[t.Record=117]="Record",t[t.Rectangle=118]="Rectangle",t[t.Redo=119]="Redo",t[t.Region=120]="Region",t[t.Robot=121]="Robot",t[t.RoundDown=122]="RoundDown",t[t.RoundUp=123]="RoundUp",t[t.Run=124]="Run",t[t.Sawtooth=125]="Sawtooth",t[t.Saxophone=126]="Saxophone",t[t.Scissors=127]="Scissors",t[t.Search=128]="Search",t[t.Share=129]="Share",t[t.SelectDown=130]="SelectDown",t[t.SelectUp=131]="SelectUp",t[t.Shadertoy=132]="Shadertoy",t[t.Shutdown=133]="Shutdown",t[t.Sine=134]="Sine",t[t.Solo=135]="Solo",t[t.SoundFont=136]="SoundFont",t[t.Speaker=137]="Speaker",t[t.SpeakerHeadphone=138]="SpeakerHeadphone",t[t.Square=139]="Square",t[t.Stack=140]="Stack",t[t.Start=141]="Start",t[t.Stereo=142]="Stereo",t[t.Stop=143]="Stop",t[t.Subtract=144]="Subtract",t[t.Sun=145]="Sun",t[t.Swap=146]="Swap",t[t.System=147]="System",t[t.Table=148]="Table",t[t.Tape=149]="Tape",t[t.TapeReel=150]="TapeReel",t[t.Time=151]="Time",t[t.Timeline=152]="Timeline",t[t.Tone3000=153]="Tone3000",t[t.Tool=154]="Tool",t[t.Triangle=155]="Triangle",t[t.Undo=156]="Undo",t[t.Unknown=157]="Unknown",t[t.UserFolder=158]="UserFolder",t[t.Velocity=159]="Velocity",t[t.Vinyl=160]="Vinyl",t[t.Vocoder=161]="Vocoder",t[t.Volume=162]="Volume",t[t.VUMeter=163]="VUMeter",t[t.Warning=164]="Warning",t[t.Waveform=165]="Waveform",t[t.Zeitgeist=166]="Zeitgeist"})(Ze||(Ze={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(Ze||(Ze={}));var l;(function(t){t[t.Deprecated=NaN]="Deprecated",t[t.MetaData=0]="MetaData",t[t.AudioBusses=1]="AudioBusses",t[t.AudioConnection=2]="AudioConnection",t[t.AudioEffectHost=3]="AudioEffectHost",t[t.AudioFile=4]="AudioFile",t[t.AudioOutput=5]="AudioOutput",t[t.AudioPlayMode=6]="AudioPlayMode",t[t.AudioUnit=7]="AudioUnit",t[t.AudioUnits=8]="AudioUnits",t[t.Automation=9]="Automation",t[t.AuxSend=10]="AuxSend",t[t.Capture=11]="Capture",t[t.ClipCollection=12]="ClipCollection",t[t.ConnectionCollection=13]="ConnectionCollection",t[t.Device=14]="Device",t[t.DeviceUserInterface=15]="DeviceUserInterface",t[t.Editing=16]="Editing",t[t.FileUploadState=17]="FileUploadState",t[t.Groove=18]="Groove",t[t.InstrumentHost=19]="InstrumentHost",t[t.MarkerEvents=20]="MarkerEvents",t[t.MarkerTrack=21]="MarkerTrack",t[t.MIDIControl=22]="MIDIControl",t[t.MIDIControllers=23]="MIDIControllers",t[t.MIDIDevice=24]="MIDIDevice",t[t.MIDIEffectHost=25]="MIDIEffectHost",t[t.ModularSetup=26]="ModularSetup",t[t.Modulation=27]="Modulation",t[t.ModuleCollection=28]="ModuleCollection",t[t.NoteEventCollection=29]="NoteEventCollection",t[t.NoteEventFeature=30]="NoteEventFeature",t[t.NoteEvents=31]="NoteEvents",t[t.NotesConnection=32]="NotesConnection",t[t.Parameter=33]="Parameter",t[t.ParameterController=34]="ParameterController",t[t.PianoMode=35]="PianoMode",t[t.ProjectMeta=36]="ProjectMeta",t[t.RegionCollection=37]="RegionCollection",t[t.Sample=38]="Sample",t[t.Selection=39]="Selection",t[t.Shadertoy=40]="Shadertoy",t[t.SideChain=41]="SideChain",t[t.SignatureAutomation=42]="SignatureAutomation",t[t.SoundfontFile=43]="SoundfontFile",t[t.StepAutomation=44]="StepAutomation",t[t.Timeline=45]="Timeline",t[t.TrackCollection=46]="TrackCollection",t[t.TransientMarkers=47]="TransientMarkers",t[t.User=48]="User",t[t.ValueEventCollection=49]="ValueEventCollection",t[t.ValueEvents=50]="ValueEvents",t[t.ValueInterpolation=51]="ValueInterpolation",t[t.VoltageConnection=52]="VoltageConnection",t[t.WarpMarkers=53]="WarpMarkers",t[t.NeuralAmpModel=54]="NeuralAmpModel",t[t.CompositeCell=55]="CompositeCell"})(l||(l={}));var Sh;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(Sh||(Sh={}));var Ds;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(Ds||(Ds={}));var CS=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?V(`Indices cannot be equal (${t}, ${e})`):r};var Va=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},br=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ph,Fn,bo,$h,Ua,ur=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){Ph.set(this,void 0),Fn.set(this,void 0),bo.set(this,void 0),$h.set(this,void 0),Ua.set(this,null),Va(this,Ph,e,"f"),Va(this,Fn,k.newSet(i=>i.adapter.uuid),"f"),Va(this,bo,new Yt,"f"),Va(this,$h,e.pointerHub.catchupAndSubscribe({onAdded:i=>{Va(this,Ua,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{Va(this,Ua,null,"f"),br(this,bo,"f").proxy.onReorder(a)}),s=br(this,Fn,"f").add({adapter:a,subscription:o});re(s,`Could not add ${a}`),br(this,bo,"f").proxy.onAdd(a)},onRemoved:i=>{Va(this,Ua,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=br(this,Fn,"f").removeByKey(a);s.terminate(),br(this,bo,"f").proxy.onRemove(o)}},n),"f")}field(){return br(this,Ph,"f")}subscribe(e){return br(this,bo,"f").subscribe(e)}catchupAndSubscribe(e){return br(this,Fn,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=ht.exactMapped(this.adapters(),e,CS,n=>n.indexField.getValue());return r===-1?b.None:b.wrap(this.adapters()[r])}getAdapterById(e){return br(this,Fn,"f").opt(e).map(({adapter:r})=>r)}getMinFreeIndex(){let e=this.adapters();for(let r=0;r<e.length;r++)if(e[r].indexField.getValue()>r)return r;return e.length}adapters(){return br(this,Ua,"f")===null&&Va(this,Ua,br(this,Fn,"f").values().map(({adapter:e})=>e).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),br(this,Ua,"f")}move(e,r){this.moveIndex(e.indexField.getValue(),r)}moveIndex(e,r){if(r===0)return;let n=this.adapters(),i=n[e],a=at(e+r,0,n.length-1);if(a!==e){if(r<0)for(let o=a;o<e;o++)n[o].indexField.setValue(o+1);else for(let o=e;o<a;o++)n[o+1].indexField.setValue(o);i.indexField.setValue(a)}}size(){return br(this,Fn,"f").size()}isEmpty(){return this.size()===0}terminate(){Va(this,Ua,null,"f"),br(this,Fn,"f").forEach(({subscription:e})=>e.terminate()),br(this,Fn,"f").clear(),br(this,bo,"f").terminate(),br(this,$h,"f").terminate()}};Ph=new WeakMap,Fn=new WeakMap,bo=new WeakMap,$h=new WeakMap,Ua=new WeakMap;var ja;(function(t){t.names=["MetaDataBox","ProjectMetaBox","RootBox","SelectionBox","UserInterfaceBox","UploadFileBox","ShadertoyBox","MIDIControllerBox","TimelineBox","TrackBox","NoteEventBox","NoteEventRepeatBox","NoteEventCollectionBox","NoteRegionBox","NoteClipBox","ValueEventBox","ValueEventCollectionBox","ValueEventCurveBox","ValueRegionBox","ValueClipBox","SignatureEventBox","AudioRegionBox","AudioClipBox","AudioPitchStretchBox","AudioTimeStretchBox","TransientMarkerBox","WarpMarkerBox","MarkerBox","AudioFileBox","SoundfontFileBox","NeuralAmpModelBox","AudioUnitBox","CaptureAudioBox","CaptureMidiBox","AudioBusBox","AuxSendBox","GrooveShuffleBox","UnknownAudioEffectDeviceBox","UnknownMidiEffectDeviceBox","DeviceInterfaceKnobBox","ModularDeviceBox","StereoToolDeviceBox","MaximizerDeviceBox","CompressorDeviceBox","GateDeviceBox","DelayDeviceBox","CrusherDeviceBox","DattorroReverbDeviceBox","VelocityDeviceBox","FoldDeviceBox","TidalDeviceBox","RevampDeviceBox","ReverbDeviceBox","VaporisateurDeviceBox","MIDIOutputDeviceBox","MIDIOutputBox","MIDIOutputParameterBox","SoundfontDeviceBox","NanoDeviceBox","PlayfieldDeviceBox","PlayfieldSampleBox","TapeDeviceBox","ArpeggioDeviceBox","PitchDeviceBox","ZeitgeistDeviceBox","NeuralAmpDeviceBox","VocoderDeviceBox","WaveshaperDeviceBox","WerkstattDeviceBox","WerkstattParameterBox","WerkstattSampleBox","SpielwerkDeviceBox","ApparatDeviceBox","NoopInstrumentBox","CompositeDeviceBox","CompositeCellBox","ModularBox","ModuleConnectionBox","ModularAudioInputBox","ModularAudioOutputBox","ModuleDelayBox","ModuleMultiplierBox","ModuleGainBox"],t.create=(e,r,n,i)=>{switch(e){case"MetaDataBox":return En.create(r,n,i);case"ProjectMetaBox":return kh.create(r,n,i);case"RootBox":return _o.create(r,n,i);case"SelectionBox":return ia.create(r,n,i);case"UserInterfaceBox":return Ka.create(r,n,i);case"UploadFileBox":return Mh.create(r,n,i);case"ShadertoyBox":return Nh.create(r,n,i);case"MIDIControllerBox":return Ih.create(r,n,i);case"TimelineBox":return Rs.create(r,n,i);case"TrackBox":return Nr.create(r,n,i);case"NoteEventBox":return Ao.create(r,n,i);case"NoteEventRepeatBox":return Bh.create(r,n,i);case"NoteEventCollectionBox":return Wa.create(r,n,i);case"NoteRegionBox":return Cs.create(r,n,i);case"NoteClipBox":return fu.create(r,n,i);case"ValueEventBox":return Sn.create(r,n,i);case"ValueEventCollectionBox":return Pn.create(r,n,i);case"ValueEventCurveBox":return Fo.create(r,n,i);case"ValueRegionBox":return zs.create(r,n,i);case"ValueClipBox":return mu.create(r,n,i);case"SignatureEventBox":return hu.create(r,n,i);case"AudioRegionBox":return Eo.create(r,n,i);case"AudioClipBox":return gu.create(r,n,i);case"AudioPitchStretchBox":return vu.create(r,n,i);case"AudioTimeStretchBox":return xu.create(r,n,i);case"TransientMarkerBox":return Th.create(r,n,i);case"WarpMarkerBox":return So.create(r,n,i);case"MarkerBox":return yu.create(r,n,i);case"AudioFileBox":return Li.create(r,n,i);case"SoundfontFileBox":return na.create(r,n,i);case"NeuralAmpModelBox":return Dh.create(r,n,i);case"AudioUnitBox":return Xe.create(r,n,i);case"CaptureAudioBox":return aa.create(r,n,i);case"CaptureMidiBox":return oa.create(r,n,i);case"AudioBusBox":return $n.create(r,n,i);case"AuxSendBox":return wu.create(r,n,i);case"GrooveShuffleBox":return bu.create(r,n,i);case"UnknownAudioEffectDeviceBox":return Rh.create(r,n,i);case"UnknownMidiEffectDeviceBox":return Ch.create(r,n,i);case"DeviceInterfaceKnobBox":return zh.create(r,n,i);case"ModularDeviceBox":return Oh.create(r,n,i);case"StereoToolDeviceBox":return Vh.create(r,n,i);case"MaximizerDeviceBox":return _u.create(r,n,i);case"CompressorDeviceBox":return Uh.create(r,n,i);case"GateDeviceBox":return jh.create(r,n,i);case"DelayDeviceBox":return Kh.create(r,n,i);case"CrusherDeviceBox":return Wh.create(r,n,i);case"DattorroReverbDeviceBox":return Lh.create(r,n,i);case"VelocityDeviceBox":return Zh.create(r,n,i);case"FoldDeviceBox":return Gh.create(r,n,i);case"TidalDeviceBox":return Hh.create(r,n,i);case"RevampDeviceBox":return qh.create(r,n,i);case"ReverbDeviceBox":return Jh.create(r,n,i);case"VaporisateurDeviceBox":return Au.create(r,n,i);case"MIDIOutputDeviceBox":return Fu.create(r,n,i);case"MIDIOutputBox":return Po.create(r,n,i);case"MIDIOutputParameterBox":return Os.create(r,n,i);case"SoundfontDeviceBox":return Eu.create(r,n,i);case"NanoDeviceBox":return Su.create(r,n,i);case"PlayfieldDeviceBox":return Pu.create(r,n,i);case"PlayfieldSampleBox":return $o.create(r,n,i);case"TapeDeviceBox":return $u.create(r,n,i);case"ArpeggioDeviceBox":return Xh.create(r,n,i);case"PitchDeviceBox":return Yh.create(r,n,i);case"ZeitgeistDeviceBox":return Qh.create(r,n,i);case"NeuralAmpDeviceBox":return eg.create(r,n,i);case"VocoderDeviceBox":return tg.create(r,n,i);case"WaveshaperDeviceBox":return rg.create(r,n,i);case"WerkstattDeviceBox":return ig.create(r,n,i);case"WerkstattParameterBox":return sa.create(r,n,i);case"WerkstattSampleBox":return Vs.create(r,n,i);case"SpielwerkDeviceBox":return ng.create(r,n,i);case"ApparatDeviceBox":return ku.create(r,n,i);case"NoopInstrumentBox":return Mu.create(r,n,i);case"CompositeDeviceBox":return ag.create(r,n,i);case"CompositeCellBox":return og.create(r,n,i);case"ModularBox":return sg.create(r,n,i);case"ModuleConnectionBox":return lg.create(r,n,i);case"ModularAudioInputBox":return ug.create(r,n,i);case"ModularAudioOutputBox":return cg.create(r,n,i);case"ModuleDelayBox":return dg.create(r,n,i);case"ModuleMultiplierBox":return pg.create(r,n,i);case"ModuleGainBox":return fg.create(r,n,i);default:return V(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new rt(r),i=n.readString(),a=k.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(ja||(ja={}));var En=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MetaDataBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MetaDataBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitMetaDataBox,this)}get tags(){return t.Tags}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:p},l.MetaData,!0),2:B.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:p},"{}")}}};var kh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ProjectMetaBox",pointerRules:{accepts:[l.ProjectMeta],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ProjectMetaBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitProjectMetaBox,this)}get tags(){return t.Tags}get projectName(){return this.getField(1)}get artist(){return this.getField(2)}get description(){return this.getField(3)}get tagList(){return this.getField(4)}get notepad(){return this.getField(5)}get created(){return this.getField(6)}get modified(){return this.getField(7)}get coverId(){return this.getField(8)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"projectName",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"artist",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"description",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"tagList",deprecated:!1,pointerRules:p},"[]"),5:B.create({parent:this,fieldKey:5,fieldName:"notepad",deprecated:!1,pointerRules:p}),6:B.create({parent:this,fieldKey:6,fieldName:"created",deprecated:!1,pointerRules:p}),7:B.create({parent:this,fieldKey:7,fieldName:"modified",deprecated:!1,pointerRules:p}),8:B.create({parent:this,fieldKey:8,fieldName:"coverId",deprecated:!1,pointerRules:p})}}};var mg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get keyboard(){return this.getField(1)}get timeRangeInQuarters(){return this.getField(2)}get noteScale(){return this.getField(3)}get noteLabels(){return this.getField(4)}get transpose(){return this.getField(5)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:F.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:F.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:R.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:$.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var _o=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RootBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RootBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitRootBox,this)}get tags(){return t.Tags}get timeline(){return this.getField(1)}get users(){return this.getField(2)}get created(){return this.getField(3)}get groove(){return this.getField(4)}get baseFrequency(){return this.getField(5)}get modularSetups(){return this.getField(10)}get audioUnits(){return this.getField(20)}get audioBusses(){return this.getField(21)}get outputDevice(){return this.getField(30)}get outputMidiDevices(){return this.getField(35)}get pianoMode(){return this.getField(40)}get shadertoy(){return this.getField(100)}get projectMeta(){return this.getField(101)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:H.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!1,exclusive:!1}}),3:B.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:M.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:F.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:H.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:H.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:H.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:H.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:H.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:mg.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:M.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:M.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:M.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};var ia=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SelectionBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="SelectionBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};var Ka=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UserInterfaceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitUserInterfaceBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get selection(){return this.getField(10)}get uploadStates(){return this.getField(11)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}get midiControllers(){return this.getField(30)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:H.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:H.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:M.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:M.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:M.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:H.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var Mh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UploadFileBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="UploadFileBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:M.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};var Nh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[l.Shadertoy],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ShadertoyBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitShadertoyBox,this)}get tags(){return t.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:p}),2:R.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};var Ih=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIControllerBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="MIDIControllerBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitMIDIControllerBox,this)}get tags(){return t.Tags}get controllers(){return this.getField(1)}get parameter(){return this.getField(2)}get deviceId(){return this.getField(3)}get deviceChannel(){return this.getField(4)}get controlId(){return this.getField(5)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:M.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.MIDIControl,!0),3:B.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:p}),4:$.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:$.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};var hg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:$.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var gg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get from(){return this.getField(2)}get to(){return this.getField(3)}initializeFields(){return{1:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:$.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:$.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var vg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get markers(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:$.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var xg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get minBpm(){return this.getField(15)}get maxBpm(){return this.getField(16)}get enabled(){return this.getField(20)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:$.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:$.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:$.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var yg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:$.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Rs=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TimelineBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TimelineBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitTimelineBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get signature(){return this.getField(10)}get loopArea(){return this.getField(11)}get deprecatedMarkerTrack(){return this.getField(20)}get markerTrack(){return this.getField(21)}get tempoTrack(){return this.getField(22)}get signatureTrack(){return this.getField(23)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:hg.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:gg.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:H.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:vg.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:xg.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:yg.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:$.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:F.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var Nr=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TrackBox",pointerRules:{accepts:[l.Selection,l.PianoMode,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TrackBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitTrackBox,this)}get tags(){return t.Tags}get tracks(){return this.getField(1)}get target(){return this.getField(2)}get regions(){return this.getField(3)}get clips(){return this.getField(4)}get index(){return this.getField(10)}get type(){return this.getField(11)}get enabled(){return this.getField(20)}get excludePianoMode(){return this.getField(30)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:H.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:H.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:$.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:$.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:R.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};var Ao=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventBox",pointerRules:{accepts:[l.Selection,l.NoteEventFeature],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitNoteEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get pitch(){return this.getField(20)}get velocity(){return this.getField(21)}get playCount(){return this.getField(22)}get playCurve(){return this.getField(23)}get cent(){return this.getField(24)}get chance(){return this.getField(25)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:$.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:F.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:$.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:F.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:F.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:$.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};var Bh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventRepeatBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventRepeatBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitNoteEventRepeatBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get count(){return this.getField(2)}get curve(){return this.getField(3)}get length(){return this.getField(4)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:$.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:F.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:F.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};var Wa=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="NoteEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:H.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var Cs=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitNoteRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get eventOffset(){return this.getField(14)}get mute(){return this.getField(15)}get label(){return this.getField(16)}get hue(){return this.getField(17)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:$.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:$.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:$.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:R.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:B.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:$.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var ko=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get loop(){return this.getField(1)}get reverse(){return this.getField(2)}get mute(){return this.getField(3)}get speed(){return this.getField(4)}get quantise(){return this.getField(5)}get trigger(){return this.getField(6)}initializeFields(){return{1:R.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:R.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:R.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:$.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:$.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:$.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var fu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitNoteClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ko.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:$.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Sn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitValueEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get index(){return this.getField(11)}get interpolation(){return this.getField(12)}get value(){return this.getField(13)}get slope(){return this.getField(14)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:$.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:F.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:F.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};var Pn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="ValueEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:H.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Fo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCurveBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventCurveBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:F.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};var zs=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitValueRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:$.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:$.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:$.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:B.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:$.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var mu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitValueClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ko.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:$.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var hu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SignatureEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitSignatureEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get index(){return this.getField(9)}get relativePosition(){return this.getField(10)}get nominator(){return this.getField(21)}get denominator(){return this.getField(22)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:$.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:$.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:$.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:$.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};var wg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get in(){return this.getField(1)}get out(){return this.getField(2)}get inSlope(){return this.getField(3)}get outSlope(){return this.getField(4)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:F.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:F.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:F.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var Eo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAudioRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}get timeBase(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}get gain(){return this.getField(17)}get fading(){return this.getField(18)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:B.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),5:M.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:M.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:F.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:M.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:$.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:F.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"any","mixed"),12:F.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:F.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:B.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:$.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:F.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:wg.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};var gu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAudioClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}get gain(){return this.getField(14)}get playback(){return this.getField(20)}get timeBase(){return this.getField(21)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ko.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:M.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:M.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:F.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:M.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:F.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:$.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:F.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),20:B.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:p}),21:B.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical")}}};var vu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioPitchStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var xu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioTimeStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAudioTimeStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:$.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:F.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};var Th=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TransientMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:F.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var So=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WarpMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitWarpMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:$.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:F.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var yu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MarkerBox",pointerRules:{accepts:[l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitMarkerBox,this)}get tags(){return t.Tags}get track(){return this.getField(1)}get position(){return this.getField(2)}get plays(){return this.getField(3)}get label(){return this.getField(4)}get hue(){return this.getField(5)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:$.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:$.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},"non-negative","",1),4:B.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:$.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Li=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioFileBox",pointerRules:{accepts:[l.AudioFile,l.FileUploadState,l.MetaData],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="AudioFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAudioFileBox,this)}get tags(){return t.Tags}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}get transientMarkers(){return this.getField(10)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:F.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),3:B.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p}),10:H.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var na=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[l.SoundfontFile],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="SoundfontFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitSoundfontFileBox,this)}get tags(){return t.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};var Dh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpModelBox",pointerRules:{accepts:[l.NeuralAmpModel],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="NeuralAmpModelBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitNeuralAmpModelBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get model(){return this.getField(2)}get packId(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"packId",deprecated:!1,pointerRules:p})}}};var Xe=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[l.Selection,l.Automation,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioUnitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAudioUnitBox,this)}get tags(){return t.Tags}get type(){return this.getField(1)}get collection(){return this.getField(2)}get editing(){return this.getField(3)}get index(){return this.getField(11)}get volume(){return this.getField(12)}get panning(){return this.getField(13)}get mute(){return this.getField(14)}get solo(){return this.getField(15)}get tracks(){return this.getField(20)}get midiEffects(){return this.getField(21)}get input(){return this.getField(22)}get audioEffects(){return this.getField(23)}get auxSends(){return this.getField(24)}get output(){return this.getField(25)}get capture(){return this.getField(26)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:p},"instrument"),2:M.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:H.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:$.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:F.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:F.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:R.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:H.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:H.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:H.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:H.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:H.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:M.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:M.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1)}}};var aa=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureAudioBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitCaptureAudioBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}get inputLatency(){return this.getField(12)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:$.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:F.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};var oa=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureMidiBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitCaptureMidiBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:$.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};var $n=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioBusBox",pointerRules:{accepts:[l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioBusBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAudioBusBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get output(){return this.getField(2)}get input(){return this.getField(3)}get enabled(){return this.getField(4)}get icon(){return this.getField(5)}get label(){return this.getField(6)}get color(){return this.getField(7)}get minimized(){return this.getField(8)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:M.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:H.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:B.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:B.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:R.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var wu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AuxSendBox",pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AuxSendBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitAuxSendBox,this)}get tags(){return t.Tags}get audioUnit(){return this.getField(1)}get targetBus(){return this.getField(2)}get index(){return this.getField(3)}get routing(){return this.getField(4)}get sendGain(){return this.getField(5)}get sendPan(){return this.getField(6)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:M.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:$.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:F.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:F.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var bu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[l.Groove],mandatory:!0,exclusive:!1},resource:"internal",ephemeral:!1}),n)}static ClassName="GrooveShuffleBox";static Resource="internal";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitGrooveShuffleBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),10:F.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:$.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"non-negative","ppqn",480)}}};var Rh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownAudioEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitUnknownAudioEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Ch=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownMidiEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return S(e.visitUnknownMidiEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var zh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="DeviceInterfaceKnobBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitDeviceInterfaceKnobBox,this)}get tags(){return t.Tags}get userInterface(){return this.getField(1)}get parameter(){return this.getField(2)}get index(){return this.getField(3)}get anchor(){return this.getField(10)}get color(){return this.getField(11)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:M.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:$.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:F.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p},"unipolar","%"),11:B.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};var bg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:H.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var Oh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitModularDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modularSetup(){return this.getField(10)}get userInterface(){return this.getField(11)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:bg.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var Vh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoToolDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitStereoToolDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get panning(){return this.getField(11)}get stereo(){return this.getField(12)}get invertL(){return this.getField(13)}get invertR(){return this.getField(14)}get swap(){return this.getField(15)}get panningMixing(){return this.getField(20)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:F.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:F.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:R.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:R.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:R.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:$.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};var _u=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MaximizerDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitMaximizerDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get threshold(){return this.getField(11)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:R.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:F.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:0,scaling:"linear"},"dB",0)}}};var Uh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompressorDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitCompressorDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get automakeup(){return this.getField(11)}get autoattack(){return this.getField(12)}get autorelease(){return this.getField(13)}get inputgain(){return this.getField(14)}get threshold(){return this.getField(15)}get ratio(){return this.getField(16)}get knee(){return this.getField(17)}get attack(){return this.getField(18)}get release(){return this.getField(19)}get makeup(){return this.getField(20)}get mix(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:R.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:R.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:R.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:R.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:F.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:F.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:F.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:F.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:F.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:F.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:F.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:F.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:M.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var jh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GateDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="GateDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitGateDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get threshold(){return this.getField(10)}get return(){return this.getField(11)}get attack(){return this.getField(12)}get hold(){return this.getField(13)}get release(){return this.getField(14)}get floor(){return this.getField(15)}get inverse(){return this.getField(16)}get sideChain(){return this.getField(30)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-6),11:F.create({parent:this,fieldKey:11,fieldName:"return",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",1),13:F.create({parent:this,fieldKey:13,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:500,scaling:"linear"},"ms",50),14:F.create({parent:this,fieldKey:14,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:2e3,scaling:"linear"},"ms",100),15:F.create({parent:this,fieldKey:15,fieldName:"floor",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,max:0,scaling:"linear"},"dB",-72),16:R.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:M.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Kh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DelayDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitDelayDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get delayMusical(){return this.getField(10)}get feedback(){return this.getField(11)}get cross(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}get preSyncTimeLeft(){return this.getField(16)}get preMillisTimeLeft(){return this.getField(17)}get preSyncTimeRight(){return this.getField(19)}get preMillisTimeRight(){return this.getField(20)}get delayMillis(){return this.getField(22)}get lfoSpeed(){return this.getField(23)}get lfoDepth(){return this.getField(24)}get version(){return this.getField(99)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:F.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:F.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:F.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),15:F.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),16:F.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:F.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:F.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:F.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:F.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:F.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:F.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:$.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Wh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CrusherDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitCrusherDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get crush(){return this.getField(10)}get bits(){return this.getField(11)}get boost(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:$.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"bits",16),12:F.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:F.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Lh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DattorroReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitDattorroReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get preDelay(){return this.getField(10)}get bandwidth(){return this.getField(11)}get inputDiffusion1(){return this.getField(12)}get inputDiffusion2(){return this.getField(13)}get decay(){return this.getField(14)}get decayDiffusion1(){return this.getField(15)}get decayDiffusion2(){return this.getField(16)}get damping(){return this.getField(17)}get excursionRate(){return this.getField(18)}get excursionDepth(){return this.getField(19)}get wet(){return this.getField(20)}get dry(){return this.getField(21)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:F.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:F.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:F.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:F.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:F.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:F.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:F.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:F.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:F.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:F.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),21:F.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Zh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VelocityDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return S(e.visitVelocityDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get magnetPosition(){return this.getField(10)}get magnetStrength(){return this.getField(11)}get randomSeed(){return this.getField(12)}get randomAmount(){return this.getField(13)}get offset(){return this.getField(14)}get mix(){return this.getField(15)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:F.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:$.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:F.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:F.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:F.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Gh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FoldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitFoldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get drive(){return this.getField(10)}get overSampling(){return this.getField(11)}get volume(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:$.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:F.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var Hh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TidalDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitTidalDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get slope(){return this.getField(10)}get symmetry(){return this.getField(11)}get rate(){return this.getField(20)}get depth(){return this.getField(21)}get offset(){return this.getField(22)}get channelOffset(){return this.getField(23)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:F.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:F.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",3),21:F.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:F.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:F.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var Xd=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get order(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:$.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:F.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Yd=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}initializeFields(){return{1:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:F.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var Nu=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:F.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:F.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var qh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RevampDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitRevampDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get highPass(){return this.getField(10)}get lowShelf(){return this.getField(11)}get lowBell(){return this.getField(12)}get midBell(){return this.getField(13)}get highBell(){return this.getField(14)}get highShelf(){return this.getField(15)}get lowPass(){return this.getField(16)}get gain(){return this.getField(17)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Xd.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Yd.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:Nu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:Nu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:Nu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Yd.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:Xd.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:F.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Jh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get decay(){return this.getField(10)}get preDelay(){return this.getField(11)}get damp(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:F.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:F.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:F.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:F.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var _g=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get volume(){return this.getField(2)}get octave(){return this.getField(3)}get tune(){return this.getField(4)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:F.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",-1/0),3:$.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),4:F.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var Ag=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get rate(){return this.getField(2)}get sync(){return this.getField(3)}get targetTune(){return this.getField(10)}get targetCutoff(){return this.getField(11)}get targetVolume(){return this.getField(12)}initializeFields(){return{1:$.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:F.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:R.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:F.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:F.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:F.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var Fg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get attack(){return this.getField(1)}get hold(){return this.getField(2)}get release(){return this.getField(3)}get volume(){return this.getField(4)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:F.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:F.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:F.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",.001)}}};var Au=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VaporisateurDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return S(e.visitVaporisateurDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get octave(){return this.getField(11)}get tune(){return this.getField(12)}get waveform(){return this.getField(13)}get cutoff(){return this.getField(14)}get resonance(){return this.getField(15)}get attack(){return this.getField(16)}get release(){return this.getField(17)}get filterEnvelope(){return this.getField(18)}get decay(){return this.getField(19)}get sustain(){return this.getField(20)}get glideTime(){return this.getField(21)}get voicingMode(){return this.getField(22)}get unisonCount(){return this.getField(23)}get unisonDetune(){return this.getField(24)}get unisonStereo(){return this.getField(25)}get filterOrder(){return this.getField(26)}get filterKeyboard(){return this.getField(27)}get lfo(){return this.getField(30)}get oscillators(){return this.getField(40)}get noise(){return this.getField(50)}get version(){return this.getField(99)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),11:$.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:F.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:$.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:F.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:F.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:F.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:F.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:F.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:F.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:F.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:F.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:$.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),23:$.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,3,5]},"",1),24:F.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:F.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:$.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,2,3,4]},"",1),27:F.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:Ag.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:_h.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>_g.create(e),2),50:Fg.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:$.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Eg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var Fu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return S(e.visitMIDIOutputDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get deprecatedDevice(){return this.getField(10)}get channel(){return this.getField(11)}get deprecatedDelay(){return this.getField(12)}get parameters(){return this.getField(13)}get device(){return this.getField(14)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Eg.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:$.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:$.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:H.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:M.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};var Po=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitMIDIOutputBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get device(){return this.getField(2)}get id(){return this.getField(3)}get label(){return this.getField(4)}get delayInMs(){return this.getField(5)}get sendTransportMessages(){return this.getField(6)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:H.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0,exclusive:!1}}),3:B.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:$.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:R.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var Os=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitMIDIOutputParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get controller(){return this.getField(3)}get value(){return this.getField(4)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:$.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:F.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var Eu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SoundfontDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return S(e.visitSoundfontDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get file(){return this.getField(10)}get presetIndex(){return this.getField(11)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:$.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};var Su=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NanoDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return S(e.visitNanoDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get file(){return this.getField(15)}get release(){return this.getField(20)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:M.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:F.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var Pu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return S(e.visitPlayfieldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get samples(){return this.getField(10)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:H.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var $o=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[l.Editing,l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes",copyable:!1});constructor(e){super(e)}accept(e){return S(e.visitPlayfieldSampleBox,this)}get tags(){return t.Tags}get device(){return this.getField(10)}get file(){return this.getField(11)}get midiEffects(){return this.getField(12)}get audioEffects(){return this.getField(13)}get index(){return this.getField(15)}get label(){return this.getField(20)}get icon(){return this.getField(21)}get enabled(){return this.getField(22)}get minimized(){return this.getField(23)}get mute(){return this.getField(40)}get solo(){return this.getField(41)}get exclude(){return this.getField(42)}get polyphone(){return this.getField(43)}get gate(){return this.getField(44)}get pitch(){return this.getField(45)}get sampleStart(){return this.getField(46)}get sampleEnd(){return this.getField(47)}get attack(){return this.getField(48)}get release(){return this.getField(49)}initializeFields(){return{10:M.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:M.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:H.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:H.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:$.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),20:B.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:p}),21:B.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:R.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:R.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:R.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:R.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:R.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:R.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:$.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),45:F.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:F.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:F.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:F.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:F.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var $u=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain,l.Automation],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TapeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return S(e.visitTapeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get flutter(){return this.getField(10)}get wow(){return this.getField(11)}get noise(){return this.getField(12)}get saturation(){return this.getField(13)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:F.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:F.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:F.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var Xh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ArpeggioDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return S(e.visitArpeggioDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modeIndex(){return this.getField(10)}get numOctaves(){return this.getField(11)}get rateIndex(){return this.getField(12)}get gate(){return this.getField(13)}get repeat(){return this.getField(14)}get velocity(){return this.getField(15)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:$.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),11:$.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:5},"oct",1),12:$.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:17},"",9),13:F.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:2,scaling:"linear"},"",1),14:$.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"",1),15:F.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var Yh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PitchDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return S(e.visitPitchDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get semiTones(){return this.getField(10)}get cents(){return this.getField(11)}get octaves(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:$.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-36,max:36},"st",0),11:F.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:$.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-7,max:7},"oct",0)}}};var Qh=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ZeitgeistDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return S(e.visitZeitgeistDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get groove(){return this.getField(10)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};var eg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeuralAmpDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitNeuralAmpDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modelJson(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mono(){return this.getField(13)}get mix(){return this.getField(14)}get model(){return this.getField(20)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:p}),11:F.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),13:R.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:F.create({parent:this,fieldKey:14,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1,scaling:"linear"},"%",1),20:M.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};var tg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VocoderDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VocoderDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitVocoderDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get carrierMinFreq(){return this.getField(10)}get carrierMaxFreq(){return this.getField(11)}get modulatorMinFreq(){return this.getField(12)}get modulatorMaxFreq(){return this.getField(13)}get qMin(){return this.getField(14)}get qMax(){return this.getField(15)}get envRelease(){return this.getField(16)}get mix(){return this.getField(17)}get bandCount(){return this.getField(18)}get modulatorSource(){return this.getField(19)}get envAttack(){return this.getField(20)}get gain(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"carrierMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),11:F.create({parent:this,fieldKey:11,fieldName:"carrierMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),12:F.create({parent:this,fieldKey:12,fieldName:"modulatorMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),13:F.create({parent:this,fieldKey:13,fieldName:"modulatorMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),14:F.create({parent:this,fieldKey:14,fieldName:"qMin",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",2),15:F.create({parent:this,fieldKey:15,fieldName:"qMax",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",20),16:F.create({parent:this,fieldKey:16,fieldName:"envRelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",30),17:F.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:$.create({parent:this,fieldKey:18,fieldName:"bandCount",deprecated:!1,pointerRules:p},{min:8,max:16},"",16),19:B.create({parent:this,fieldKey:19,fieldName:"modulatorSource",deprecated:!1,pointerRules:p},"noise-pink"),20:F.create({parent:this,fieldKey:20,fieldName:"envAttack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:100,scaling:"exponential"},"ms",5),21:F.create({parent:this,fieldKey:21,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-20,max:20,scaling:"linear"},"dB",0),30:M.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var rg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WaveshaperDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WaveshaperDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitWaveshaperDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get equation(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"equation",deprecated:!1,pointerRules:p},"hardclip"),11:F.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:40,scaling:"linear"},"dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB",0),13:F.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var ig=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return S(e.visitWerkstattDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:H.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:H.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var sa=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitWerkstattParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get value(){return this.getField(4)}get defaultValue(){return this.getField(5)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:$.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:F.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:F.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};var Vs=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattSampleBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitWerkstattSampleBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get file(){return this.getField(4)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Sample,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:$.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:M.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};var ng=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SpielwerkDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SpielwerkDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return S(e.visitSpielwerkDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:$.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:H.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:H.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var ku=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ApparatDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ApparatDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return S(e.visitApparatDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:H.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:H.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Mu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoopInstrumentBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoopInstrumentBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return S(e.visitNoopInstrumentBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};var ag=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return S(e.visitCompositeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get cells(){return this.getField(10)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:H.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};var og=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeCellBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get instrument(){return this.getField(2)}get midiEffects(){return this.getField(3)}get audioEffects(){return this.getField(4)}get index(){return this.getField(5)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:H.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:H.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:H.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:$.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};var sg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModularBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitModularBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get device(){return this.getField(2)}get editing(){return this.getField(3)}get modules(){return this.getField(11)}get connections(){return this.getField(12)}get label(){return this.getField(13)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:H.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:H.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:H.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:H.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:B.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:p})}}};var lg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleConnectionBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleConnectionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitModuleConnectionBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:M.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:M.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};var Zi=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get collection(){return this.getField(1)}get label(){return this.getField(2)}get x(){return this.getField(3)}get y(){return this.getField(4)}get collapsed(){return this.getField(5)}get removable(){return this.getField(6)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModuleCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:$.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:$.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:R.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:R.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var ug=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioInputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:H.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var cg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:H.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var dg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleDelayBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitModuleDelayBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(11)}get time(){return this.getField(20)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:H.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:H.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var pg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleMultiplierBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitModuleMultiplierBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInputX(){return this.getField(10)}get voltageInputY(){return this.getField(11)}get voltageOutput(){return this.getField(12)}get multiplier(){return this.getField(20)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:H.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:H.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:H.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};var fg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleGainBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return S(e.visitModuleGainBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(12)}get gain(){return this.getField(20)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:H.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:H.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var ai;(function(t){t.write=(e,r)=>{if(r.type==="none")e.disconnect(),e.setValue(0);else if(r.type==="linear")e.disconnect(),e.setValue(1);else if(r.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(l.ValueInterpolation).at(0)?.box;K(n)?(lb(n,Fo),n.slope.setValue(r.slope)):Fo.create(e.box.graph,k.generate(),i=>{i.slope.setValue(r.slope),i.event.refer(e)})}},t.read=e=>{let r=e.pointerHub.incoming().at(0)?.box;return K(r)?(lb(r,Fo),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?ii.None:e.getValue()===1?ii.Linear:V("Unknown Interpolation value")}})(ai||(ai={}));var Mo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qd,Iu,Tt,ep,No,tp,La=class t{constructor(e,r){this.type="value-event",Qd.set(this,new ee),Iu.set(this,void 0),Tt.set(this,void 0),ep.set(this,void 0),No.set(this,void 0),tp.set(this,!1),Mo(this,Iu,e,"f"),Mo(this,Tt,r,"f"),Mo(this,ep,Qe(this,Qd,"f").own(new nh(()=>ai.read(Qe(this,Tt,"f").interpolation))),"f");let n=()=>{Qe(this,ep,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Qe(this,Qd,"f").ownAll(Qe(this,Tt,"f").subscribe(Oe.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=se.equals(Qe(this,Tt,"f").index.address.fieldKeys,o),u=se.equals(Qe(this,Tt,"f").position.address.fieldKeys,o);s||u?a.requestSorting():a.onEventPropertyChanged()}}),Qe(this,Tt,"f").interpolation.subscribe(n),Qe(this,Tt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Qe(this,No,"f").terminate(),Mo(this,No,i.subscribe(Oe.Children,n),"f"),n()},onRemoved:()=>{Qe(this,No,"f").terminate(),Mo(this,No,fe.Empty,"f"),n()}})),Mo(this,No,Qe(this,Tt,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(Oe.Children,n)??fe.Empty,"f")}onSelected(){Mo(this,tp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Mo(this,tp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Qe(this,No,"f").terminate(),Qe(this,Qd,"f").terminate()}get box(){return Qe(this,Tt,"f")}get uuid(){return Qe(this,Tt,"f").address.uuid}get address(){return Qe(this,Tt,"f").address}get position(){return Qe(this,Tt,"f").position.getValue()}get index(){return Qe(this,Tt,"f").index.getValue()}set interpolation(e){ai.write(Qe(this,Tt,"f").interpolation,e)}get interpolation(){return Qe(this,ep,"f").get()}get value(){return Qe(this,Tt,"f").value.getValue()}get isSelected(){return Qe(this,tp,"f")}get collection(){return Qe(this,Tt,"f").events.targetVertex.map(e=>Qe(this,Iu,"f").boxAdapters.adapterFor(e.box,_r))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=Sn.create(Qe(this,Iu,"f").boxGraph,k.generate(),a=>{a.position.setValue(r),a.index.setValue(n),a.events.refer(e?.events??this.collection.unwrap("collection").box.events),a.value.setValue(e?.value??this.value)});return ai.write(i.interpolation,e?.interpolation??this.interpolation),Qe(this,Iu,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return Qe(this,Tt,"f").position.setValue(e?.position??this.position),Qe(this,Tt,"f").index.setValue(e?.index??this.index),Qe(this,Tt,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),Qe(this,Tt,"f").value.setValue(e?.value??this.value),ai.write(Qe(this,Tt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Qd=new WeakMap,Iu=new WeakMap,Tt=new WeakMap,ep=new WeakMap,No=new WeakMap,tp=new WeakMap;La.Comparator=(t,e)=>{if(t===e)return V(`${t} is equal to itself`);let r=t.position-e.position;if(r!==0)return r;let n=t.index-e.index;return n!==0?n:V(`${t} and ${e} are identical in terms of comparison`)};var rp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ye=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ip,np,Io,Gi,Us,Bu,Za,Sg,_r=class t{constructor(e,r){ip.add(this),np.set(this,new ee),Io.set(this,void 0),Gi.set(this,void 0),Us.set(this,void 0),Bu.set(this,void 0),Za.set(this,void 0),rp(this,Io,e,"f"),rp(this,Gi,r,"f"),rp(this,Us,new me,"f"),rp(this,Bu,k.newSet(i=>i.uuid),"f"),rp(this,Za,ri.create(La.Comparator),"f");let n=i=>{let a=ze(i.accept({visitValueEventBox:o=>Ye(this,Io,"f").boxAdapters.adapterFor(o,La)}),`Could not find adapter for ${i}`);Ye(this,Bu,"f").add(a)&&(Ye(this,Za,"f").add(a),Ye(this,ip,"m",Sg).call(this))};Ye(this,Gi,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Ye(this,np,"f").own(Ye(this,Gi,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Ye(this,Za,"f").remove(Ye(this,Bu,"f").removeByKey(i)),Ye(this,ip,"m",Sg).call(this)}})),Ye(this,np,"f").own(Ye(this,Gi,"f").owners.pointerHub.subscribe({onAdded:()=>Ye(this,Us,"f").notify(this),onRemoved:()=>Ye(this,Us,"f").notify(this)}))}valueAt(e,r){return bh.valueAt(Ye(this,Za,"f"),e,r)}copy(){let e=Ye(this,Io,"f").boxGraph,r=Pn.create(e,k.generate());return Ye(this,Za,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Ye(this,Io,"f").boxAdapters.adapterFor(r,t)}cut(e,r=E.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?b.None:b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return b.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return b.wrap(n);if(i.position===e)return b.wrap(i);if(n.interpolation.type==="none")return b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:a}=n,{position:o}=i,s=r.x(n.value),u=r.x(i.value),d=bS(s,u,(e-a)/(o-a));return b.wrap(this.createEvent({position:e,value:r.y(d),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:a}=n,{position:o}=i,s=r.x(n.value),u=r.x(i.value),d=o-a,m=e-a,x=Jt.byHalf(d,s,Jt.valueAt({slope:n.interpolation.slope,steps:d,y0:s,y1:u},d*.5),u),g=Jt.valueAt(x,m),w=Jt.slopeByHalf(s,Jt.valueAt(x,m*.5),g);return ai.write(n.box.interpolation,ii.Curve(w)),b.wrap(this.createEvent({position:e,value:r.y(g),index:0,interpolation:ii.Curve(Jt.slopeByHalf(g,Jt.valueAt(x,(m+d)*.5),u))}))}return V("Unknown interpolation type")}subscribeChange(e){return Ye(this,Us,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=Ye(this,Bu,"f").values().find(u=>u.position===a&&u.index===r);if(K(o)&&o.box.isAttached())return o.box.value.setValue(n),ai.write(o.box.interpolation,i),o;let s=Sn.create(Ye(this,Io,"f").boxGraph,k.generate(),u=>{u.position.setValue(e),u.index.setValue(r),u.value.setValue(n),u.events.refer(Ye(this,Gi,"f").events)});return ai.write(s.interpolation,i),Ye(this,Io,"f").boxAdapters.adapterFor(s,La)}requestSorting(){Ye(this,Za,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ye(this,ip,"m",Sg).call(this)}terminate(){Ye(this,np,"f").terminate()}get box(){return Ye(this,Gi,"f")}get uuid(){return Ye(this,Gi,"f").address.uuid}get address(){return Ye(this,Gi,"f").address}get numOwners(){return Ye(this,Gi,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Ye(this,Za,"f")}toString(){return`{ValueEventCollectionBox ${k.toString(Ye(this,Gi,"f").address.uuid)}}`}};np=new WeakMap,Io=new WeakMap,Gi=new WeakMap,Us=new WeakMap,Bu=new WeakMap,Za=new WeakMap,ip=new WeakSet,Sg=function(){Ye(this,Us,"f").notify(this)};var js=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ce=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ks,Bo,Ws,Qt,Ls,sp,ap,op,Tu,To=class{constructor(e,r){Ks.add(this),this.type="value-clip",Bo.set(this,new ee),Ws.set(this,void 0),Qt.set(this,void 0),Ls.set(this,void 0),sp.set(this,void 0),ap.set(this,void 0),op.set(this,fe.Empty),js(this,Ws,e,"f"),js(this,Qt,r,"f"),js(this,ap,!0,"f"),js(this,Ls,Ce(this,Bo,"f").own(new Wi(!1)),"f"),js(this,sp,Ce(this,Bo,"f").own(new me),"f"),Ce(this,Bo,"f").own(Ce(this,Qt,"f").pointerHub.subscribe({onAdded:()=>Ce(this,Ks,"m",Tu).call(this),onRemoved:()=>Ce(this,Ks,"m",Tu).call(this)})),Ce(this,Bo,"f").own(Ce(this,Qt,"f").subscribe(Oe.Children,n=>Ce(this,Ks,"m",Tu).call(this))),Ce(this,Bo,"f").own(Ce(this,Qt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ce(this,op,"f").terminate(),js(this,op,n.match({none:()=>fe.Empty,some:({box:i})=>Ce(this,Ws,"f").boxAdapters.adapterFor(i,_r).subscribeChange(()=>Ce(this,Ks,"m",Tu).call(this))}),"f"),Ce(this,Ks,"m",Tu).call(this)})),js(this,ap,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return Ce(this,Ls,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ce(this,sp,"f").subscribe(e)}accept(e){return S(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ce(this,Qt,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ce(this,Qt,"f").events.targetVertex.unwrap("events.target");mu.create(Ce(this,Ws,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ce(this,Qt,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ce(this,Ls,"f").setValue(!0)}onDeselected(){Ce(this,Ls,"f").setValue(!1)}get isSelected(){return Ce(this,Ls,"f").getValue()}terminate(){Ce(this,op,"f").terminate(),Ce(this,Bo,"f").terminate()}get box(){return Ce(this,Qt,"f")}get uuid(){return Ce(this,Qt,"f").address.uuid}get address(){return Ce(this,Qt,"f").address}get indexField(){return Ce(this,Qt,"f").index}get duration(){return Ce(this,Qt,"f").duration.getValue()}get mute(){return Ce(this,Qt,"f").mute.getValue()}get hue(){return Ce(this,Qt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ce(this,Qt,"f").events.targetVertex.map(e=>Ce(this,Ws,"f").boxAdapters.adapterFor(e.box,_r))}get label(){return Ce(this,Qt,"f").label.getValue()}get trackBoxAdapter(){return Ce(this,ap,"f")?b.None:Ce(this,Qt,"f").clips.targetVertex.map(e=>Ce(this,Ws,"f").boxAdapters.adapterFor(e.box,er))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${k.toString(Ce(this,Qt,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};Bo=new WeakMap,Ws=new WeakMap,Qt=new WeakMap,Ls=new WeakMap,sp=new WeakMap,ap=new WeakMap,op=new WeakMap,Ks=new WeakSet,Tu=function(){Ce(this,sp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var zS=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Du=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$b,Zs,Pg,Ru=class{constructor(e){this.type="transient-marker",$b.set(this,new ee),Zs.set(this,void 0),Pg.set(this,void 0),zS(this,Zs,e,"f"),zS(this,Pg,new me,"f")}get box(){return Du(this,Zs,"f")}get uuid(){return Du(this,Zs,"f").address.uuid}get address(){return Du(this,Zs,"f").address}get position(){return Du(this,Zs,"f").position.getValue()}subscribe(e){return Du(this,Pg,"f").subscribe(e)}terminate(){Du(this,$b,"f").terminate()}};$b=new WeakMap,Zs=new WeakMap,Pg=new WeakMap;var lp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ar=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$g,up,la,cp,Cu,kg,kn=class t{constructor(e,r){$g.set(this,new ee),up.set(this,void 0),la.set(this,void 0),cp.set(this,void 0),Cu.set(this,void 0),kg.set(this,void 0),lp(this,up,e,"f"),lp(this,la,r,"f"),lp(this,cp,k.newSet(({uuid:n})=>n),"f"),lp(this,Cu,ri.create(t.Comparator),"f"),lp(this,kg,fh.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:a}=Promise.withResolvers(),o=this.getOrCreateLoader(),s=o.subscribe(u=>{u.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(o.data.unwrap("State mismatch"))):u.type==="error"&&(queueMicrotask(()=>s.terminate()),a(new Error(u.reason)))});return n}),"f"),Ar(this,$g,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Ar(this,up,"f").boxAdapters.adapterFor(n.box,Ru);Ar(this,cp,"f").add(i)&&Ar(this,Cu,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Ar(this,Cu,"f").remove(Ar(this,cp,"f").removeByKey(n))}}))}get box(){return Ar(this,la,"f")}get uuid(){return Ar(this,la,"f").address.uuid}get address(){return Ar(this,la,"f").address}get startInSeconds(){return Ar(this,la,"f").startInSeconds.getValue()}get endInSeconds(){return Ar(this,la,"f").endInSeconds.getValue()}get transients(){return Ar(this,Cu,"f")}get fileName(){return Ar(this,la,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Ar(this,kg,"f").call(this)}getOrCreateLoader(){return Ar(this,up,"f").sampleManager.getOrCreate(Ar(this,la,"f").address.uuid)}terminate(){Ar(this,$g,"f").terminate()}};$g=new WeakMap,up=new WeakMap,la=new WeakMap,cp=new WeakMap,Cu=new WeakMap,kg=new WeakMap;kn.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),V("Events at the same position: "+t.position+", "+e.position)):r};var dp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pp,Mg,Ng,Ga,mp,fp,Ig,Do=class{constructor(e,r){pp.add(this),this.type="warp-marker",Mg.set(this,new ee),Ng.set(this,void 0),Ga.set(this,void 0),mp.set(this,void 0),fp.set(this,!1),dp(this,Ng,e,"f"),dp(this,Ga,r,"f"),dp(this,mp,new me,"f"),Wr(this,Mg,"f").own(r.subscribe(Oe.Children,()=>Wr(this,pp,"m",Ig).call(this)))}onSelected(){dp(this,fp,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Wr(this,pp,"m",Ig).call(this)}onDeselected(){dp(this,fp,!1,"f"),Wr(this,pp,"m",Ig).call(this)}get box(){return Wr(this,Ga,"f")}get uuid(){return Wr(this,Ga,"f").address.uuid}get address(){return Wr(this,Ga,"f").address}get position(){return Wr(this,Ga,"f").position.getValue()}get seconds(){return Wr(this,Ga,"f").seconds.getValue()}get isSelected(){return Wr(this,fp,"f")}get optWarping(){return Wr(this,Ga,"f").owner.targetVertex.map(e=>Wr(this,Ng,"f").boxAdapters.adapterFor(e.box,ua.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Wr(this,mp,"f").subscribe(e)}terminate(){Wr(this,Mg,"f").terminate()}};Mg=new WeakMap,Ng=new WeakMap,Ga=new WeakMap,mp=new WeakMap,fp=new WeakMap,pp=new WeakSet,Ig=function(){Wr(this,mp,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var Bg=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),V("Events at the same position: "+t.position+", "+e.position)):r};var hp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ir=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tg,Dg,Gs,Hs,gp,zu,ca=class{constructor(e,r){Tg.set(this,new ee),Dg.set(this,void 0),Gs.set(this,void 0),Hs.set(this,void 0),gp.set(this,void 0),zu.set(this,void 0),hp(this,Dg,e,"f"),hp(this,Gs,r,"f"),hp(this,Hs,new me,"f"),hp(this,gp,k.newSet(({uuid:n})=>n),"f"),hp(this,zu,ri.create(Bg),"f"),Ir(this,Tg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Ir(this,Dg,"f").boxAdapters.adapterFor(n.box,Do);Ir(this,gp,"f").add(i)&&(Ir(this,zu,"f").add(i),Ir(this,Hs,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Ir(this,zu,"f").remove(Ir(this,gp,"f").removeByKey(n)),Ir(this,Hs,"f").notify()}}))}get box(){return Ir(this,Gs,"f")}get uuid(){return Ir(this,Gs,"f").address.uuid}get address(){return Ir(this,Gs,"f").address}get warpMarkers(){return Ir(this,zu,"f")}clone(){let e=vu.create(Ir(this,Gs,"f").graph,k.generate());return this.warpMarkers.asArray().forEach(r=>So.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Ir(this,Hs,"f").subscribe(e)}onChanged(){Ir(this,Hs,"f").notify()}terminate(){Ir(this,Tg,"f").terminate()}};Tg=new WeakMap,Dg=new WeakMap,Gs=new WeakMap,Hs=new WeakMap,gp=new WeakMap,zu=new WeakMap;var vp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},tr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Rg,Cg,Mn,qs,xp,Ou,da=class{constructor(e,r){Rg.set(this,new ee),Cg.set(this,void 0),Mn.set(this,void 0),qs.set(this,void 0),xp.set(this,void 0),Ou.set(this,void 0),vp(this,Cg,e,"f"),vp(this,Mn,r,"f"),vp(this,qs,new me,"f"),vp(this,xp,k.newSet(({uuid:n})=>n),"f"),vp(this,Ou,ri.create(Bg),"f"),tr(this,Rg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=tr(this,Cg,"f").boxAdapters.adapterFor(n.box,Do);tr(this,xp,"f").add(i)&&(tr(this,Ou,"f").add(i),tr(this,qs,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{tr(this,Ou,"f").remove(tr(this,xp,"f").removeByKey(n)),tr(this,qs,"f").notify()}}))}get box(){return tr(this,Mn,"f")}get uuid(){return tr(this,Mn,"f").address.uuid}get address(){return tr(this,Mn,"f").address}get warpMarkers(){return tr(this,Ou,"f")}get playbackRate(){return tr(this,Mn,"f").playbackRate.getValue()}get cents(){return Math.log2(tr(this,Mn,"f").playbackRate.getValue())*1200}set cents(e){tr(this,Mn,"f").playbackRate.setValue(at(2**(e/1200),.5,2))}get transientPlayMode(){return Da(tr(this,Mn,"f").transientPlayMode.getValue(),Sh)}clone(){let e=xu.create(tr(this,Mn,"f").graph,k.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>So.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return tr(this,qs,"f").subscribe(e)}onChanged(){tr(this,qs,"f").notify()}terminate(){tr(this,Rg,"f").terminate()}};Rg=new WeakMap,Cg=new WeakMap,Mn=new WeakMap,qs=new WeakMap,xp=new WeakMap,Ou=new WeakMap;var ua;(function(t){t.isAudioPlayMode=e=>e instanceof ca||e instanceof da})(ua||(ua={}));var Ai=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ge=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Js,Vu,Xs,Dt,Ys,Qs,yp,bp,wp,Ro,Uu,ju,Ku,Wu=class{constructor(e,r){Js.add(this),this.type="audio-clip",Vu.set(this,new ee),Xs.set(this,void 0),Dt.set(this,void 0),Ys.set(this,void 0),Qs.set(this,void 0),yp.set(this,void 0),bp.set(this,void 0),wp.set(this,void 0),Ro.set(this,b.None),Uu.set(this,b.None),ju.set(this,fe.Empty),Ai(this,Xs,e,"f"),Ai(this,Dt,r,"f"),Ai(this,wp,!0,"f"),Ai(this,Ys,new wr,"f"),Ai(this,Qs,ge(this,Vu,"f").own(new Wi(!1)),"f"),Ai(this,yp,Ps.aware(e.tempoMap,r.timeBase,r.duration),"f"),Ai(this,bp,ge(this,Vu,"f").own(new me),"f"),ge(this,Vu,"f").ownAll(ge(this,Dt,"f").pointerHub.subscribe({onAdded:()=>ge(this,Js,"m",Ku).call(this),onRemoved:()=>ge(this,Js,"m",Ku).call(this)}),ge(this,Dt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{ge(this,ju,"f").terminate(),n.match({none:()=>ge(this,Ys,"f").clear(),some:({box:i})=>{let a=ge(this,Xs,"f").boxAdapters.adapterFor(i,ua.isAudioPlayMode);Ai(this,ju,a.subscribe(()=>ge(this,Js,"m",Ku).call(this)),"f"),ge(this,Ys,"f").wrap(a)}})}),ge(this,Dt,"f").file.catchupAndSubscribe(n=>{Ai(this,Ro,n.targetVertex.map(i=>ge(this,Xs,"f").boxAdapters.adapterFor(i.box,kn)),"f"),ge(this,Uu,"f").ifSome(i=>i.terminate()),Ai(this,Uu,ge(this,Ro,"f").map(i=>i.getOrCreateLoader().subscribe(()=>ge(this,Js,"m",Ku).call(this))),"f")}),ge(this,Dt,"f").subscribe(Oe.Children,n=>ge(this,Js,"m",Ku).call(this))),Ai(this,wp,!1,"f")}catchupAndSubscribeSelected(e){return ge(this,Qs,"f").catchupAndSubscribe(e)}subscribeChange(e){return ge(this,bp,"f").subscribe(e)}accept(e){return S(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());gu.create(ge(this,Xs,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.gain.setValue(this.gain.getValue()),n.timeBase.setValue(this.timeBase),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(ge(this,Dt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(ge(this,Dt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(ge(this,Dt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){ge(this,Qs,"f").setValue(!0)}onDeselected(){ge(this,Qs,"f").setValue(!1)}get isSelected(){return ge(this,Qs,"f").getValue()}get box(){return ge(this,Dt,"f")}get uuid(){return ge(this,Dt,"f").address.uuid}get address(){return ge(this,Dt,"f").address}get indexField(){return ge(this,Dt,"f").index}get duration(){return ge(this,yp,"f").toPPQN(0)}set duration(e){ge(this,yp,"f").fromPPQN(e,0)}get mute(){return ge(this,Dt,"f").mute.getValue()}get hue(){return ge(this,Dt,"f").hue.getValue()}get gain(){return ge(this,Dt,"f").gain}get file(){return ge(this,Ro,"f").unwrap("Cannot access file.")}get optFile(){return ge(this,Ro,"f")}get observableOptPlayMode(){return ge(this,Ys,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return b.None}get timeBase(){return Da(ge(this,Dt,"f").timeBase.getValue(),Kr)}get waveformOffset(){return ge(this,Dt,"f").waveformOffset}get isPlayModeNoStretch(){return ge(this,Dt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>kt(e,ca)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>kt(e,da)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>ua.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ge(this,Ro,"f").isEmpty())return"No Audio File";let e=ge(this,Ro,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ge(this,Dt,"f").label.getValue()}get trackBoxAdapter(){return ge(this,wp,"f")?b.None:ge(this,Dt,"f").clips.targetVertex.map(e=>ge(this,Xs,"f").boxAdapters.adapterFor(e.box,er))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return ge(this,Ys,"f").nonEmpty()}terminate(){ge(this,Uu,"f").ifSome(e=>e.terminate()),Ai(this,Uu,b.None,"f"),ge(this,ju,"f").terminate(),Ai(this,ju,fe.Empty,"f"),ge(this,Vu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${k.toString(ge(this,Dt,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};Vu=new WeakMap,Xs=new WeakMap,Dt=new WeakMap,Ys=new WeakMap,Qs=new WeakMap,yp=new WeakMap,bp=new WeakMap,wp=new WeakMap,Ro=new WeakMap,Uu=new WeakMap,ju=new WeakMap,Js=new WeakSet,Ku=function(){ge(this,bp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var _p=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Lu,cr,zg,Ap,el=class t{constructor(e,r){this.type="note-event",Lu.set(this,void 0),cr.set(this,void 0),zg.set(this,void 0),Ap.set(this,!1),_p(this,Lu,e,"f"),_p(this,cr,r,"f"),_p(this,zg,Wt(this,cr,"f").subscribe(Oe.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=se.equals(Wt(this,cr,"f").pitch.address.fieldKeys,a),s=se.equals(Wt(this,cr,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){_p(this,Ap,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){_p(this,Ap,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Wt(this,zg,"f").terminate()}get box(){return Wt(this,cr,"f")}get uuid(){return Wt(this,cr,"f").address.uuid}get address(){return Wt(this,cr,"f").address}get position(){return Wt(this,cr,"f").position.getValue()}get duration(){return Wt(this,cr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Wt(this,cr,"f").velocity.getValue()}get pitch(){return Wt(this,cr,"f").pitch.getValue()}get cent(){return Wt(this,cr,"f").cent.getValue()}get chance(){return Wt(this,cr,"f").chance.getValue()}get playCount(){return Wt(this,cr,"f").playCount.getValue()}get playCurve(){return Wt(this,cr,"f").playCurve.getValue()}get isSelected(){return Wt(this,Ap,"f")}get collection(){return Wt(this,cr,"f").events.targetVertex.map(e=>Wt(this,Lu,"f").boxAdapters.adapterFor(e.box,Hi))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:r}=this.collection.unwrap();return e===r?.5:1-(this.pitch-e)/(r-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return Wt(this,Lu,"f").boxAdapters.adapterFor(Ao.create(Wt(this,Lu,"f").boxGraph,k.generate(),r=>{r.position.setValue(e?.position??this.position),r.duration.setValue(e?.duration??this.duration),r.pitch.setValue(e?.pitch??this.pitch),r.playCount.setValue(e?.playCount??this.playCount),r.events.refer(e?.events??this.collection.unwrap("collection").box.events),r.velocity.setValue(this.velocity),r.cent.setValue(this.cent),r.chance.setValue(this.chance)}),t)}computeCurveValue(e){return cu.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=se.create(i=>{let a=Math.floor(this.computeCurveValue(i/e)*this.duration),o=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+a),duration:Math.max(1,o-a),playCount:1,events:r})},e);return Wt(this,cr,"f").delete(),n}};Lu=new WeakMap,cr=new WeakMap,zg=new WeakMap,Ap=new WeakMap;var pa=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ee=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ha,Fp,Co,Nn,tl,Ep,oi,Vg,Ug,jg,zo,Og,Sp,Hi=class t{constructor(e,r){Ha.add(this),Fp.set(this,new ee),Co.set(this,void 0),Nn.set(this,void 0),tl.set(this,void 0),Ep.set(this,void 0),oi.set(this,void 0),Vg.set(this,60),Ug.set(this,60),jg.set(this,0),zo.set(this,!1),pa(this,Co,e,"f"),pa(this,Nn,r,"f"),pa(this,tl,new me,"f"),pa(this,Ep,k.newSet(n=>n.uuid),"f"),pa(this,oi,ri.create(cu.Comparator),"f"),Ee(this,Fp,"f").own(Ee(this,Nn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Ee(this,Co,"f").boxAdapters.adapterFor(n,el);Ee(this,Ep,"f").add(i)&&(Ee(this,oi,"f").add(i),Ee(this,Ha,"m",Og).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Ee(this,oi,"f").remove(Ee(this,Ep,"f").removeByKey(n)),Ee(this,Ha,"m",Og).call(this)}})),Ee(this,Fp,"f").own(Ee(this,Nn,"f").owners.pointerHub.subscribe({onAdded:()=>Ee(this,tl,"f").notify(this),onRemoved:()=>Ee(this,tl,"f").notify(this)}))}copy(){let e=Ee(this,Co,"f").boxGraph,r=Wa.create(e,k.generate());return Ee(this,oi,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Ee(this,Co,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Ee(this,Co,"f").boxAdapters.adapterFor(Ao.create(Ee(this,Co,"f").boxGraph,k.generate(),u=>{u.position.setValue(e),u.duration.setValue(r),u.velocity.setValue(n),u.pitch.setValue(i),u.chance.setValue(a),u.playCount.setValue(o),u.cent.setValue(s),u.events.refer(Ee(this,Nn,"f").events)}),el)}subscribeChange(e){return Ee(this,tl,"f").subscribe(e)}selectable(){return Ee(this,oi,"f").asArray()}selectableAt(e){for(let r of Ee(this,oi,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return Xt.one(r);return Xt.empty()}selectablesBetween(e,r){let n=[],i=Ee(this,oi,"f").asArray(),a=Ee(this,oi,"f").ceilFirstIndex(r.u);for(let o=0;o<a;o++){let s=i[o];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=r.v&&n.push(s)}return n}overlapping(e,r,n){let i=[];for(let a of Ee(this,oi,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Ee(this,oi,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ee(this,Ha,"m",Og).call(this)}terminate(){Ee(this,Fp,"f").terminate()}get box(){return Ee(this,Nn,"f")}get uuid(){return Ee(this,Nn,"f").address.uuid}get address(){return Ee(this,Nn,"f").address}get numOwners(){return Ee(this,Nn,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Ee(this,zo,"f")||Ee(this,Ha,"m",Sp).call(this),Ee(this,oi,"f")}get minPitch(){return Ee(this,zo,"f")||Ee(this,Ha,"m",Sp).call(this),Ee(this,Vg,"f")}get maxPitch(){return Ee(this,zo,"f")||Ee(this,Ha,"m",Sp).call(this),Ee(this,Ug,"f")}get maxDuration(){return Ee(this,zo,"f")||Ee(this,Ha,"m",Sp).call(this),Ee(this,jg,"f")}toString(){return`{NoteEventCollectionBox ${k.toString(Ee(this,Nn,"f").address.uuid)}}`}};Fp=new WeakMap,Co=new WeakMap,Nn=new WeakMap,tl=new WeakMap,Ep=new WeakMap,oi=new WeakMap,Vg=new WeakMap,Ug=new WeakMap,jg=new WeakMap,zo=new WeakMap,Ha=new WeakSet,Og=function(){pa(this,zo,!1,"f"),Ee(this,tl,"f").notify(this)},Sp=function(){let e=127,r=0,n=0;Ee(this,oi,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),pa(this,Vg,e,"f"),pa(this,Ug,r,"f"),pa(this,jg,n,"f"),pa(this,zo,!0,"f")};var rl=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ue=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},il,Zu,nl,rr,al,kp,Pp,$p,Gu,Hu=class{constructor(e,r){il.add(this),this.type="note-clip",Zu.set(this,new ee),nl.set(this,void 0),rr.set(this,void 0),al.set(this,void 0),kp.set(this,void 0),Pp.set(this,void 0),$p.set(this,fe.Empty),rl(this,nl,e,"f"),rl(this,rr,r,"f"),rl(this,Pp,!0,"f"),rl(this,al,Ue(this,Zu,"f").own(new Wi(!1)),"f"),rl(this,kp,Ue(this,Zu,"f").own(new me),"f"),Ue(this,Zu,"f").ownAll(Ue(this,rr,"f").pointerHub.subscribe({onAdded:()=>Ue(this,il,"m",Gu).call(this),onRemoved:()=>Ue(this,il,"m",Gu).call(this)}),Ue(this,rr,"f").subscribe(Oe.Children,n=>Ue(this,il,"m",Gu).call(this)),Ue(this,rr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ue(this,$p,"f").terminate(),rl(this,$p,n.match({none:()=>fe.Empty,some:({box:i})=>Ue(this,nl,"f").boxAdapters.adapterFor(i,Hi).subscribeChange(()=>Ue(this,il,"m",Gu).call(this))}),"f"),Ue(this,il,"m",Gu).call(this)})),rl(this,Pp,!1,"f")}catchupAndSubscribeSelected(e){return Ue(this,al,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ue(this,kp,"f").subscribe(e)}accept(e){return S(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ue(this,rr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ue(this,rr,"f").events.targetVertex.unwrap("events.target");fu.create(Ue(this,nl,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ue(this,rr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ue(this,al,"f").setValue(!0)}onDeselected(){Ue(this,al,"f").setValue(!1)}get isSelected(){return Ue(this,al,"f").getValue()}terminate(){Ue(this,$p,"f").terminate(),Ue(this,Zu,"f").terminate()}get box(){return Ue(this,rr,"f")}get uuid(){return Ue(this,rr,"f").address.uuid}get address(){return Ue(this,rr,"f").address}get indexField(){return Ue(this,rr,"f").index}get duration(){return Ue(this,rr,"f").duration.getValue()}get mute(){return Ue(this,rr,"f").mute.getValue()}get hue(){return Ue(this,rr,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ue(this,rr,"f").events.targetVertex.map(e=>Ue(this,nl,"f").boxAdapters.adapterFor(e.box,Hi))}get label(){return Ue(this,rr,"f").label.getValue()}get trackBoxAdapter(){return Ue(this,Pp,"f")?b.None:Ue(this,rr,"f").clips.targetVertex.map(e=>Ue(this,nl,"f").boxAdapters.adapterFor(e.box,er))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${k.toString(Ue(this,rr,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};Zu=new WeakMap,nl=new WeakMap,rr=new WeakMap,al=new WeakMap,kp=new WeakMap,Pp=new WeakMap,$p=new WeakMap,il=new WeakSet,Gu=function(){Ue(this,kp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var OS={for:(t,e)=>ze(e.accept({visitNoteClipBox:r=>t.adapterFor(r,Hu),visitValueClipBox:r=>t.adapterFor(r,To),visitAudioClipBox:r=>t.adapterFor(r,Wu)}),"")};var Kg=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Oo=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Wg,qu,Mp,Np,Lg=class{constructor(e,r){Wg.set(this,void 0),qu.set(this,void 0),Mp.set(this,void 0),Np.set(this,void 0),Kg(this,Wg,e,"f"),Kg(this,qu,new ee,"f"),Kg(this,Mp,Oo(this,qu,"f").own(new me),"f"),Kg(this,Np,Oo(this,qu,"f").own(ur.create(e.box.clips,n=>OS.for(r,n),l.ClipCollection)),"f"),Oo(this,Np,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return Oo(this,Wg,"f")}get collection(){return Oo(this,Np,"f")}dispatchChange(){Oo(this,Mp,"f").notify()}subscribeChanges(e){return Oo(this,Mp,"f").subscribe(e)}terminate(){Oo(this,qu,"f").terminate()}};Wg=new WeakMap,qu=new WeakMap,Mp=new WeakMap,Np=new WeakMap;var sB=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Lr,Zg=class{constructor(e){Lr.set(this,void 0),sB(this,Lr,e,"f")}get inField(){return qi(this,Lr,"f").in}get outField(){return qi(this,Lr,"f").out}get inSlopeField(){return qi(this,Lr,"f").inSlope}get outSlopeField(){return qi(this,Lr,"f").outSlope}get in(){return qi(this,Lr,"f").in.getValue()}get out(){return qi(this,Lr,"f").out.getValue()}get inSlope(){return qi(this,Lr,"f").inSlope.getValue()}get outSlope(){return qi(this,Lr,"f").outSlope.getValue()}get hasFading(){return xh.hasFading(this)}copyTo(e){e.in.setValue(this.in),e.out.setValue(this.out),e.inSlope.setValue(this.inSlope),e.outSlope.setValue(this.outSlope)}reset(){qi(this,Lr,"f").in.setValue(0),qi(this,Lr,"f").out.setValue(0),qi(this,Lr,"f").inSlope.setValue(.75),qi(this,Lr,"f").outSlope.setValue(.25)}};Lr=new WeakMap;var gt=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Y=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fi,Ip,Ji,et,Ju,Xu,Yu,Bp,In,Tp,Vo,Qu,ec,tc,rc,ic,nc,ac,Xi,oc=class t{constructor(e,r){Fi.add(this),this.type="audio-region",Ip.set(this,void 0),Ji.set(this,void 0),et.set(this,void 0),Ju.set(this,void 0),Xu.set(this,void 0),Yu.set(this,void 0),Bp.set(this,void 0),In.set(this,void 0),Tp.set(this,void 0),Vo.set(this,b.None),Qu.set(this,fe.Empty),ec.set(this,fe.Empty),tc.set(this,fe.Empty),rc.set(this,fe.Empty),ic.set(this,void 0),nc.set(this,Number.NaN),ac.set(this,Number.NaN),gt(this,Ji,e,"f"),gt(this,et,r,"f"),gt(this,Ip,new ee,"f");let{timeBase:n,duration:i,loopDuration:a}=r;gt(this,Ju,Ps.aware(e.tempoMap,n,i),"f"),gt(this,Xu,Ps.aware(e.tempoMap,n,a),"f"),gt(this,Yu,new wr,"f"),gt(this,Bp,new me,"f"),gt(this,In,new Zg(r.fading),"f"),gt(this,ic,!1,"f"),gt(this,Tp,!0,"f"),Y(this,Ip,"f").ownAll(Y(this,et,"f").pointerHub.subscribe({onAdded:()=>Y(this,Fi,"m",Xi).call(this),onRemoved:()=>Y(this,Fi,"m",Xi).call(this)}),Y(this,et,"f").file.catchupAndSubscribe(o=>{gt(this,Vo,o.targetVertex.map(s=>Y(this,Ji,"f").boxAdapters.adapterFor(s.box,kn)),"f"),Y(this,Qu,"f").terminate(),gt(this,Qu,Y(this,Vo,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>Y(this,Fi,"m",Xi).call(this)),fe.Empty),"f")}),Y(this,et,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{Y(this,ec,"f").terminate(),o.match({none:()=>Y(this,Yu,"f").clear(),some:({box:s})=>{let u=Y(this,Ji,"f").boxAdapters.adapterFor(s,ua.isAudioPlayMode);gt(this,ec,u.subscribe(()=>Y(this,Fi,"m",Xi).call(this)),"f"),Y(this,Yu,"f").wrap(u)}})}),Y(this,et,"f").timeBase.catchupAndSubscribe(o=>{Y(this,tc,"f").terminate(),Da(o.getValue(),Kr)===Kr.Seconds&>(this,tc,e.tempoMap.subscribe(()=>Y(this,Fi,"m",Xi).call(this)),"f")}),Y(this,et,"f").subscribe(Oe.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();Y(this,et,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),Y(this,Fi,"m",Xi).call(this)):Y(this,Fi,"m",Xi).call(this)}}),Y(this,et,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Y(this,rc,"f").terminate(),gt(this,rc,o.match({none:()=>fe.Empty,some:({box:s})=>Y(this,Ji,"f").boxAdapters.adapterFor(s,_r).subscribeChange(()=>Y(this,Fi,"m",Xi).call(this))}),"f"),Y(this,Fi,"m",Xi).call(this)})),gt(this,Tp,!1,"f")}subscribeChange(e){return Y(this,Bp,"f").subscribe(e)}accept(e){return S(e.visitAudioRegionBoxAdapter,this)}onSelected(){gt(this,ic,!0,"f"),Y(this,Fi,"m",Xi).call(this)}onDeselected(){gt(this,ic,!1,"f"),Y(this,Fi,"m",Xi).call(this)}get isSelected(){return Y(this,ic,"f")}get box(){return Y(this,et,"f")}get uuid(){return Y(this,et,"f").address.uuid}get address(){return Y(this,et,"f").address}get position(){return Y(this,et,"f").position.getValue()}get duration(){return Number.isNaN(Y(this,nc,"f"))&>(this,nc,Y(this,Ju,"f").toPPQN(this.position),"f"),Y(this,nc,"f")}get complete(){return this.position+this.duration}get loopOffset(){return Y(this,et,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(Y(this,ac,"f"))&>(this,ac,Y(this,Xu,"f").toPPQN(this.position),"f"),Y(this,ac,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return Y(this,Ju,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return Y(this,Xu,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return Y(this,et,"f").mute.getValue()}get hue(){return Y(this,et,"f").hue.getValue()}get gain(){return Y(this,et,"f").gain}get fading(){return Y(this,In,"f")}get file(){return Y(this,Vo,"f").unwrap("Cannot access file.")}get optFile(){return Y(this,Vo,"f")}get observableOptPlayMode(){return Y(this,Yu,"f")}get timeBase(){return Da(Y(this,et,"f").timeBase.getValue(),Kr)}get waveformOffset(){return Y(this,et,"f").waveformOffset}get isPlayModeNoStretch(){return Y(this,et,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>kt(e,ca)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>kt(e,da)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>ua.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Y(this,Vo,"f").isEmpty())return"No Audio File";let e=Y(this,Vo,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Y(this,et,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}get trackBoxAdapter(){return Y(this,et,"f").regions.targetVertex.map(e=>Y(this,Ji,"f").boxAdapters.adapterFor(e.box,er))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Y(this,et,"f").events.targetVertex.map(e=>Y(this,Ji,"f").boxAdapters.adapterFor(e.box,_r))}set position(e){Y(this,et,"f").position.setValue(e)}set duration(e){Y(this,Ju,"f").fromPPQN(e,this.position);let r=Y(this,In,"f").in+Y(this,In,"f").out;if(r>e){let n=e/r;Y(this,In,"f").inField.setValue(Y(this,In,"f").in*n),Y(this,In,"f").outField.setValue(Y(this,In,"f").out*n)}}set loopOffset(e){Y(this,et,"f").loopOffset.setValue(Fs(e,this.loopDuration))}set loopDuration(e){Y(this,Xu,"f").fromPPQN(e,this.position)}moveContentStart(e){let r=this.position,n=r+e;if(this.position=n,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e,this.timeBase===Kr.Seconds){let i=e>=0?Y(this,Ji,"f").tempoMap.intervalToSeconds(r,n):-Y(this,Ji,"f").tempoMap.intervalToSeconds(n,r);Y(this,et,"f").waveformOffset.setValue(this.waveformOffset.getValue()+i)}else this.optWarpMarkers.ifSome(i=>i.asArray().forEach(a=>a.box.position.setValue(a.position-e)))}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners,i=this.observableOptPlayMode.map(o=>o.clone()),a=Y(this,Ji,"f").boxAdapters.adapterFor(Eo.create(Y(this,Ji,"f").boxGraph,k.generate(),o=>{o.timeBase.setValue(Y(this,et,"f").timeBase.getValue()),o.position.setValue(e?.position??Y(this,et,"f").position.getValue()),o.regions.refer(e?.target??Y(this,et,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(Y(this,et,"f").file.targetVertex.unwrap("file.target")),o.events.refer(n),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),o.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>o.playMode.refer(s)),Y(this,In,"f").copyTo(o.fading)}),t);return a.loopDuration=e?.loopDuration??this.resolveLoopDuration(a.position),a.loopOffset=e?.loopOffset??this.loopOffset,a.duration=e?.duration??this.resolveDuration(a.position),a}consolidate(){}canFlatten(e){return e.length>0&&se.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){return b.None}terminate(){Y(this,Qu,"f").terminate(),gt(this,Qu,fe.Empty,"f"),Y(this,tc,"f").terminate(),gt(this,tc,fe.Empty,"f"),Y(this,ec,"f").terminate(),gt(this,ec,fe.Empty,"f"),Y(this,rc,"f").terminate(),gt(this,rc,fe.Empty,"f"),Y(this,Ip,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${k.toString(Y(this,et,"f").address.uuid)}}`}};Ip=new WeakMap,Ji=new WeakMap,et=new WeakMap,Ju=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,Bp=new WeakMap,In=new WeakMap,Tp=new WeakMap,Vo=new WeakMap,Qu=new WeakMap,ec=new WeakMap,tc=new WeakMap,rc=new WeakMap,ic=new WeakMap,nc=new WeakMap,ac=new WeakMap,Fi=new WeakSet,Xi=function(){gt(this,nc,Number.NaN,"f"),gt(this,ac,Number.NaN,"f"),!Y(this,Tp,"f")&&(Y(this,Bp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var qa=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},fa,Gg,ma,vt,Cp,Dp,sc,Rp,Ja,lc=class t{constructor(e,r){fa.add(this),this.type="note-region",Gg.set(this,new ee),ma.set(this,void 0),vt.set(this,void 0),Cp.set(this,void 0),Dp.set(this,void 0),sc.set(this,void 0),Rp.set(this,fe.Empty),qa(this,ma,e,"f"),qa(this,vt,r,"f"),qa(this,Cp,new me,"f"),qa(this,sc,!1,"f"),qa(this,Dp,!0,"f"),Pe(this,Gg,"f").ownAll(Pe(this,vt,"f").pointerHub.subscribe({onAdded:()=>Pe(this,fa,"m",Ja).call(this),onRemoved:()=>Pe(this,fa,"m",Ja).call(this)}),Pe(this,vt,"f").subscribe(Oe.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Pe(this,vt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Pe(this,fa,"m",Ja).call(this)):Pe(this,fa,"m",Ja).call(this)}}),Pe(this,vt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Pe(this,Rp,"f").terminate(),qa(this,Rp,n.match({none:()=>fe.Empty,some:({box:i})=>Pe(this,ma,"f").boxAdapters.adapterFor(i,Hi).subscribeChange(()=>Pe(this,fa,"m",Ja).call(this))}),"f"),Pe(this,fa,"m",Ja).call(this)})),qa(this,Dp,!1,"f")}set position(e){Pe(this,vt,"f").position.setValue(e)}set duration(e){Pe(this,vt,"f").duration.setValue(e)}set loopOffset(e){Pe(this,vt,"f").loopOffset.setValue(e)}set loopDuration(e){Pe(this,vt,"f").loopDuration.setValue(e)}isNoteRegion(){return!0}isAudioRegion(){return!1}isValueRegion(){return!1}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}subscribeChange(e){return Pe(this,Cp,"f").subscribe(e)}accept(e){return S(e.visitNoteRegionBoxAdapter,this)}onSelected(){qa(this,sc,!0,"f"),Pe(this,fa,"m",Ja).call(this)}onDeselected(){qa(this,sc,!1,"f"),Pe(this,fa,"m",Ja).call(this)}get isSelected(){return Pe(this,sc,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=za.globalToLocal(this,e);for(let a of n.events.iterateFrom(i-n.maxDuration)){if(i<a.position)return;i<a.complete&&(yield a.copyAsNoteEvent())}}terminate(){Pe(this,Rp,"f").terminate(),Pe(this,Gg,"f").terminate()}get box(){return Pe(this,vt,"f")}get uuid(){return Pe(this,vt,"f").address.uuid}get address(){return Pe(this,vt,"f").address}get position(){return Pe(this,vt,"f").position.getValue()}get duration(){return Pe(this,vt,"f").duration.getValue()}get loopOffset(){return Pe(this,vt,"f").loopOffset.getValue()}get loopDuration(){return Pe(this,vt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Pe(this,vt,"f").mute.getValue()}get hue(){return Pe(this,vt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Pe(this,vt,"f").events.targetVertex.map(e=>Pe(this,ma,"f").boxAdapters.adapterFor(e.box,Hi))}get label(){return Pe(this,vt,"f").label.getValue()}get trackBoxAdapter(){return Pe(this,Dp,"f")?b.None:Pe(this,vt,"f").regions.targetVertex.map(e=>Pe(this,ma,"f").boxAdapters.adapterFor(e.box,er))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Pe(this,ma,"f").boxAdapters.adapterFor(Cs.create(Pe(this,ma,"f").boxGraph,k.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Pe(this,vt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=Pe(this,ma,"f").boxGraph,n=Wa.create(r,k.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Pe(this,vt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&se.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return b.None;let r=Pe(this,ma,"f").boxGraph,n=e.toSorted(go.Comparator),i=se.getFirst(n,"Internal error (no first)"),a=se.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Wa.create(r,k.generate()),m=Array.from(u.regions.collection.iterateRange(o,s));return m.filter(x=>x.isSelected).forEach(x=>{let g=x;for(let{resultStart:w,resultEnd:_,rawStart:N}of za.locateLoops(g,g.position,g.complete)){let j=Math.floor(w-N),W=Math.floor(_-N);for(let O of g.optCollection.unwrap("optCollection").events.iterateRange(j,W))O.copyTo({position:O.position+N-i.position,events:d.events})}}),m.forEach(({box:x})=>x.delete()),b.wrap(Cs.create(r,k.generate(),x=>{x.position.setValue(o),x.duration.setValue(s-o),x.loopDuration.setValue(s-o),x.loopOffset.setValue(0),x.hue.setValue(this.hue),x.mute.setValue(this.mute),x.label.setValue(this.label),x.events.refer(d.owners),x.regions.refer(u.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${k.toString(Pe(this,vt,"f").address.uuid)} p: ${Me.toString(this.position)}, c: ${Me.toString(this.complete)}}`}};Gg=new WeakMap,ma=new WeakMap,vt=new WeakMap,Cp=new WeakMap,Dp=new WeakMap,sc=new WeakMap,Rp=new WeakMap,fa=new WeakSet,Ja=function(){Pe(this,Cp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var Xa=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Bn,uc,ha,xt,Vp,cc,zp,Op,ga,Ya=class t{constructor(e,r){Bn.add(this),this.type="value-region",uc.set(this,new ee),ha.set(this,void 0),xt.set(this,void 0),Vp.set(this,void 0),cc.set(this,void 0),zp.set(this,void 0),Op.set(this,fe.Empty),Xa(this,ha,e,"f"),Xa(this,xt,r,"f"),Xa(this,zp,!0,"f"),Xa(this,Vp,new me,"f"),Xa(this,cc,!1,"f"),Fe(this,uc,"f").own(Fe(this,xt,"f").pointerHub.subscribe({onAdded:()=>Fe(this,Bn,"m",ga).call(this),onRemoved:()=>Fe(this,Bn,"m",ga).call(this)})),Fe(this,uc,"f").own(Fe(this,xt,"f").subscribe(Oe.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Fe(this,xt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Fe(this,Bn,"m",ga).call(this)):Fe(this,Bn,"m",ga).call(this)}})),Fe(this,uc,"f").own(Fe(this,xt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Fe(this,Op,"f").terminate(),Xa(this,Op,n.match({none:()=>fe.Empty,some:({box:i})=>Fe(this,ha,"f").boxAdapters.adapterFor(i,_r).subscribeChange(()=>Fe(this,Bn,"m",ga).call(this))}),"f"),Fe(this,Bn,"m",ga).call(this)})),Xa(this,zp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(za.globalToLocal(this,e),r)}incomingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap().events.greaterEqual(0);return K(n)&&n.position===0?n.value:this.valueAt(this.position,e)}outgoingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(za.globalToLocal(this,this.complete),e)}subscribeChange(e){return Fe(this,Vp,"f").subscribe(e)}accept(e){return S(e.visitValueRegionBoxAdapter,this)}onSelected(){Xa(this,cc,!0,"f"),Fe(this,Bn,"m",ga).call(this)}onDeselected(){Xa(this,cc,!1,"f"),Fe(this,Bn,"m",ga).call(this)}get isSelected(){return Fe(this,cc,"f")}onValuesPropertyChanged(){Fe(this,Bn,"m",ga).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Fe(this,Op,"f").terminate(),Fe(this,uc,"f").terminate()}get box(){return Fe(this,xt,"f")}get uuid(){return Fe(this,xt,"f").address.uuid}get address(){return Fe(this,xt,"f").address}get position(){return Fe(this,xt,"f").position.getValue()}get duration(){return Fe(this,xt,"f").duration.getValue()}get loopOffset(){return Fe(this,xt,"f").loopOffset.getValue()}get loopDuration(){return Fe(this,xt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}isNoteRegion(){return!1}isAudioRegion(){return!1}isValueRegion(){return!0}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Fe(this,xt,"f").mute.getValue()}get hue(){return Fe(this,xt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Fe(this,xt,"f").events.targetVertex.map(e=>Fe(this,ha,"f").boxAdapters.adapterFor(e.box,_r))}get label(){return Fe(this,xt,"f").label.getValue()}get trackBoxAdapter(){return Fe(this,zp,"f")?b.None:Fe(this,xt,"f").regions.targetVertex.map(e=>Fe(this,ha,"f").boxAdapters.adapterFor(e.box,er))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Fe(this,xt,"f").position.setValue(e)}set duration(e){Fe(this,xt,"f").duration.setValue(e)}set loopOffset(e){Fe(this,xt,"f").loopOffset.setValue(e)}set loopDuration(e){Fe(this,xt,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Fe(this,ha,"f").boxAdapters.adapterFor(zs.create(Fe(this,ha,"f").boxGraph,k.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Fe(this,xt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=Fe(this,ha,"f").boxGraph,n=Pn.create(r,k.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Fe(this,xt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&se.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return b.None;let r=Fe(this,ha,"f").boxGraph,n=e.toSorted(go.Comparator),i=se.getFirst(n,"Internal error (no first)"),a=se.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Array.from(u.regions.collection.iterateRange(o,s)),m=[];d.filter(_=>_.isSelected).forEach(_=>{let N=_,j=N.optCollection.unwrap("optCollection"),W=j.events;for(let{rawStart:O,regionStart:te,regionEnd:ie}of za.locateLoops(N,N.position,N.complete)){let be=te-O,Q=ie-O,L=W.greaterEqual(be);if(!K(L)||L.position!==be){let Ve=W.lowerEqual(be);K(Ve)&&m.push({position:te-o,value:j.valueAt(be,0),interpolation:Ve.interpolation})}let we=!1;for(let Ve of W.iterateRange(be,yr.MAX_VALUE)){let ct=Ve.position+O;if(ct<ie)m.push({position:ct-o,value:Ve.value,interpolation:Ve.interpolation});else if(ct===ie){m.push({position:ct-o,value:Ve.value,interpolation:ii.None}),we=!0;break}else{m.push({position:ie-o,value:j.valueAt(Q,0),interpolation:ii.None}),we=!0;break}}we||m.push({position:ie-o,value:j.valueAt(Q,0),interpolation:ii.None})}});let x=[];for(let _ of m){let N=x.length>0?x[x.length-1]:void 0;K(N)&&N.position===_.position&&N.value===_.value?x[x.length-1]=_:x.push(_)}let g=Pn.create(r,k.generate()),w=0;for(;w<x.length;){let _=w+1;for(;_<x.length&&x[_].position===x[w].position;)_++;let N=x[w],j=x[_-1],W=Sn.create(r,k.generate(),O=>{O.position.setValue(N.position),O.index.setValue(0),O.value.setValue(N.value),O.events.refer(g.events)});if(ai.write(W.interpolation,_-w>1?ii.None:N.interpolation),_-w>1){let O=Sn.create(r,k.generate(),te=>{te.position.setValue(j.position),te.index.setValue(1),te.value.setValue(j.value),te.events.refer(g.events)});ai.write(O.interpolation,j.interpolation)}w=_}return d.forEach(({box:_})=>_.delete()),b.wrap(zs.create(r,k.generate(),_=>{_.position.setValue(o),_.duration.setValue(s-o),_.loopDuration.setValue(s-o),_.loopOffset.setValue(0),_.hue.setValue(this.hue),_.mute.setValue(this.mute),_.label.setValue(this.label),_.events.refer(g.owners),_.regions.refer(u.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${k.toString(Fe(this,xt,"f").address.uuid)} p: ${Me.toString(this.position)}, c: ${Me.toString(this.complete)}}`}};uc=new WeakMap,ha=new WeakMap,xt=new WeakMap,Vp=new WeakMap,cc=new WeakMap,zp=new WeakMap,Op=new WeakMap,Bn=new WeakSet,ga=function(){Fe(this,Vp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var VS=(t,e)=>t.position-e.position,US={for:(t,e)=>ze(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,lc),visitAudioRegionBox:r=>t.adapterFor(r,oc),visitValueRegionBox:r=>t.adapterFor(r,Ya)}),"")};var dc=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ir=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pc,ol,Up,fc,Uo,mc,Hg=class{constructor(e,r){pc.set(this,void 0),ol.set(this,void 0),Up.set(this,void 0),fc.set(this,void 0),Uo.set(this,void 0),mc.set(this,void 0),dc(this,pc,e,"f"),dc(this,ol,new ee,"f"),dc(this,Up,ir(this,ol,"f").own(new me),"f"),dc(this,fc,ir(this,ol,"f").own(new Yt),"f"),dc(this,Uo,go.create(VS),"f"),dc(this,mc,k.newSet(n=>n.uuid),"f"),ir(this,ol,"f").ownAll(ir(this,pc,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=US.for(r,n),a=ir(this,mc,"f").add(i);re(a,`Cannot add ${n}`),ir(this,Uo,"f").add(i);for(let o of ir(this,Uo,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:ir(this,pc,"f").listIndex,added:{p:i.position,d:i.duration,c:i.complete},existing:{p:o.position,d:o.duration,c:o.complete},stack:new Error().stack});break}ir(this,fc,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=ir(this,mc,"f").removeByKey(n);ir(this,Uo,"f").remove(i),ir(this,fc,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return ir(this,pc,"f")}get collection(){return ir(this,Uo,"f")}get adapters(){return ir(this,mc,"f")}onIndexingChanged(){ir(this,Uo,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),ir(this,fc,"f").subscribe(e)}subscribeChanges(e){return ir(this,Up,"f").subscribe(e)}dispatchChange(){ir(this,Up,"f").notify()}terminate(){ir(this,ol,"f").terminate()}};pc=new WeakMap,ol=new WeakMap,Up=new WeakMap,fc=new WeakMap,Uo=new WeakMap,mc=new WeakMap;var ve;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ve||(ve={}));(function(t){t.toLabelString=e=>{switch(e){case t.Audio:return"Audio";case t.Notes:return"Note";case t.Value:return"Automation";case t.Undefined:default:return"N/A"}},t.toIconSymbol=e=>{switch(e){case t.Audio:return Ze.Waveform;case t.Notes:return Ze.Piano;case t.Value:return Ze.Automation;case t.Undefined:return Ze.AudioBus;default:return Ze.Unknown}}})(ve||(ve={}));var qg;(function(t){t.isDeviceBox=e=>e.tags.type==="device",t.isInstrumentDeviceBox=e=>t.isDeviceBox(e)&&e.tags.deviceType==="instrument",t.isEffectDeviceBox=e=>t.isDeviceBox(e)&&(e.tags.deviceType==="audio-effect"||e.tags.deviceType==="midi-effect"),t.isChainEffectOf=(e,r)=>t.isEffectDeviceBox(e)&&e.host.targetVertex.mapOr(n=>n.box===r,!1),t.lookupHostField=e=>K(e)&&"host"in e&&kt(e.host,M)?e.host:V(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>K(e)&&"label"in e&&kt(e.label,B)?e.label:V(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>K(e)&&"enabled"in e&&kt(e.enabled,R)?e.enabled:V(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>K(e)&&"minimized"in e&&kt(e.minimized,R)?e.minimized:V(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>K(e)&&"index"in e&&kt(e.index,$)?e.index:V(`Could not find 'index' field in '${e?.name}'`)})(qg||(qg={}));var jS;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ve.Notes;case"audio":return ve.Audio;default:return V()}}})(jS||(jS={}));var oe;(function(t){t.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),t.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),t.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",t.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",t.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",t.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",t.deleteEffectDevices=e=>{if(e.length===0)return;re(se.satisfy(e,(i,a)=>i.deviceHost().address.equals(a.deviceHost().address)),"Devices are not connected to the same host");let r=e[0];(r.accepts==="audio"?r.deviceHost().audioEffects.field().pointerHub.filter(l.AudioEffectHost):r.accepts==="midi"?r.deviceHost().midiEffects.field().pointerHub.filter(l.MIDIEffectHost):V("unknown type")).map(({box:i})=>qg.lookupIndexField(i)).filter(i=>e.some(a=>k.Comparator(a.uuid,i.address.uuid)!==0)).sort((i,a)=>i.getValue()-a.getValue()).forEach((i,a)=>i.setValue(a)),e.forEach(i=>i.box.delete())}})(oe||(oe={}));var Jg=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hc,Xg,Tn,sl,Yg,Qg=class{constructor(e,r){hc.set(this,void 0),Xg.set(this,new me),Tn.set(this,void 0),sl.set(this,void 0),Yg.set(this,void 0),Jg(this,hc,e,"f"),Jg(this,Tn,ur.create(e.box.tracks,n=>r.adapterFor(n,er),l.TrackCollection),"f"),Jg(this,sl,k.newSet(({uuid:n})=>n),"f"),Jg(this,Yg,vr(this,Tn,"f").catchupAndSubscribe({onAdd:n=>vr(this,sl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>vr(this,Xg,"f").notify())}),onRemove:({uuid:n})=>vr(this,sl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=vr(this,hc,"f").box.graph,a=vr(this,hc,"f").box.tracks;Nr.create(i,k.generate(),o=>{o.index.setValue(n??vr(this,Tn,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return b.wrap(vr(this,Tn,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=vr(this,Tn,"f").adapters(),n=r.indexOf(e);if(n===-1)return V(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<r.length;i++)r[i].indexField.setValue(i-1);e.box.delete()}get audioUnitBox(){return vr(this,hc,"f").box}get collection(){return vr(this,Tn,"f")}values(){return vr(this,Tn,"f").adapters()}catchupAndSubscribe(e){return vr(this,Tn,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return vr(this,Xg,"f").subscribe(e)}terminate(){vr(this,Tn,"f").terminate(),vr(this,Yg,"f").terminate(),vr(this,sl,"f").forEach(({subscription:e})=>e.terminate()),vr(this,sl,"f").clear()}};hc=new WeakMap,Xg=new WeakMap,Tn=new WeakMap,sl=new WeakMap,Yg=new WeakMap;var le;(function(t){t.AudioBus="manuals/audio-bus",t.Arpeggio="manuals/devices/midi/arpeggio",t.Pitch="manuals/devices/midi/pitch",t.Spielwerk="manuals/devices/midi/spielwerk",t.Velocity="manuals/devices/midi/velocity",t.Zeitgeist="manuals/devices/midi/zeitgeist",t.StereoTool="manuals/devices/audio/stereo-tool",t.Delay="manuals/devices/audio/delay",t.DattorroReverb="manuals/devices/audio/dattorro-reverb",t.Maximizer="manuals/devices/audio/maximizer",t.Compressor="manuals/devices/audio/compressor",t.Gate="manuals/devices/audio/gate",t.Reverb="manuals/devices/audio/cheap-reverb",t.Crusher="manuals/devices/audio/crusher",t.Fold="manuals/devices/audio/fold",t.Tidal="manuals/devices/audio/tidal",t.Revamp="manuals/devices/audio/revamp",t.Modular="manuals/devices/audio/modular",t.NeuralAmp="manuals/devices/audio/neural-amp",t.Vocoder="manuals/devices/audio/vocoder",t.Waveshaper="manuals/devices/audio/waveshaper",t.Werkstatt="manuals/devices/audio/werkstatt",t.Apparat="manuals/devices/instruments/apparat",t.Tape="manuals/devices/instruments/tape",t.Nano="manuals/devices/instruments/nano",t.Playfield="manuals/devices/instruments/playfield",t.Vaporisateur="manuals/devices/instruments/vaporisateur",t.MIDIOutput="manuals/devices/instruments/midi-output",t.Soundfont="manuals/devices/instruments/soundfont"})(le||(le={}));var KS=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Dn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ev,Ei,Si=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=le.AudioBus,ev.set(this,void 0),Ei.set(this,void 0),KS(this,ev,e,"f"),KS(this,Ei,r,"f")}catchupAndSubscribe(e){return e(this),Dn(this,Ei,"f").subscribe(Oe.Children,()=>e(this))}get uuid(){return Dn(this,Ei,"f").address.uuid}get address(){return Dn(this,Ei,"f").address}get box(){return Dn(this,Ei,"f")}get enabledField(){return Dn(this,Ei,"f").enabled}get minimizedField(){return Dn(this,Ei,"f").minimized}get iconField(){return Dn(this,Ei,"f").icon}get labelField(){return Dn(this,Ei,"f").label}get colorField(){return Dn(this,Ei,"f").color}get iconSymbol(){return Ze.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Dn(this,ev,"f").boxAdapters.adapterFor(Dn(this,Ei,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};ev=new WeakMap,Ei=new WeakMap;var jp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qa,gc,vc,Pi,Kp,tv=class{constructor(e,r){Qa.set(this,void 0),gc.set(this,void 0),vc.set(this,void 0),Pi.set(this,void 0),Kp.set(this,fe.Empty),jp(this,Qa,new ee,"f"),jp(this,gc,Mt(this,Qa,"f").own(new me),"f"),jp(this,vc,Mt(this,Qa,"f").own(new Wi(Ze.Unknown)),"f"),jp(this,Pi,Mt(this,Qa,"f").own(new wr),"f"),Mt(this,Qa,"f").own(Mt(this,Pi,"f").subscribe(n=>{Mt(this,Kp,"f").terminate(),jp(this,Kp,n.match({none:()=>(Mt(this,gc,"f").notify(b.None),fe.Empty),some:({labelField:i,iconField:a})=>fe.many(a.catchupAndSubscribe(o=>Mt(this,vc,"f").setValue(Ze.fromName(o.getValue()))),i.catchupAndSubscribe(o=>Mt(this,gc,"f").notify(b.wrap(o.getValue()))))}),"f")})),Mt(this,Qa,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(Mt(this,Pi,"f").nonEmpty()){let o=Mt(this,Pi,"f").unwrap();V(`AudioUnitInput already has an input. Existing: ${o.box.name}@${o.box.address.toString()} (type: ${o.type}), Incoming: ${n.name}@${n.address.toString()} (pointerType: ${String(i)})`)}let a=n instanceof $n?r.adapterFor(n,Si):r.adapterFor(n,oe.isInstrument);Mt(this,Pi,"f").unwrapOrNull()!==a&&Mt(this,Pi,"f").wrap(a)},onRemoved:({box:n})=>{re(Mt(this,Pi,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),Mt(this,Pi,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return Mt(this,Pi,"f")}subscribe(e){return Mt(this,Pi,"f").subscribe(e)}catchupAndSubscribe(e){return e(Mt(this,Pi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),Mt(this,gc,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return Mt(this,vc,"f").catchupAndSubscribe(e)}set label(e){this.adapter().ifSome(r=>r.labelField.setValue(e))}get label(){return this.adapter().map(e=>e.labelField.getValue())}set icon(e){this.adapter().ifSome(r=>r.iconField.setValue(Ze.toName(e)))}get icon(){return this.adapter().match({none:()=>Ze.Unknown,some:e=>Ze.fromName(e.iconField.getValue())})}get iconValue(){return Mt(this,vc,"f")}terminate(){Mt(this,Qa,"f").terminate(),Mt(this,Kp,"f").terminate()}};Qa=new WeakMap,gc=new WeakMap,vc=new WeakMap,Pi=new WeakMap,Kp=new WeakMap;var WS=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ll=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},rv,eo,pe=class{constructor(e){rv.set(this,void 0),eo.set(this,void 0),WS(this,rv,e,"f"),WS(this,eo,Re.newSet(r=>r.address),"f")}terminate(){ll(this,eo,"f").forEach(e=>e.terminate()),ll(this,eo,"f").clear()}parameters(){return ll(this,eo,"f").values()}parameterAt(e){return ll(this,eo,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new ul(ll(this,rv,"f"),e,r,n,i,a,o),u=ll(this,eo,"f").add(s);return re(u,`Could not add adapter for ${e}`),s}removeParameter(e){return ll(this,eo,"f").removeByKey(e)}};rv=new WeakMap,eo=new WeakMap;var cl=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Et=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},dl,Yi,jo,xc,iv,nv,Wp,yc=class{constructor(e,r){dl.set(this,void 0),Yi.set(this,void 0),jo.set(this,void 0),xc.set(this,void 0),iv.set(this,void 0),nv.set(this,void 0),Wp.set(this,fe.Empty),cl(this,dl,e,"f"),cl(this,Yi,r,"f"),cl(this,jo,new ee,"f"),cl(this,xc,Et(this,jo,"f").own(new me),"f"),Et(this,jo,"f").own(r.targetBus.catchupAndSubscribe(()=>{Et(this,Wp,"f").terminate(),cl(this,Wp,this.optTargetBus.match({none:()=>(Et(this,xc,"f").notify(b.None),fe.Empty),some:n=>n.catchupAndSubscribe(i=>Et(this,xc,"f").notify(b.wrap(i)))}),"f")})),cl(this,iv,Et(this,jo,"f").own(new ul(Et(this,dl,"f"),Et(this,Yi,"f").sendPan,E.bipolar(),P.percent({unit:"%",fractionDigits:0}),"panning")),"f"),cl(this,nv,Et(this,jo,"f").own(new ul(Et(this,dl,"f"),Et(this,Yi,"f").sendGain,E.DefaultDecibel,P.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),Et(this,xc,"f").subscribe(e)}get uuid(){return Et(this,Yi,"f").address.uuid}get address(){return Et(this,Yi,"f").address}get box(){return Et(this,Yi,"f")}get indexField(){return Et(this,Yi,"f").index}get sendPan(){return Et(this,iv,"f")}get sendGain(){return Et(this,nv,"f")}get targetBus(){return Et(this,dl,"f").boxAdapters.adapterFor(Et(this,Yi,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Si)}get optTargetBus(){return Et(this,Yi,"f").targetBus.targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Et(this,dl,"f").boxAdapters.adapterFor(r,Si)})))}delete(){Et(this,Yi,"f").delete()}terminate(){Et(this,jo,"f").terminate(),Et(this,Wp,"f").terminate()}};dl=new WeakMap,Yi=new WeakMap,jo=new WeakMap,xc=new WeakMap,iv=new WeakMap,nv=new WeakMap,Wp=new WeakMap;var Lp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},va=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},av,ov,wc,bc,Zp,sv=class{constructor(e,r){av.set(this,void 0),ov.set(this,void 0),wc.set(this,void 0),bc.set(this,void 0),Zp.set(this,fe.Empty),Lp(this,av,e,"f"),Lp(this,ov,r,"f"),Lp(this,wc,new ee,"f"),Lp(this,bc,va(this,wc,"f").own(new me),"f"),va(this,wc,"f").own(e.catchupAndSubscribe(()=>{va(this,Zp,"f").terminate(),Lp(this,Zp,this.adapter.match({none:()=>(va(this,bc,"f").notify(b.None),fe.Empty),some:n=>n.catchupAndSubscribe(i=>va(this,bc,"f").notify(b.wrap(i)))}),"f")}))}subscribe(e){return va(this,bc,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return va(this,av,"f").targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>va(this,ov,"f").adapterFor(r,Si)})))}terminate(){va(this,wc,"f").terminate(),va(this,Zp,"f").terminate()}};av=new WeakMap,ov=new WeakMap,wc=new WeakMap,bc=new WeakMap,Zp=new WeakMap;var to=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},xe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},lv,LS,xa,$i,Ot,fl,_c,pl,uv,Gp,cv,dv,ZS,GS,Qi=class{constructor(e,r){lv.add(this),this.class="device-host",xa.set(this,new ee),$i.set(this,void 0),Ot.set(this,void 0),fl.set(this,void 0),_c.set(this,void 0),pl.set(this,void 0),uv.set(this,void 0),Gp.set(this,void 0),cv.set(this,void 0),dv.set(this,void 0),to(this,$i,e,"f"),to(this,Ot,r,"f"),to(this,fl,xe(this,xa,"f").own(new pe(xe(this,$i,"f"))),"f"),to(this,_c,xe(this,xa,"f").own(new Qg(this,xe(this,$i,"f").boxAdapters)),"f"),to(this,pl,xe(this,xa,"f").own(new tv(xe(this,Ot,"f").input.pointerHub,xe(this,$i,"f").boxAdapters)),"f"),to(this,uv,xe(this,xa,"f").own(ur.create(xe(this,Ot,"f").midiEffects,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,oe.isMidiEffect),l.MIDIEffectHost)),"f"),to(this,Gp,xe(this,xa,"f").own(ur.create(xe(this,Ot,"f").audioEffects,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),to(this,cv,xe(this,xa,"f").own(ur.create(xe(this,Ot,"f").auxSends,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,yc),l.AuxSend)),"f"),to(this,dv,xe(this,xa,"f").own(new sv(xe(this,Ot,"f").output,xe(this,$i,"f").boxAdapters)),"f"),this.namedParameter=xe(this,lv,"m",ZS).call(this,r),xe(this,lv,"m",GS).call(this)}get box(){return xe(this,Ot,"f")}get uuid(){return xe(this,Ot,"f").address.uuid}get address(){return xe(this,Ot,"f").address}get indexField(){return xe(this,Ot,"f").index}get type(){return xe(this,Ot,"f").type.getValue()}get captureBox(){return xe(this,Ot,"f").capture.targetVertex}get tracks(){return xe(this,_c,"f")}get input(){return xe(this,pl,"f")}get midiEffects(){return xe(this,uv,"f")}get audioEffects(){return xe(this,Gp,"f")}get inputAdapter(){return xe(this,pl,"f").adapter()}get auxSends(){return xe(this,cv,"f")}get output(){return xe(this,dv,"f")}get isBus(){return this.input.adapter().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.adapter().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return xe(this,Ot,"f").output.targetVertex.mapOr(e=>e.box.address.equals(xe(this,$i,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return xe(this,Ot,"f").midiEffects}get inputField(){return xe(this,Ot,"f").input}get audioEffectsField(){return xe(this,Ot,"f").audioEffects}get tracksField(){return xe(this,Ot,"f").tracks}get minimizedField(){return xe(this,pl,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get label(){return xe(this,pl,"f").adapter().mapOr(e=>e.labelField.getValue(),"")}deviceHost(){return this}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.adapter();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let r of xe(this,Gp,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>b.None}}indicesLimit(){let e=xe(this,$i,"f").rootBoxAdapter.audioUnits.adapters(),r=this.indexField.getValue(),n=this.type,i=r,a=r;for(;i>0&&e[i-1].type===n;)i--;for(;a<e.length-1&&e[a+1].type===n;)a++;return[i,a+1]}move(e){xe(this,$i,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){xe(this,_c,"f").collection.move(e,r)}deleteTrack(e){xe(this,_c,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){xe(this,xa,"f").terminate()}};LS=Qi,xa=new WeakMap,$i=new WeakMap,Ot=new WeakMap,fl=new WeakMap,_c=new WeakMap,pl=new WeakMap,uv=new WeakMap,Gp=new WeakMap,cv=new WeakMap,dv=new WeakMap,lv=new WeakSet,ZS=function(e){return{volume:xe(this,fl,"f").createParameter(e.volume,LS.VolumeMapper,P.decible,"volume"),panning:xe(this,fl,"f").createParameter(e.panning,E.bipolar(),P.panning,"panning",.5),mute:xe(this,fl,"f").createParameter(e.mute,E.bool,P.bool,"mute"),solo:xe(this,fl,"f").createParameter(e.solo,E.bool,P.bool,"solo")}},GS=function(){let e=this.address.toString(),r=xe(this,Ot,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${xe(this,Ot,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;re(this.type!==Ft.Instrument||xe(this,Ot,"f").capture.targetAddress.nonEmpty(),n)};Qi.VolumeMapper=E.decibel(-96,-9,6);var Ac=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ge=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hl,Gr,Zr,ml,pv,fv,Hp,HS,qS,mv,er=class{constructor(e,r){hl.add(this),Gr.set(this,void 0),Zr.set(this,void 0),ml.set(this,void 0),pv.set(this,void 0),fv.set(this,void 0),Hp.set(this,void 0),Ac(this,Gr,e,"f"),Ac(this,Zr,r,"f"),Ac(this,ml,new ee,"f"),Ac(this,Hp,Ge(this,ml,"f").own(new Wi(-1)),"f"),Ac(this,pv,Ge(this,ml,"f").own(new Lg(this,e.boxAdapters)),"f"),Ac(this,fv,Ge(this,ml,"f").own(new Hg(this,e.boxAdapters)),"f")}catchupAndSubscribePath(e){let r=[b.None,b.None],n=()=>{r.every(i=>i.nonEmpty())?e(b.wrap(r.map(i=>i.unwrap()))):e(b.None)};return fe.many(Ge(this,hl,"m",HS).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),Ge(this,hl,"m",qS).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return Ge(this,Gr,"f")}set targetName(e){Ge(this,Zr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof Xe){Ge(this,Gr,"f").boxAdapters.adapterFor(n,Qi).input.adapter().ifSome(a=>a.labelField.setValue(e));return}Ge(this,Gr,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof B&&i.labelField.setValue(e)}),Ge(this,hl,"m",mv).call(this,n).flatMap(i=>Ge(this,Gr,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof B&&i.labelField.setValue(e)})})}get targetName(){return Ge(this,Zr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof Xe)return Ge(this,Gr,"f").boxAdapters.adapterFor(r,Qi).input.label;let n=Ge(this,Gr,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof B)return b.wrap(a.labelField.getValue())}let i=Ge(this,hl,"m",mv).call(this,r).flatMap(a=>Ge(this,Gr,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof B)return b.wrap(a.labelField.getValue())}return b.wrap(r.name)})}terminate(){Ge(this,ml,"f").terminate()}get audioUnit(){return Ie(Ge(this,Zr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,Xe)}get target(){return Ge(this,Zr,"f").target}get clips(){return Ge(this,pv,"f")}get regions(){return Ge(this,fv,"f")}get enabled(){return Ge(this,Zr,"f").enabled}get indexField(){return Ge(this,Zr,"f").index}get type(){return Ge(this,Zr,"f").type.getValue()}get box(){return Ge(this,Zr,"f")}get uuid(){return Ge(this,Zr,"f").address.uuid}get address(){return Ge(this,Zr,"f").address}get listIndex(){return Ge(this,Hp,"f").getValue()}set listIndex(e){Ge(this,Hp,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ve.Audio;case"note-clip":return this.type===ve.Notes;case"value-clip":return this.type===ve.Value;case"audio-region":return this.type===ve.Audio;case"note-region":return this.type===ve.Notes;case"value-region":return this.type===ve.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=Ge(this,Gr,"f").clipSequencing.iterate(this.uuid,e,e+MS);for(let{optClip:a,sectionFrom:o}of i)n=a.match({none:()=>{let s=this.regions.collection.lowerEqual(e,u=>!u.mute);if(s===null){let u=this.regions.collection.optAt(0);return kt(u,Ya)?u.incomingValue(r):r}else if(kt(s,Ya))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&kt(s,To)&&!s.mute?s.valueAt(e,r):r});return n}};Gr=new WeakMap,Zr=new WeakMap,ml=new WeakMap,pv=new WeakMap,fv=new WeakMap,Hp=new WeakMap,hl=new WeakSet,HS=function(e){let r=Ge(this,Zr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof Xe)return Ge(this,Gr,"f").boxAdapters.adapterFor(n,Qi).input.catchupAndSubscribeLabelChange(s=>e(s));let i=Ge(this,Gr,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof B)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}let a=Ge(this,hl,"m",mv).call(this,n).flatMap(o=>Ge(this,Gr,"f").boxAdapters.optAdapter(o));if(a.nonEmpty()){let o=a.unwrap();if("labelField"in o&&o.labelField instanceof B)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}return e(b.wrap(n.name)),fe.Empty}return e(b.None),fe.Empty},qS=function(e){let r=this.type;switch(r){case ve.Audio:case ve.Notes:return e(b.wrap(ve[r])),fe.Empty;case ve.Value:{let n=Ge(this,Zr,"f").target.targetVertex.unwrap("target.target");if(n.isField())e(Ge(this,Gr,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(b.wrap(n.name));else return V("Illegal State. Vertex is not a field nor box.");return fe.Empty}case ve.Undefined:return e(b.wrap("")),fe.Empty;default:return e(b.None),fe.Empty}},mv=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return b.None};var nr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ye=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ki,Mi,hv,gv,vv,gl,Ko,Wo,Lo,Zo,Go,vl,Fc,qp,JS=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],ul=class{constructor(e,r,n,i,a,o,s){ki.set(this,void 0),Mi.set(this,void 0),hv.set(this,void 0),gv.set(this,void 0),vv.set(this,void 0),gl.set(this,new ee),Ko.set(this,void 0),Wo.set(this,void 0),Lo.set(this,void 0),Zo.set(this,void 0),Go.set(this,b.None),vl.set(this,b.None),Fc.set(this,null),qp.set(this,!1),nr(this,ki,e,"f"),nr(this,Mi,r,"f"),nr(this,Lo,n,"f"),nr(this,Zo,i,"f"),nr(this,hv,a,"f"),nr(this,gv,o??0,"f"),nr(this,vv,b.wrap(s),"f"),ye(this,gl,"f").own(ye(this,ki,"f").parameterFieldAdapters.register(this)),nr(this,Ko,ye(this,gl,"f").own(new me),"f"),nr(this,Wo,new Yt,"f"),ye(this,gl,"f").own(ye(this,Mi,"f").subscribe(()=>ye(this,Ko,"f").notify(this))),ye(this,gl,"f").own(ye(this,Mi,"f").pointerHub.catchupAndSubscribe({onAdded:u=>{ye(this,Wo,"f").proxy.onControlSourceAdd(kb(u.pointerType)),u.box.accept({visitTrackBox:d=>{re(ye(this,Go,"f").isEmpty(),"Already assigned");let m=ye(this,ki,"f").boxAdapters.adapterFor(d,er);nr(this,Go,b.wrap(m),"f"),ye(this,ki,"f").isMainThread&&nr(this,vl,b.wrap(ye(this,ki,"f").liveStreamReceiver.subscribeFloat(ye(this,Mi,"f").address,x=>{ye(this,Fc,"f")!==x&&(nr(this,Fc,x,"f"),ye(this,Ko,"f").notify(this))})),"f")}})},onRemoved:u=>{ye(this,Wo,"f").proxy.onControlSourceRemove(kb(u.pointerType)),u.box.accept({visitTrackBox:d=>{re(ye(this,Go,"f").unwrapOrNull()?.address?.equals(d.address)===!0,`Unknown ${d}`),nr(this,Go,b.None,"f"),ye(this,ki,"f").isMainThread&&(ye(this,vl,"f").ifSome(m=>m.terminate()),nr(this,vl,b.None,"f"),nr(this,Fc,null,"f"),ye(this,Ko,"f").notify(this))}})}},...JS)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return ye(this,Wo,"f").proxy.onControlSourceAdd("midi"),nr(this,qp,!0,"f"),{terminate:()=>{nr(this,qp,!1,"f"),ye(this,Wo,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ye(this,Mi,"f")}get valueMapping(){return ye(this,Lo,"f")}get stringMapping(){return ye(this,Zo,"f")}get name(){return ye(this,hv,"f")}get anchor(){return ye(this,gv,"f")}get type(){return ye(this,Mi,"f").type}get address(){return ye(this,Mi,"f").address}get track(){return ye(this,Go,"f")}registerTracks(e){return ye(this,ki,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){ye(this,ki,"f").parameterFieldAdapters.touchStart(this.address),ye(this,ki,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){ye(this,ki,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){nr(this,Lo,e,"f"),nr(this,Zo,r,"f"),ye(this,Ko,"f").notify(this)}valueAt(e){let r=ye(this,Go,"f");if(r.nonEmpty()){let n=r.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return ye(this,Ko,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ye(this,qp,"f")&&e.onControlSourceAdd("midi"),ye(this,Mi,"f").pointerHub.filter(...JS).forEach(r=>e.onControlSourceAdd(kb(r.pointerType))),ye(this,Wo,"f").subscribe(e)}getValue(){return ye(this,Mi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();ye(this,Mi,"f").setValue(e),ye(this,ki,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(ye(this,Lo,"f").y(e))}getUnitValue(){return ye(this,Lo,"f").x(this.getValue())}getControlledValue(){return ye(this,Lo,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ye(this,Fc,"f")??this.getUnitValue()}getControlledPrintValue(){return ye(this,Zo,"f").x(this.getControlledValue())}getPrintValue(){return ye(this,Zo,"f").x(this.getValue())}setPrintValue(e){let r=ye(this,Zo,"f").y(e);r.type==="unitValue"?this.setUnitValue(at(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(ye(this,vv,"f").unwrapOrElse(ye(this,Mi,"f").initValue))}terminate(){ye(this,vl,"f").ifSome(e=>e.terminate()),nr(this,vl,b.None,"f"),ye(this,gl,"f").terminate()}};ki=new WeakMap,Mi=new WeakMap,hv=new WeakMap,gv=new WeakMap,vv=new WeakMap,gl=new WeakMap,Ko=new WeakMap,Wo=new WeakMap,Lo=new WeakMap,Zo=new WeakMap,Go=new WeakMap,vl=new WeakMap,Fc=new WeakMap,qp=new WeakMap;var kb=t=>{switch(t){case l.Automation:return"automated";case l.Modulation:return"modulated";case l.MIDIControl:return"midi";case l.ParameterController:return"external";default:return V(`${t.toString()} is an unknown pointer type`)}};var xv={min:400,max:480,default:440};var Mb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Rn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ro,xl,yv,wv=class{constructor(e,r,n){ro.set(this,void 0),xl.set(this,void 0),yv.set(this,void 0),Mb(this,ro,k.newSet(i=>i.uuid),"f"),Mb(this,xl,new Yt,"f"),Mb(this,yv,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=Rn(this,ro,"f").add(a);re(o,`Could not add ${a}`),Rn(this,xl,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;Rn(this,xl,"f").proxy.onRemove(Rn(this,ro,"f").removeByKey(a))}},n),"f")}subscribe(e){return Rn(this,xl,"f").subscribe(e)}catchupAndSubscribe(e){return Rn(this,ro,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return Rn(this,ro,"f").values()}size(){return Rn(this,ro,"f").size()}isEmpty(){return this.size()===0}terminate(){Rn(this,ro,"f").clear(),Rn(this,xl,"f").terminate(),Rn(this,yv,"f").terminate()}};ro=new WeakMap,xl=new WeakMap,yv=new WeakMap;var Nb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},yt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ib,si,Jp,en,Fr,XS,Cn=class{constructor(e,r){Ib.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Delay,Jp.set(this,void 0),en.set(this,void 0),Fr.set(this,void 0),Nb(this,Jp,e,"f"),Nb(this,en,r,"f"),Nb(this,Fr,new pe(yt(this,Jp,"f")),"f"),this.namedParameter=yt(this,Ib,"m",XS).call(this,r)}get box(){return yt(this,en,"f")}get uuid(){return yt(this,en,"f").address.uuid}get address(){return yt(this,en,"f").address}get indexField(){return yt(this,en,"f").index}get labelField(){return yt(this,en,"f").label}get enabledField(){return yt(this,en,"f").enabled}get minimizedField(){return yt(this,en,"f").minimized}get host(){return yt(this,en,"f").host}deviceHost(){return yt(this,Jp,"f").boxAdapters.adapterFor(yt(this,en,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){yt(this,Fr,"f").terminate()}};si=Cn,Jp=new WeakMap,en=new WeakMap,Fr=new WeakMap,Ib=new WeakSet,XS=function(e){return{preSyncTimeLeft:yt(this,Fr,"f").createParameter(e.preSyncTimeLeft,E.linearInteger(0,si.Fractions.length-1),si.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:yt(this,Fr,"f").createParameter(e.preMillisTimeLeft,E.powerByCenter(100,0,si.MAX_MILLIS_TIME),P.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:yt(this,Fr,"f").createParameter(e.preSyncTimeRight,E.linearInteger(0,si.Fractions.length-1),si.FractionsStringMapping,"pre sync R"),preMillisTimeRight:yt(this,Fr,"f").createParameter(e.preMillisTimeRight,E.powerByCenter(100,0,si.MAX_MILLIS_TIME),P.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:yt(this,Fr,"f").createParameter(e.delayMusical,E.linearInteger(0,si.Fractions.length-1),si.FractionsStringMapping,"delay"),millisTime:yt(this,Fr,"f").createParameter(e.delayMillis,E.powerByCenter(100,0,si.MAX_MILLIS_TIME),P.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:yt(this,Fr,"f").createParameter(e.feedback,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:yt(this,Fr,"f").createParameter(e.cross,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:yt(this,Fr,"f").createParameter(e.lfoSpeed,E.exponential(si.LFO_SPEED_MIN,si.LFO_SPEED_MAX),P.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:yt(this,Fr,"f").createParameter(e.lfoDepth,E.power(4,0,si.LFO_DEPTH_MAX),P.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:yt(this,Fr,"f").createParameter(e.filter,E.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:yt(this,Fr,"f").createParameter(e.dry,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:yt(this,Fr,"f").createParameter(e.wet,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};Cn.Fractions=vo.builder().add([0,1]).add([1,128]).add([1,96]).add([1,64]).add([1,48]).add([1,32]).add([1,24]).add([3,64]).add([1,16]).add([1,12]).add([3,32]).add([1,8]).add([1,6]).add([3,16]).add([1,4]).add([5,16]).add([1,3]).add([3,8]).add([7,16]).add([1,2]).add([1,1]).asAscendingArray();Cn.FractionsStringMapping=P.indices("",si.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));Cn.MAX_MILLIS_TIME=1e3;Cn.LFO_SPEED_MIN=.1;Cn.LFO_SPEED_MAX=5;Cn.LFO_DEPTH_MAX=50;var Bb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},dr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tb,Xp,tn,ya,YS,bv=class{constructor(e,r){Tb.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Reverb,Xp.set(this,void 0),tn.set(this,void 0),ya.set(this,void 0),Bb(this,Xp,e,"f"),Bb(this,tn,r,"f"),Bb(this,ya,new pe(dr(this,Xp,"f")),"f"),this.namedParameter=dr(this,Tb,"m",YS).call(this,r)}get box(){return dr(this,tn,"f")}get uuid(){return dr(this,tn,"f").address.uuid}get address(){return dr(this,tn,"f").address}get indexField(){return dr(this,tn,"f").index}get labelField(){return dr(this,tn,"f").label}get enabledField(){return dr(this,tn,"f").enabled}get minimizedField(){return dr(this,tn,"f").minimized}get host(){return dr(this,tn,"f").host}deviceHost(){return dr(this,Xp,"f").boxAdapters.adapterFor(dr(this,tn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){dr(this,ya,"f").terminate()}};Xp=new WeakMap,tn=new WeakMap,ya=new WeakMap,Tb=new WeakSet,YS=function(e){return{decay:dr(this,ya,"f").createParameter(e.decay,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:dr(this,ya,"f").createParameter(e.preDelay,E.exponential(.001,.5),P.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:dr(this,ya,"f").createParameter(e.damp,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"damping"),filter:dr(this,ya,"f").createParameter(e.filter,E.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter"),dry:dr(this,ya,"f").createParameter(e.dry,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:dr(this,ya,"f").createParameter(e.wet,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};var Db=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Lt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Cb,Yp,Ni,zn,tP,_v=class{constructor(e,r){Cb.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Revamp,Yp.set(this,void 0),Ni.set(this,void 0),zn.set(this,void 0),Db(this,Yp,e,"f"),Db(this,Ni,r,"f"),Db(this,zn,new pe(Lt(this,Yp,"f")),"f"),this.namedParameter=Lt(this,Cb,"m",tP).call(this,r)}get box(){return Lt(this,Ni,"f")}get uuid(){return Lt(this,Ni,"f").address.uuid}get address(){return Lt(this,Ni,"f").address}get indexField(){return Lt(this,Ni,"f").index}get labelField(){return Lt(this,Ni,"f").label}get enabledField(){return Lt(this,Ni,"f").enabled}get minimizedField(){return Lt(this,Ni,"f").minimized}get host(){return Lt(this,Ni,"f").host}get spectrum(){return Lt(this,Ni,"f").address.append(4095)}deviceHost(){return Lt(this,Yp,"f").boxAdapters.adapterFor(Lt(this,Ni,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Lt(this,zn,"f").terminate()}};Yp=new WeakMap,Ni=new WeakMap,zn=new WeakMap,Cb=new WeakSet,tP=function(e){return{highPass:QS(Lt(this,zn,"f"),e.highPass,"High-Pass"),lowShelf:eP(Lt(this,zn,"f"),e.lowShelf,"Low-Shelf"),lowBell:Rb(Lt(this,zn,"f"),e.lowBell,"Low-Bell"),midBell:Rb(Lt(this,zn,"f"),e.midBell,"Mid-Bell"),highBell:Rb(Lt(this,zn,"f"),e.highBell,"High-Bell"),highShelf:eP(Lt(this,zn,"f"),e.highShelf,"High-Shelf"),lowPass:QS(Lt(this,zn,"f"),e.lowPass,"Low-Pass")}};var zb=E.exponential(20,2e4),rP=E.linear(-24,24),iP=E.exponential(.01,10),QS=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,P.bool,"enabled"),frequency:t.createParameter(e.frequency,zb,P.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,E.linearInteger(0,3),P.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,iP,P.numeric({fractionDigits:3}),`${r} Q`)}),eP=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,P.bool,"enabled"),frequency:t.createParameter(e.frequency,zb,P.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,rP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),Rb=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,P.bool,"enabled"),frequency:t.createParameter(e.frequency,zb,P.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,rP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,iP,P.numeric({fractionDigits:3}),`${r} Q`)});var nP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},li=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Av,Fv,ui,Ho=class{constructor(e,r){this.type="marker-event",Av.set(this,new ee),Fv.set(this,void 0),ui.set(this,void 0),nP(this,Fv,e,"f"),nP(this,ui,r,"f"),li(this,Av,"f").own(li(this,ui,"f").subscribe(Oe.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();li(this,ui,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return li(this,ui,"f")}get uuid(){return li(this,ui,"f").address.uuid}get address(){return li(this,ui,"f").address}get position(){return li(this,ui,"f").position.getValue()}get plays(){return li(this,ui,"f").plays.getValue()}get hue(){return li(this,ui,"f").hue.getValue()}get label(){return li(this,ui,"f").label.getValue()}get trackAdapter(){return li(this,ui,"f").track.targetVertex.map(e=>li(this,Fv,"f").boxAdapters.adapterFor(e.box,wa).markerTrack)}terminate(){li(this,Av,"f").terminate()}toString(){return`{MarkerBoxAdapter ${k.toString(li(this,ui,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Av=new WeakMap,Fv=new WeakMap,ui=new WeakMap;Ho.Comparator=(t,e)=>t.position-e.position;var Qp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},rn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ef,Ec,tf,yl,Ev,Sv=class{constructor(e,r){ef.set(this,void 0),Ec.set(this,void 0),tf.set(this,void 0),yl.set(this,void 0),Ev.set(this,void 0),Qp(this,ef,e,"f"),Qp(this,Ec,r,"f"),this.changeNotifier=new me,Qp(this,tf,k.newSet(n=>n.uuid),"f"),Qp(this,yl,ri.create(Ho.Comparator),"f"),Qp(this,Ev,rn(this,Ec,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof yu){let i=rn(this,ef,"f").boxAdapters.adapterFor(n,Ho),a=rn(this,tf,"f").add(i);re(a,"Could not add adapter"),rn(this,yl,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{rn(this,yl,"f").remove(rn(this,tf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return rn(this,ef,"f")}get enabled(){return rn(this,Ec,"f").enabled.getValue()}get events(){return rn(this,yl,"f")}get object(){return rn(this,Ec,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){rn(this,yl,"f").onIndexingChanged(),this.dispatchChange()}terminate(){rn(this,Ev,"f").terminate()}};ef=new WeakMap,Ec=new WeakMap,tf=new WeakMap,yl=new WeakMap,Ev=new WeakMap;var aP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ii=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Pv,$v,Bi,wl=class{constructor(e,r){this.type="signature-event",Pv.set(this,new ee),$v.set(this,void 0),Bi.set(this,void 0),aP(this,$v,e,"f"),aP(this,Bi,r,"f"),Ii(this,Pv,"f").own(Ii(this,Bi,"f").subscribe(Oe.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Ii(this,Bi,"f")}get uuid(){return Ii(this,Bi,"f").address.uuid}get address(){return Ii(this,Bi,"f").address}get index(){return Ii(this,Bi,"f").index.getValue()}get indexField(){return Ii(this,Bi,"f").index}get relativePosition(){return Ii(this,Bi,"f").relativePosition.getValue()}get nominator(){return Ii(this,Bi,"f").nominator.getValue()}get denominator(){return Ii(this,Bi,"f").denominator.getValue()}get trackAdapter(){return Ii(this,Bi,"f").events.targetVertex.map(e=>Ii(this,$v,"f").boxAdapters.adapterFor(e.box,wa).signatureTrack)}terminate(){Ii(this,Pv,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Pv=new WeakMap,$v=new WeakMap,Bi=new WeakMap;wl.Comparator=(t,e)=>t.index-e.index;var kv=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},wt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},qo,rf,nf,bl,io,Jo,oP,Sc,Mv=class{constructor(e,r,n){qo.add(this),rf.set(this,new ee),nf.set(this,void 0),bl.set(this,void 0),io.set(this,void 0),Jo.set(this,void 0),kv(this,nf,e,"f"),kv(this,bl,r,"f"),kv(this,io,n,"f"),this.changeNotifier=new me,kv(this,Jo,wt(this,rf,"f").own(ur.create(wt(this,io,"f").events,i=>e.boxAdapters.adapterFor(i,wl),l.SignatureAutomation)),"f"),wt(this,rf,"f").ownAll(wt(this,bl,"f").subscribe(()=>this.dispatchChange()),wt(this,io,"f").enabled.subscribe(()=>this.dispatchChange()),wt(this,Jo,"f").subscribe({onAdd:i=>this.changeNotifier.notify(),onRemove:i=>this.changeNotifier.notify(),onReorder:i=>this.changeNotifier.notify()}))}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return wt(this,nf,"f")}get enabled(){return wt(this,io,"f").enabled.getValue()}get object(){return wt(this,io,"f")}get size(){return wt(this,Jo,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=wt(this,bl,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return wt(this,Jo,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let r=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:a}of this.iterateAll()){if(n>e)break;r=[i,a]}return r}*iterateAll(){let e=0,r=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i},!!wt(this,io,"f").enabled.getValue())for(let a of wt(this,Jo,"f").adapters())e+=Me.fromSignature(n,i)*a.relativePosition,r+=a.relativePosition,n=a.nominator,i=a.denominator,yield{index:a.index,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i}}changeSignature(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.map(u=>u.accumulatedPpqn);wt(this,bl,"f").nominator.setValue(e),wt(this,bl,"f").denominator.setValue(r);let a=0,o=0,s=Me.fromSignature(e,r);for(let u=0;u<n.length;u++){let d=n[u],m=this.adapterAt(d.index);if(m.isEmpty())continue;let g=(i[u]-a)/s,w=Math.floor(g),_=g-w;o+=_;let N=w;o>=1&&(N++,o--),N=Math.max(1,N),m.unwrap().box.relativePosition.setValue(N),a+=N*s,s=Me.fromSignature(d.nominator,d.denominator)}}deleteAdapter(e){let r=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(w=>w.index===r);if(i===-1)return;let a=n.slice(i+1),o=a.map(w=>w.accumulatedPpqn),s=i>0?n[i-1]:null,[u,d]=s!==null?[s.nominator,s.denominator]:this.storageSignature,m=s!==null?s.accumulatedPpqn:0;e.box.delete();let x=m,g=Me.fromSignature(u,d);for(let w=0;w<a.length;w++){let _=a[w],N=this.adapterAt(_.index);if(N.isEmpty())continue;let W=(o[w]-x)/g,O=Math.max(1,Math.round(W));N.unwrap().box.relativePosition.setValue(O),x+=O*g,g=Me.fromSignature(_.nominator,_.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let N=1;N<i.length&&!(i[N].accumulatedPpqn>e);N++)a=i[N],o=N;let s=Me.fromSignature(a.nominator,a.denominator),u=(e-a.accumulatedPpqn)/s,d=Math.max(1,Math.round(u)),m=a.index+1,x=i.slice(o+1),g=a.accumulatedPpqn+d*s,w=Me.fromSignature(r,n),_=x.map(N=>({event:N,adapter:this.adapterAt(N.index)})).filter(({adapter:N})=>N.nonEmpty()).map(({event:N,adapter:j})=>({event:N,adapter:j.unwrap()}));for(let N=0;N<_.length;N++){let{event:j,adapter:W}=_[N];if(W.box.index.setValue(j.index+1),N===0){let O=(j.accumulatedPpqn-g)/w;W.box.relativePosition.setValue(Math.max(1,Math.round(O)))}}hu.create(wt(this,nf,"f").boxGraph,k.generate(),N=>{N.index.setValue(m),N.relativePosition.setValue(d),N.nominator.setValue(r),N.denominator.setValue(n),N.events.refer(wt(this,io,"f").events)})}adapterAt(e){return wt(this,Jo,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(g=>g.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(g=>g.accumulatedBars),s=wt(this,qo,"m",oP).call(this,r,a.index);if(s===a.accumulatedBars)return;let u=[...o];u[i]=s;let d=u.map((g,w)=>({bar:g,i:w})).sort((g,w)=>g.bar-w.bar).map(g=>g.i),m=n.map(g=>this.adapterAt(g.index).unwrap("adapterAt"));for(let g=0;g<d.length;g++)m[d[g]].box.index.setValue(g);let x=0;for(let g=0;g<d.length;g++){let w=d[g],_=m[w],N=u[w],j=Math.max(1,N-x);_.box.relativePosition.setValue(j),x=N}}floorToBar(e){let{event:r,barPpqn:n}=wt(this,qo,"m",Sc).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=wt(this,qo,"m",Sc).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=wt(this,qo,"m",Sc).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=wt(this,qo,"m",Sc).call(this,e),n=Me.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Me.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=wt(this,qo,"m",Sc).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){wt(this,rf,"f").terminate()}};rf=new WeakMap,nf=new WeakMap,bl=new WeakMap,io=new WeakMap,Jo=new WeakMap,qo=new WeakSet,oP=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(Yn(n)){let[o,s]=this.storageSignature,u=Me.fromSignature(o,s);return Math.max(1,Math.round(e/u))}let i=Me.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},Sc=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(Yn(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Me.fromSignature(n,i)}}return{event:r,barPpqn:Me.fromSignature(r.nominator,r.denominator)}};var af=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Vt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},of,ba,Nv,Iv,no,sf,Bv,wa=class{constructor(e,r){of.set(this,new ee),ba.set(this,void 0),Nv.set(this,void 0),Iv.set(this,void 0),no.set(this,void 0),sf.set(this,void 0),Bv.set(this,()=>{let{tempoTrack:{enabled:s}}=Vt(this,ba,"f");return s.getValue()?Vt(this,no,"f").isEmpty()?b.None:Vt(this,no,"f").unwrap().events.isEmpty()?b.None:Vt(this,no,"f"):b.None}),af(this,ba,r,"f"),af(this,Nv,new Sv(e,r.markerTrack),"f"),af(this,Iv,new Mv(e,r.signature,r.signatureTrack),"f"),af(this,no,new wr,"f"),af(this,sf,new me,"f");let n=Vt(this,of,"f").own(new ee),i=()=>Vt(this,sf,"f").notify(Vt(this,Bv,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;Vt(this,of,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>Vt(this,no,"f").clear(),some:({box:u})=>{let d=e.boxAdapters.adapterFor(u,_r);Vt(this,no,"f").wrap(d),n.ownAll(d.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(Vt(this,Bv,"f").call(this)),Vt(this,sf,"f").subscribe(e)}get box(){return Vt(this,ba,"f")}get uuid(){return Vt(this,ba,"f").address.uuid}get address(){return Vt(this,ba,"f").address}get markerTrack(){return Vt(this,Nv,"f")}get signatureTrack(){return Vt(this,Iv,"f")}get tempoTrackEvents(){return Vt(this,no,"f")}get signature(){let{nominator:e,denominator:r}=Vt(this,ba,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=Vt(this,ba,"f").signature;return Me.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Vt(this,ba,"f").signature.subscribe(()=>e(this.signature))}terminate(){Vt(this,of,"f").terminate()}};of=new WeakMap,ba=new WeakMap,Nv=new WeakMap,Iv=new WeakMap,no=new WeakMap,sf=new WeakMap,Bv=new WeakMap;var lB=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},lf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xo,Yo=class{constructor(e,r){Xo.set(this,void 0),lB(this,Xo,r,"f")}get box(){return lf(this,Xo,"f")}get uuid(){return lf(this,Xo,"f").address.uuid}get address(){return lf(this,Xo,"f").address}get source(){return lf(this,Xo,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return lf(this,Xo,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};Xo=new WeakMap;var _l=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},nn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tv,Al,Fl,Dv,Rv,uf,an=class{constructor(e,r){Tv.set(this,void 0),Al.set(this,void 0),Fl.set(this,void 0),Dv.set(this,void 0),Rv.set(this,void 0),uf.set(this,!1),_l(this,Tv,e,"f"),_l(this,Al,r,"f"),_l(this,Fl,new ee,"f"),_l(this,Dv,r.attributes,"f"),_l(this,Rv,nn(this,Fl,"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 nn(this,Fl,"f").own(e)}ownAll(...e){nn(this,Fl,"f").ownAll(...e)}onSelected(){_l(this,uf,!0,"f")}onDeselected(){_l(this,uf,!1,"f")}isSelected(){return nn(this,uf,"f")}get box(){return nn(this,Al,"f")}get attributes(){return nn(this,Dv,"f")}get uuid(){return nn(this,Al,"f").address.uuid}get address(){return nn(this,Al,"f").address}get parameters(){return nn(this,Rv,"f")}get modular(){return nn(this,Tv,"f").boxAdapters.adapterFor(nn(this,Al,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,Qo)}terminate(){nn(this,Fl,"f").terminate()}};Tv=new WeakMap,Al=new WeakMap,Fl=new WeakMap,Dv=new WeakMap,Rv=new WeakMap,uf=new WeakMap;var Cv=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ao=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zv,es,cf,Ov,Br;(function(t){t.Input="input",t.Output="output"})(Br||(Br={}));var Tr=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){zv.set(this,void 0),es.set(this,void 0),cf.set(this,void 0),Ov.set(this,void 0),Cv(this,zv,e,"f"),Cv(this,es,r,"f"),Cv(this,cf,n,"f"),Cv(this,Ov,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(r=>e.field.pointerRules.accepts.some(n=>n===r))}get connections(){return ao(this,es,"f").pointerHub.isEmpty()?se.empty():ao(this,es,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>ao(this,zv,"f").adapterFor(e,Yo))}get field(){return ao(this,es,"f")}get address(){return ao(this,es,"f").address}get direction(){return ao(this,cf,"f")}get name(){return ao(this,Ov,"f")}toString(){return`{ModuleConnectorAdapter address: ${ao(this,es,"f").address.toString()}, direction: ${ao(this,cf,"f")}}`}};zv=new WeakMap,es=new WeakMap,cf=new WeakMap,Ov=new WeakMap;var Ob=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},df=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vv,pf,ff,Pc=class extends an{constructor(e,r){super(e,r),Vv.set(this,void 0),pf.set(this,void 0),ff.set(this,void 0),Ob(this,Vv,this.parameters.createParameter(r.time,E.exponential(1,1e4),P.numeric({unit:"ms"}),"Time"),"f"),Ob(this,pf,Tr.create(e.boxAdapters,r.voltageInput,Br.Input,"Input"),"f"),Ob(this,ff,Tr.create(e.boxAdapters,r.voltageOutput,Br.Output,"Output"),"f")}get parameterTime(){return df(this,Vv,"f")}get voltageInput(){return df(this,pf,"f")}get voltageOutput(){return df(this,ff,"f")}get inputs(){return[df(this,pf,"f")]}get outputs(){return[df(this,ff,"f")]}};Vv=new WeakMap,pf=new WeakMap,ff=new WeakMap;var uB=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},sP=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},mf,$c=class extends an{constructor(e,r){super(e,r),mf.set(this,void 0),uB(this,mf,Tr.create(e.boxAdapters,r.input,Br.Input,"Input"),"f")}get voltageInput(){return sP(this,mf,"f")}get inputs(){return[sP(this,mf,"f")]}get outputs(){return se.empty()}};mf=new WeakMap;var Vb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Uv,gf,vf,kc=class extends an{constructor(e,r){super(e,r),Uv.set(this,void 0),gf.set(this,void 0),vf.set(this,void 0),Vb(this,Uv,this.parameters.createParameter(r.gain,E.DefaultDecibel,P.numeric({unit:"db"}),"Gain"),"f"),Vb(this,gf,Tr.create(e.boxAdapters,r.voltageInput,Br.Input,"Input"),"f"),Vb(this,vf,Tr.create(e.boxAdapters,r.voltageOutput,Br.Output,"Output"),"f")}get parameterGain(){return hf(this,Uv,"f")}get voltageInput(){return hf(this,gf,"f")}get voltageOutput(){return hf(this,vf,"f")}get inputs(){return[hf(this,gf,"f")]}get outputs(){return[hf(this,vf,"f")]}};Uv=new WeakMap,gf=new WeakMap,vf=new WeakMap;var Ub=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},jb=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},jv,Kv,Wv,Mc=class extends an{constructor(e,r){super(e,r),jv.set(this,void 0),Kv.set(this,void 0),Wv.set(this,void 0),Ub(this,jv,Tr.create(e.boxAdapters,r.voltageInputX,Br.Input,"X"),"f"),Ub(this,Kv,Tr.create(e.boxAdapters,r.voltageInputY,Br.Input,"Y"),"f"),Ub(this,Wv,Tr.create(e.boxAdapters,r.voltageOutput,Br.Output,"Result"),"f")}get inputs(){return[jb(this,jv,"f"),jb(this,Kv,"f")]}get outputs(){return[jb(this,Wv,"f")]}};jv=new WeakMap,Kv=new WeakMap,Wv=new WeakMap;var cB=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},lP=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xf,Nc=class extends an{constructor(e,r){super(e,r),xf.set(this,void 0),cB(this,xf,Tr.create(e.boxAdapters,r.output,Br.Output,"Output"),"f")}get voltageOutput(){return lP(this,xf,"f")}get inputs(){return se.empty()}get outputs(){return[lP(this,xf,"f")]}};xf=new WeakMap;var Ic;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>ze(r.accept({visitModuleGainBox:n=>e.adapterFor(n,kc),visitModuleDelayBox:n=>e.adapterFor(n,Pc),visitModuleMultiplierBox:n=>e.adapterFor(n,Mc),visitModularAudioInputBox:n=>e.adapterFor(n,Nc),visitModularAudioOutputBox:n=>e.adapterFor(n,$c)}),`Could not find ModuleAdapter for ${r.name}`)})(Ic||(Ic={}));var uP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},El=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Lv,Zv,Sl,Kb,Bc=class{constructor(e,r){Lv.add(this),Zv.set(this,void 0),Sl.set(this,void 0),uP(this,Zv,e,"f"),uP(this,Sl,r,"f")}get box(){return El(this,Sl,"f")}get uuid(){return El(this,Sl,"f").address.uuid}get address(){return El(this,Sl,"f").address}get moduleAdapter(){return Ic.adapterFor(El(this,Zv,"f").boxAdapters,El(this,Lv,"a",Kb).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(El(this,Lv,"a",Kb).address)}terminate(){}};Zv=new WeakMap,Sl=new WeakMap,Lv=new WeakSet,Kb=function(){return El(this,Sl,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var cP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ci=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tc,di,Dc=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Modular,Tc.set(this,void 0),di.set(this,void 0),cP(this,Tc,e,"f"),cP(this,di,r,"f")}get box(){return ci(this,di,"f")}get uuid(){return ci(this,di,"f").address.uuid}get address(){return ci(this,di,"f").address}get indexField(){return ci(this,di,"f").index}get labelField(){return ci(this,di,"f").label}get enabledField(){return ci(this,di,"f").enabled}get minimizedField(){return ci(this,di,"f").minimized}get host(){return ci(this,di,"f").host}parameterAt(e){return V("Not yet implemented")}deviceHost(){return ci(this,Tc,"f").boxAdapters.adapterFor(ci(this,di,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return ci(this,Tc,"f").boxAdapters.adapterFor(ci(this,di,"f").modularSetup.targetVertex.unwrap("No Modular found").box,Qo)}elements(){return ci(this,di,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>ci(this,Tc,"f").boxAdapters.adapterFor(e.box,Bc))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Tc=new WeakMap,di=new WeakMap;var yf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ot=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Rc,ts,Cc,Ti,Pl,$l,Qo=class{constructor(e,r){Rc.set(this,new ee),ts.set(this,void 0),Cc.set(this,void 0),Ti.set(this,void 0),Pl.set(this,void 0),$l.set(this,void 0),yf(this,Cc,e,"f"),yf(this,Ti,r,"f"),yf(this,ts,ot(this,Rc,"f").own(new Yt),"f"),yf(this,Pl,k.newSet(s=>s.uuid),"f"),yf(this,$l,k.newSet(s=>s.uuid),"f");let n=s=>{let u=Ic.adapterFor(ot(this,Cc,"f").boxAdapters,s.box);ot(this,Pl,"f").add(u)&&ot(this,ts,"f").proxy.onModuleAdded(u)},i=s=>ot(this,ts,"f").proxy.onModuleRemoved(ot(this,Pl,"f").removeByKey(s.address.uuid)),a=s=>{let u=ot(this,Cc,"f").boxAdapters.adapterFor(s.box,Yo);ot(this,$l,"f").add(u)&&ot(this,ts,"f").proxy.onConnectionAdded(u)},o=s=>ot(this,ts,"f").proxy.onConnectionRemoved(ot(this,$l,"f").removeByKey(s.address.uuid));ot(this,Ti,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),ot(this,Ti,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),ot(this,Rc,"f").own(ot(this,Ti,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),ot(this,Rc,"f").own(ot(this,Ti,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return sb(e.onModuleAdded,r=>ot(this,Pl,"f").forEach(n=>r(n))),sb(e.onConnectionAdded,r=>ot(this,$l,"f").forEach(n=>r(n))),ot(this,ts,"f").subscribe(e)}get box(){return ot(this,Ti,"f")}get address(){return ot(this,Ti,"f").address}get uuid(){return ot(this,Ti,"f").address.uuid}get editingField(){return ot(this,Ti,"f").editing}get labelField(){return ot(this,Ti,"f").label}get modules(){return ot(this,Pl,"f").values()}get connections(){return ot(this,$l,"f").values()}get device(){return ot(this,Cc,"f").boxAdapters.adapterFor(ze(ot(this,Ti,"f").device.pointerHub.incoming().at(0),"No device found").box,Dc)}terminate(){console.debug(`terminate ${this}`),ot(this,Rc,"f").terminate()}};Rc=new WeakMap,ts=new WeakMap,Cc=new WeakMap,Ti=new WeakMap,Pl=new WeakMap,$l=new WeakMap;var wf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Hr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Wb,Oc,bf,Gv,zc,Af,Hv,_f,qv,dP,_a=class{constructor(e,r){Wb.add(this),this.type="groove-adapter",bf.set(this,new ee),Gv.set(this,void 0),zc.set(this,void 0),Af.set(this,void 0),Hv.set(this,new yh({duration:()=>Hr(this,qv,"f"),fx:n=>db(n,Hr(this,_f,"f")),fy:n=>db(n,1-Hr(this,_f,"f"))})),_f.set(this,0),qv.set(this,Me.SemiQuaver*2),wf(this,Gv,e,"f"),wf(this,zc,r,"f"),wf(this,Af,Hr(this,bf,"f").own(new pe(Hr(this,Gv,"f"))),"f"),this.namedParameter=Hr(this,Wb,"m",dP).call(this,r),Hr(this,bf,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>wf(this,qv,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>wf(this,_f,wS(n.getValue(),.01),"f")))}unwarp(e){return Hr(this,Hv,"f").unwarp(e)}warp(e){return Hr(this,Hv,"f").warp(e)}get box(){return Hr(this,zc,"f")}get uuid(){return Hr(this,zc,"f").address.uuid}get address(){return Hr(this,zc,"f").address}terminate(){Hr(this,bf,"f").terminate()}};Oc=_a,bf=new WeakMap,Gv=new WeakMap,zc=new WeakMap,Af=new WeakMap,Hv=new WeakMap,_f=new WeakMap,qv=new WeakMap,Wb=new WeakSet,dP=function(e){return{duration:Hr(this,Af,"f").createParameter(e.duration,E.values(Oc.DurationPPQNs),P.values("",Oc.DurationPPQNs,Oc.DurationStrings),"duration"),amount:Hr(this,Af,"f").createParameter(e.amount,E.unipolar(),P.percent({fractionDigits:0}),"amount")}};_a.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];_a.DurationPPQNs=Oc.Durations.map(([t,e])=>Me.fromSignature(t,e));_a.DurationStrings=Oc.Durations.map(([t,e])=>`${t}/${e}`);var Vc=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Rt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Aa,rs,Uc,Jv,Xv,Ff,Ef,Lb,is=class{constructor(e,r,n,i,a){Aa.set(this,void 0),rs.set(this,void 0),Uc.set(this,void 0),Jv.set(this,void 0),Xv.set(this,void 0),Ff.set(this,new ee),Ef.set(this,void 0),Lb.set(this,b.None),Vc(this,Aa,e,"f"),Vc(this,rs,r,"f"),Vc(this,Uc,n,"f"),Vc(this,Jv,i,"f"),Vc(this,Xv,a??0,"f"),Vc(this,Ef,Rt(this,Ff,"f").own(new me),"f"),Rt(this,Ff,"f").own(Rt(this,Aa,"f").subscribe(()=>Rt(this,Ef,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Rt(this,Aa,"f")}get valueMapping(){return Rt(this,rs,"f")}get stringMapping(){return Rt(this,Uc,"f")}get name(){return Rt(this,Jv,"f")}get anchor(){return Rt(this,Xv,"f")}get type(){return Rt(this,Aa,"f").type}get address(){return Rt(this,Aa,"f").address}get track(){return Rt(this,Lb,"f")}subscribe(e){return Rt(this,Ef,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Rt(this,Aa,"f").getValue()}setValue(e){Rt(this,Aa,"f").setValue(Rt(this,rs,"f").clamp(e))}setUnitValue(e){this.setValue(Rt(this,rs,"f").y(e))}getUnitValue(){return Rt(this,rs,"f").x(this.getValue())}getPrintValue(){return Rt(this,Uc,"f").x(this.getValue())}setPrintValue(e){let r=Rt(this,Uc,"f").y(e);r.type==="unitValue"?this.setUnitValue(at(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Rt(this,rs,"f").clamp(Rt(this,Aa,"f").initValue))}terminate(){Rt(this,Ff,"f").terminate()}};Aa=new WeakMap,rs=new WeakMap,Uc=new WeakMap,Jv=new WeakMap,Xv=new WeakMap,Ff=new WeakMap,Ef=new WeakMap,Lb=new WeakMap;var jc=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},on=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fa,Yv,Qv,ex,tx,rx,ix=class{constructor(e){Fa.set(this,void 0),Yv.set(this,void 0),Qv.set(this,void 0),ex.set(this,void 0),tx.set(this,void 0),rx.set(this,void 0),jc(this,Fa,e,"f"),jc(this,Yv,new is(on(this,Fa,"f").keyboard,E.values([88,76,61,49]),P.numeric({fractionDigits:1}),"Keyboard Type"),"f"),jc(this,Qv,new is(on(this,Fa,"f").timeRangeInQuarters,E.exponential(1,64),P.numeric({fractionDigits:1}),"Time-Range"),"f"),jc(this,ex,new is(on(this,Fa,"f").noteScale,E.exponential(.5,2),P.numeric({fractionDigits:1}),"Note Scale"),"f"),jc(this,tx,new is(on(this,Fa,"f").noteLabels,E.bool,P.bool,"Note Labels"),"f"),jc(this,rx,new is(on(this,Fa,"f").transpose,E.linearInteger(-48,48),P.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return on(this,Fa,"f").box.subscribe(Oe.Children,()=>e(this))}get object(){return on(this,Fa,"f")}get keyboard(){return on(this,Yv,"f")}get timeRangeInQuarters(){return on(this,Qv,"f")}get noteScale(){return on(this,ex,"f")}get noteLabels(){return on(this,tx,"f")}get transpose(){return on(this,rx,"f")}};Fa=new WeakMap,Yv=new WeakMap,Qv=new WeakMap,ex=new WeakMap,tx=new WeakMap,rx=new WeakMap;var Sf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ar=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kl,Di,Ml,nx,ax,ox=class{constructor(e,r){kl.set(this,void 0),Di.set(this,void 0),Ml.set(this,void 0),nx.set(this,void 0),ax.set(this,void 0),Sf(this,kl,e,"f"),Sf(this,Di,r,"f"),Sf(this,Ml,ur.create(ar(this,Di,"f").audioUnits,n=>ar(this,kl,"f").boxAdapters.adapterFor(n,Qi),l.AudioUnits),"f"),Sf(this,nx,new wv(ar(this,Di,"f").audioBusses.pointerHub,n=>ar(this,kl,"f").boxAdapters.adapterFor(n,Si),l.AudioBusses),"f"),Sf(this,ax,new ix(ar(this,Di,"f").pianoMode),"f")}get uuid(){return ar(this,Di,"f").address.uuid}get address(){return ar(this,Di,"f").address}get box(){return ar(this,Di,"f")}get audioBusses(){return ar(this,nx,"f")}get audioUnits(){return ar(this,Ml,"f")}get clips(){return ar(this,Ml,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return ar(this,kl,"f").boxAdapters.adapterFor(ar(this,Di,"f").groove.targetVertex.unwrap("no groove").box,_a)}get timeline(){return ar(this,kl,"f").boxAdapters.adapterFor(ar(this,Di,"f").timeline.targetVertex.unwrap("no timeline").box,wa)}get pianoMode(){return ar(this,ax,"f")}get created(){return new Date(ar(this,Di,"f").created.getValue())}get midiOutputDevices(){return ar(this,Di,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ie(e,Po))}*labeledAudioOutputs(){for(let e of ar(this,Ml,"f").adapters())yield{label:e.label,address:e.address,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){ar(this,Ml,"f").terminate()}};kl=new WeakMap,Di=new WeakMap,Ml=new WeakMap,nx=new WeakMap,ax=new WeakMap;var Zb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Dr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gb,Pf,On,ns,pP,sx=class{constructor(e,r){Gb.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=le.Tape,Pf.set(this,void 0),On.set(this,void 0),ns.set(this,void 0),Zb(this,Pf,e,"f"),Zb(this,On,r,"f"),Zb(this,ns,new pe(Dr(this,Pf,"f")),"f"),this.namedParameter=Dr(this,Gb,"m",pP).call(this,r)}get box(){return Dr(this,On,"f")}get uuid(){return Dr(this,On,"f").address.uuid}get address(){return Dr(this,On,"f").address}get labelField(){return Dr(this,On,"f").label}get iconField(){return Dr(this,On,"f").icon}get defaultTrackType(){return ve.Audio}get enabledField(){return Dr(this,On,"f").enabled}get minimizedField(){return Dr(this,On,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Dr(this,Pf,"f").boxAdapters.adapterFor(Dr(this,On,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Dr(this,ns,"f").terminate()}};Pf=new WeakMap,On=new WeakMap,ns=new WeakMap,Gb=new WeakSet,pP=function(e){return{flutter:Dr(this,ns,"f").createParameter(e.flutter,E.unipolar(),P.percent(),"flutter"),wow:Dr(this,ns,"f").createParameter(e.wow,E.unipolar(),P.percent(),"wow"),noise:Dr(this,ns,"f").createParameter(e.noise,E.unipolar(),P.percent(),"noise"),saturation:Dr(this,ns,"f").createParameter(e.saturation,E.unipolar(),P.percent(),"saturation")}};var Nl=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[ta.sine,ta.triangle,ta.saw,ta.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:E.exponential(20,2e4),CUTOFF_STRING_MAPPING:P.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:E.values(r),FILTER_ORDER_STRING_MAPPING:P.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:E.values(i),LFO_WAVEFORM_STRING_MAPPING:P.values("",i,a)}})();var Hb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},je=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},qb,$f,Vn,it,fP,lx=class{constructor(e,r){qb.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=le.Vaporisateur,$f.set(this,void 0),Vn.set(this,void 0),it.set(this,void 0),Hb(this,$f,e,"f"),Hb(this,Vn,r,"f"),Hb(this,it,new pe(je(this,$f,"f")),"f"),this.namedParameter=je(this,qb,"m",fP).call(this,r)}get box(){return je(this,Vn,"f")}get uuid(){return je(this,Vn,"f").address.uuid}get address(){return je(this,Vn,"f").address}get labelField(){return je(this,Vn,"f").label}get iconField(){return je(this,Vn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return je(this,Vn,"f").enabled}get minimizedField(){return je(this,Vn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return je(this,$f,"f").boxAdapters.adapterFor(je(this,Vn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){je(this,it,"f").terminate()}};$f=new WeakMap,Vn=new WeakMap,it=new WeakMap,qb=new WeakSet,fP=function(e){let r=[Ds.Monophonic,Ds.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:je(this,it,"f").createParameter(n.waveform,E.linearInteger(0,3),P.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:je(this,it,"f").createParameter(n.volume,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:je(this,it,"f").createParameter(n.octave,E.linearInteger(-3,3),P.numeric({unit:"oct"}),"Octave",.5),tune:je(this,it,"f").createParameter(n.tune,E.linear(-1200,1200),P.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:je(this,it,"f").createParameter(e.noise.volume,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:je(this,it,"f").createParameter(e.noise.attack,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:je(this,it,"f").createParameter(e.noise.hold,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Hold"),release:je(this,it,"f").createParameter(e.noise.release,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:je(this,it,"f").createParameter(e.filterOrder,Nl.FILTER_ORDER_VALUE_MAPPING,Nl.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:je(this,it,"f").createParameter(e.cutoff,Nl.CUTOFF_VALUE_MAPPING,Nl.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:je(this,it,"f").createParameter(e.resonance,E.exponential(.01,10),P.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:je(this,it,"f").createParameter(e.attack,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:je(this,it,"f").createParameter(e.decay,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:je(this,it,"f").createParameter(e.sustain,E.unipolar(),P.percent({fractionDigits:1}),"Sustain"),release:je(this,it,"f").createParameter(e.release,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:je(this,it,"f").createParameter(e.filterEnvelope,E.bipolar(),P.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:je(this,it,"f").createParameter(e.filterKeyboard,E.bipolar(),P.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:je(this,it,"f").createParameter(e.voicingMode,E.values(r),P.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:je(this,it,"f").createParameter(e.glideTime,E.unipolar(),P.percent({fractionDigits:1}),"Glide time",0),unisonCount:je(this,it,"f").createParameter(e.unisonCount,E.values([1,3,5]),P.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:je(this,it,"f").createParameter(e.unisonDetune,E.exponential(1,1200),P.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:je(this,it,"f").createParameter(e.unisonStereo,E.unipolar(),P.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:je(this,it,"f").createParameter(e.lfo.waveform,Nl.LFO_WAVEFORM_VALUE_MAPPING,Nl.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:je(this,it,"f").createParameter(e.lfo.rate,E.exponential(1e-4,30),P.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:je(this,it,"f").createParameter(e.lfo.targetTune,E.bipolar(),P.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:je(this,it,"f").createParameter(e.lfo.targetVolume,E.bipolar(),P.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:je(this,it,"f").createParameter(e.lfo.targetCutoff,E.bipolar(),P.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var Jb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},pr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xb,ux,kf,sn,Ea,mP,Il=class{constructor(e,r){Xb.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=le.Arpeggio,kf.set(this,void 0),sn.set(this,void 0),Ea.set(this,void 0),Jb(this,kf,e,"f"),Jb(this,sn,r,"f"),Jb(this,Ea,new pe(pr(this,kf,"f")),"f"),this.namedParameter=pr(this,Xb,"m",mP).call(this,r)}get box(){return pr(this,sn,"f")}get uuid(){return pr(this,sn,"f").address.uuid}get address(){return pr(this,sn,"f").address}get indexField(){return pr(this,sn,"f").index}get labelField(){return pr(this,sn,"f").label}get enabledField(){return pr(this,sn,"f").enabled}get minimizedField(){return pr(this,sn,"f").minimized}get host(){return pr(this,sn,"f").host}deviceHost(){return pr(this,kf,"f").boxAdapters.adapterFor(pr(this,sn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){pr(this,Ea,"f").terminate()}};ux=Il,kf=new WeakMap,sn=new WeakMap,Ea=new WeakMap,Xb=new WeakSet,mP=function(e){return{modeIndex:pr(this,Ea,"f").createParameter(e.modeIndex,E.linearInteger(0,2),P.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:pr(this,Ea,"f").createParameter(e.numOctaves,E.linearInteger(1,5),P.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:pr(this,Ea,"f").createParameter(e.rateIndex,E.linearInteger(0,ux.RateFractions.length-1),ux.RateStringMapping,"Rate"),gate:pr(this,Ea,"f").createParameter(e.gate,E.linear(0,2),P.percent({fractionDigits:0}),"Gate"),repeat:pr(this,Ea,"f").createParameter(e.repeat,E.linearInteger(1,16),P.numeric({fractionDigits:0}),"Repeat"),velocity:pr(this,Ea,"f").createParameter(e.velocity,E.bipolar(),P.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Il.RateFractions=vo.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();Il.RateStringMapping=P.indices("",ux.RateFractions.map(([t,e])=>`${t}/${e}`));var Yb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Rr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qb,Mf,ln,Bl,hP,cx=class{constructor(e,r){Qb.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=le.Pitch,Mf.set(this,void 0),ln.set(this,void 0),Bl.set(this,void 0),Yb(this,Mf,e,"f"),Yb(this,ln,r,"f"),Yb(this,Bl,new pe(Rr(this,Mf,"f")),"f"),this.namedParameter=Rr(this,Qb,"m",hP).call(this,r)}get box(){return Rr(this,ln,"f")}get uuid(){return Rr(this,ln,"f").address.uuid}get address(){return Rr(this,ln,"f").address}get indexField(){return Rr(this,ln,"f").index}get labelField(){return Rr(this,ln,"f").label}get enabledField(){return Rr(this,ln,"f").enabled}get minimizedField(){return Rr(this,ln,"f").minimized}get host(){return Rr(this,ln,"f").host}deviceHost(){return Rr(this,Mf,"f").boxAdapters.adapterFor(Rr(this,ln,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Rr(this,Bl,"f").terminate()}};Mf=new WeakMap,ln=new WeakMap,Bl=new WeakMap,Qb=new WeakSet,hP=function(e){return{octaves:Rr(this,Bl,"f").createParameter(e.octaves,E.linearInteger(-7,7),P.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Rr(this,Bl,"f").createParameter(e.semiTones,E.linearInteger(-36,36),P.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Rr(this,Bl,"f").createParameter(e.cents,E.linear(-50,50),P.numeric({unit:"cents",fractionDigits:1}),"cents")}};var dB=/^\/\/ @label .+$/m,gP=/^\/\/ @param .+$/gm,vP=/^\/\/ @sample .+$/gm;var xP=/^\/\/ @(group|param|sample) .+$/gm,yP=/^\/\/ @(?:param|sample) \S+/gm,Kc=1e-6,pB=["linear","exp","int","bool"],fB=new class{x(t){return{value:t>=.5?"On":"Off",unit:""}}y(t){let e=t.trim().toLowerCase();return{type:"explicit",value:e==="on"||e==="true"||e==="yes"?1:0}}},wP=t=>{let e=t.replace(/^\/\/ @param\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(e.length===0)throw new Error(`Malformed @param: '${t}'`);let r=e[0];if(e.length===1)return{label:r,defaultValue:0,min:0,max:1,mapping:"unipolar",unit:""};let n=e[1];if(n==="true"||n==="false")return{label:r,defaultValue:n==="true"?1:0,min:0,max:1,mapping:"bool",unit:""};if(n==="bool")return{label:r,defaultValue:0,min:0,max:1,mapping:"bool",unit:""};let i=parseFloat(n);if(isNaN(i))throw new Error(`Malformed @param: '${t}' \u2014 '${n}' is not a valid number`);if(e.length===2)return{label:r,defaultValue:i,min:0,max:1,mapping:"unipolar",unit:""};if(e.length===3&&e[2]==="bool")return{label:r,defaultValue:i>=.5?1:0,min:0,max:1,mapping:"bool",unit:""};if(e.length===4){let d=parseFloat(e[2]),m=parseFloat(e[3]);if(isNaN(d)||isNaN(m))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(m-d<Kc)throw new Error(`Malformed @param: '${t}' \u2014 min (${d}) must be less than max (${m})`);if(i<d-Kc||i>m+Kc)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${d}, ${m}]`);return{label:r,defaultValue:i,min:d,max:m,mapping:"linear",unit:""}}if(e.length<5)throw new Error(`Malformed @param: '${t}' \u2014 expected: // @param <name> <default> <min> <max> [type] [unit]`);let a=parseFloat(e[2]),o=parseFloat(e[3]),s=e[4],u=e.length>=6?e[5]:"";if(isNaN(a)||isNaN(o))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(!pB.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<Kc)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-Kc||i>o+Kc)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${a}, ${o}]`);return{label:r,defaultValue:i,min:a,max:o,mapping:s,unit:u}},bP=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,mB=(t,e)=>bP(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,xr;(function(t){t.isEqual=mB,t.parseLabel=e=>{let r=dB.exec(e);if(r===null)return b.None;let n=r[0].replace(/^\/\/ @label\s+/,"").trim();if(n.length===0)throw new Error("Malformed @label: expected: // @label <name>");return b.wrap(n)},t.parseParams=e=>{let r=[],n;for(gP.lastIndex=0;(n=gP.exec(e))!==null;)r.push(wP(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(vP.lastIndex=0;(n=vP.exec(e))!==null;){let i=n[0].replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(i.length===0||i[0].length===0)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);if(i.length>1)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);r.push({label:i[0]})}return r},t.parseDeclarationOrder=e=>{let r=new Map,n;yP.lastIndex=0;let i=0;for(;(n=yP.exec(e))!==null;){let a=n[0].replace(/^\/\/ @(?:param|sample)\s+/,"").split(/\s+/)[0];r.has(a)||r.set(a,i++)}return r},t.parseGroups=e=>{let r=[],n=null,i=[];xP.lastIndex=0;let a;for(;(a=xP.exec(e))!==null;){let o=a[0],s=a[1];if(s==="group"){(i.length>0||n!==null)&&r.push({group:n,items:i});let u=o.replace(/^\/\/ @group\s+/,"").trim().split(/\s+/);n={label:u[0],color:u[1]??"dark"},i=[]}else if(s==="param")i.push({type:"param",declaration:wP(o)});else if(s==="sample"){let u=o.replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(u.length===0||u[0].length===0)throw new Error(`Malformed @sample: '${o}' \u2014 expected: // @sample <name>`);i.push({type:"sample",declaration:{label:u[0]}})}}return(i.length>0||n!==null)&&r.push({group:n,items:i}),r},t.resolveValueMapping=e=>{switch(e.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(e.min,e.max);case"exp":return E.exponential(e.min,e.max);case"int":return E.linearInteger(e.min,e.max);case"bool":return E.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return P.percent();case"linear":return P.numeric({unit:e.unit,fractionDigits:2});case"exp":return P.numeric({unit:e.unit,fractionDigits:2});case"int":return P.numeric({unit:e.unit,fractionDigits:0});case"bool":return fB}},t.resolveParamMappings=e=>({valueMapping:t.resolveValueMapping(e),stringMapping:t.resolveStringMapping(e)}),t.subscribeScriptParams=(e,r,n)=>{let i=new Map,a=new me;return{terminable:fe.many(n.pointerHub.catchupAndSubscribe({onAdded:(({box:s})=>{let u=Ie(s,sa),d=u.label.getValue(),x=t.parseParams(r.getValue()).find(_=>_.label===d),{valueMapping:g,stringMapping:w}=K(x)?t.resolveParamMappings(x):{valueMapping:E.unipolar(),stringMapping:P.percent({fractionDigits:1})};e.createParameter(u.value,g,w,d,void 0,u.defaultValue.getValue()),K(x)&&i.set(d,x)}),onRemoved:(({box:s})=>{let u=Ie(s,sa);i.delete(u.label.getValue()),e.removeParameter(u.value.address)})}),r.subscribe(()=>{let s=t.parseParams(r.getValue());for(let u of e.parameters()){let d=s.find(w=>w.label===u.name);if(!K(d))continue;let m=i.get(u.name);if(K(m)&&bP(m,d))continue;let{valueMapping:x,stringMapping:g}=t.resolveParamMappings(d);u.updateMappings(x,g),i.set(u.name,d)}a.notify()}),a),codeChanged:a}}})(xr||(xr={}));var dx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Er=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nf,If,un,Bf,px,fx=class{constructor(e,r){Nf.set(this,new ee),this.type="midi-effect",this.accepts="midi",this.manualUrl=le.Spielwerk,If.set(this,void 0),un.set(this,void 0),Bf.set(this,void 0),px.set(this,void 0),dx(this,If,e,"f"),dx(this,un,r,"f"),dx(this,Bf,Er(this,Nf,"f").own(new pe(Er(this,If,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(Er(this,Bf,"f"),r.code,r.parameters);Er(this,Nf,"f").own(n),dx(this,px,i,"f")}get box(){return Er(this,un,"f")}get uuid(){return Er(this,un,"f").address.uuid}get address(){return Er(this,un,"f").address}get indexField(){return Er(this,un,"f").index}get labelField(){return Er(this,un,"f").label}get enabledField(){return Er(this,un,"f").enabled}get minimizedField(){return Er(this,un,"f").minimized}get host(){return Er(this,un,"f").host}get parameters(){return Er(this,Bf,"f")}get codeChanged(){return Er(this,px,"f")}deviceHost(){return Er(this,If,"f").boxAdapters.adapterFor(Er(this,un,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Er(this,Nf,"f").terminate()}};Nf=new WeakMap,If=new WeakMap,un=new WeakMap,Bf=new WeakMap,px=new WeakMap;var mx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Cr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tf,Df,Un,Rf,hx,gx=class{constructor(e,r){Tf.set(this,new ee),this.type="instrument",this.accepts="midi",this.manualUrl=le.Apparat,Df.set(this,void 0),Un.set(this,void 0),Rf.set(this,void 0),hx.set(this,void 0),mx(this,Df,e,"f"),mx(this,Un,r,"f"),mx(this,Rf,Cr(this,Tf,"f").own(new pe(Cr(this,Df,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(Cr(this,Rf,"f"),r.code,r.parameters);Cr(this,Tf,"f").own(n),mx(this,hx,i,"f")}get box(){return Cr(this,Un,"f")}get uuid(){return Cr(this,Un,"f").address.uuid}get address(){return Cr(this,Un,"f").address}get labelField(){return Cr(this,Un,"f").label}get iconField(){return Cr(this,Un,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Cr(this,Un,"f").enabled}get minimizedField(){return Cr(this,Un,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Cr(this,Rf,"f")}get codeChanged(){return Cr(this,hx,"f")}deviceHost(){return Cr(this,Df,"f").boxAdapters.adapterFor(Cr(this,Un,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Cr(this,Tf,"f").terminate()}};Tf=new WeakMap,Df=new WeakMap,Un=new WeakMap,Rf=new WeakMap,hx=new WeakMap;var e_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},pi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},t_,Cf,jn,Wc,_P,vx=class{constructor(e,r){t_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=le.Nano,Cf.set(this,void 0),jn.set(this,void 0),Wc.set(this,void 0),e_(this,Cf,e,"f"),e_(this,jn,r,"f"),e_(this,Wc,new pe(pi(this,Cf,"f")),"f"),this.namedParameter=pi(this,t_,"m",_P).call(this,r)}get box(){return pi(this,jn,"f")}get uuid(){return pi(this,jn,"f").address.uuid}get address(){return pi(this,jn,"f").address}get labelField(){return pi(this,jn,"f").label}get iconField(){return pi(this,jn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return pi(this,jn,"f").enabled}get minimizedField(){return pi(this,jn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return pi(this,Cf,"f").boxAdapters.adapterFor(pi(this,jn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){pi(this,Wc,"f").terminate()}};Cf=new WeakMap,jn=new WeakMap,Wc=new WeakMap,t_=new WeakSet,_P=function(e){return{volume:pi(this,Wc,"f").createParameter(e.volume,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"volume"),release:pi(this,Wc,"f").createParameter(e.release,E.exponential(.001,8),P.numeric({unit:"s",fractionDigits:3}),"release")}};var Lc=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ue=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},r_,Tl,as,Be,xx,zf,Ri,Dl,AP,Zc=class{constructor(e,r){r_.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",Tl.set(this,new ee),as.set(this,void 0),Be.set(this,void 0),xx.set(this,void 0),zf.set(this,void 0),Ri.set(this,void 0),Dl.set(this,b.None),Lc(this,as,e,"f"),Lc(this,Be,r,"f"),Lc(this,xx,ue(this,Tl,"f").own(ur.create(ue(this,Be,"f").midiEffects,n=>ue(this,as,"f").boxAdapters.adapterFor(n,oe.isMidiEffect),l.MIDIEffectHost)),"f"),Lc(this,zf,ue(this,Tl,"f").own(ur.create(ue(this,Be,"f").audioEffects,n=>ue(this,as,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),Lc(this,Ri,ue(this,Tl,"f").own(new pe(ue(this,as,"f"))),"f"),this.namedParameter=ue(this,r_,"m",AP).call(this,r),ue(this,Tl,"f").own(ue(this,Be,"f").file.catchupAndSubscribe(n=>{Lc(this,Dl,n.targetVertex.map(({box:i})=>ue(this,as,"f").boxAdapters.adapterFor(i,kn)),"f"),ue(this,Dl,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return ue(this,Be,"f")}get uuid(){return ue(this,Be,"f").address.uuid}get address(){return ue(this,Be,"f").address}get peakAddress(){return ue(this,Be,"f").address.append(1001)}get indexField(){return ue(this,Be,"f").index}get gate(){return ue(this,Be,"f").gate.getValue()}get exclude(){return ue(this,Be,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${ue(this,Dl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${ue(this,Dl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return ue(this,Be,"f").icon}get defaultTrackType(){return ve.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return ue(this,Be,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return ue(this,Be,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return ue(this,Dl,"f")}fileUUID(){return ue(this,Be,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){ue(this,Be,"f").mute.reset(),ue(this,Be,"f").solo.reset(),ue(this,Be,"f").exclude.reset(),ue(this,Be,"f").polyphone.reset(),ue(this,Be,"f").pitch.reset(),ue(this,Be,"f").attack.reset(),ue(this,Be,"f").release.reset(),ue(this,Be,"f").sampleStart.reset(),ue(this,Be,"f").sampleEnd.reset(),ue(this,Be,"f").gate.reset()}copyToIndex(e){$o.create(ue(this,Be,"f").graph,k.generate(),r=>{r.file.refer(ue(this,Be,"f").file.targetVertex.unwrap("file.target")),r.device.refer(ue(this,Be,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(ue(this,Be,"f").mute.getValue()),r.solo.setValue(ue(this,Be,"f").solo.getValue()),r.sampleStart.setValue(ue(this,Be,"f").sampleStart.getValue()),r.sampleEnd.setValue(ue(this,Be,"f").sampleEnd.getValue()),r.attack.setValue(ue(this,Be,"f").attack.getValue()),r.release.setValue(ue(this,Be,"f").release.getValue()),r.pitch.setValue(ue(this,Be,"f").pitch.getValue()),r.exclude.setValue(ue(this,Be,"f").exclude.getValue()),r.gate.setValue(ue(this,Be,"f").gate.getValue())})}get midiEffects(){return ue(this,xx,"f")}get inputAdapter(){return b.wrap(this)}get audioEffects(){return ue(this,zf,"f")}get labelField(){return Ie(ue(this,Be,"f").file.targetVertex.unwrap("file.target").box,Li).fileName}get enabledField(){return ue(this,Be,"f").enabled}get minimizedField(){return ue(this,Be,"f").minimized}device(){return ue(this,as,"f").boxAdapters.adapterFor(ue(this,Be,"f").device.targetVertex.unwrap("device.target").box,Gc)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>b.None};for(let e of ue(this,zf,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){ue(this,Tl,"f").terminate()}};Tl=new WeakMap,as=new WeakMap,Be=new WeakMap,xx=new WeakMap,zf=new WeakMap,Ri=new WeakMap,Dl=new WeakMap,r_=new WeakSet,AP=function(e){return{gate:ue(this,Ri,"f").createParameter(e.gate,E.linearInteger(0,2),P.indices("",["Off","On","Loop"]),"Gate"),mute:ue(this,Ri,"f").createParameter(e.mute,E.bool,P.bool,"Mute"),solo:ue(this,Ri,"f").createParameter(e.solo,E.bool,P.bool,"Solo"),polyphone:ue(this,Ri,"f").createParameter(e.polyphone,E.bool,P.bool,"Polyphone"),exclude:ue(this,Ri,"f").createParameter(e.exclude,E.bool,P.bool,"Exclude"),pitch:ue(this,Ri,"f").createParameter(e.pitch,E.linear(-1200,1200),P.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:ue(this,Ri,"f").createParameter(e.sampleStart,E.unipolar(),P.percent(),"Start",0),sampleEnd:ue(this,Ri,"f").createParameter(e.sampleEnd,E.unipolar(),P.percent(),"End",1),attack:ue(this,Ri,"f").createParameter(e.attack,E.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:ue(this,Ri,"f").createParameter(e.release,E.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var yx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Hc,Kn,qc,wx,Gc=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=le.Playfield,Hc.set(this,void 0),Kn.set(this,void 0),qc.set(this,void 0),wx.set(this,void 0),yx(this,Hc,e,"f"),yx(this,Kn,r,"f"),yx(this,qc,ur.create(r.samples,n=>e.boxAdapters.adapterFor(n,Zc),l.Sample),"f"),yx(this,wx,new pe(qr(this,Hc,"f")),"f")}reset(){qr(this,qc,"f").adapters().forEach(e=>e.box.delete())}get box(){return qr(this,Kn,"f")}get uuid(){return qr(this,Kn,"f").address.uuid}get address(){return qr(this,Kn,"f").address}get labelField(){return qr(this,Kn,"f").label}get iconField(){return qr(this,Kn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return qr(this,Kn,"f").enabled}get minimizedField(){return qr(this,Kn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return qr(this,qc,"f")}get context(){return qr(this,Hc,"f")}deviceHost(){return qr(this,Hc,"f").boxAdapters.adapterFor(qr(this,Kn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None};for(let e of qr(this,qc,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){qr(this,wx,"f").terminate()}};Hc=new WeakMap,Kn=new WeakMap,qc=new WeakMap,wx=new WeakMap;var i_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},fr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},n_,Of,cn,Sa,FP,bx=class{constructor(e,r){n_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.StereoTool,Of.set(this,void 0),cn.set(this,void 0),Sa.set(this,void 0),i_(this,Of,e,"f"),i_(this,cn,r,"f"),i_(this,Sa,new pe(fr(this,Of,"f")),"f"),this.namedParameter=fr(this,n_,"m",FP).call(this,r)}get box(){return fr(this,cn,"f")}get uuid(){return fr(this,cn,"f").address.uuid}get address(){return fr(this,cn,"f").address}get indexField(){return fr(this,cn,"f").index}get labelField(){return fr(this,cn,"f").label}get enabledField(){return fr(this,cn,"f").enabled}get minimizedField(){return fr(this,cn,"f").minimized}get host(){return fr(this,cn,"f").host}deviceHost(){return fr(this,Of,"f").boxAdapters.adapterFor(fr(this,cn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){fr(this,Sa,"f").terminate()}};Of=new WeakMap,cn=new WeakMap,Sa=new WeakMap,n_=new WeakSet,FP=function(e){return{volume:fr(this,Sa,"f").createParameter(e.volume,E.decibel(-72,0,12),P.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:fr(this,Sa,"f").createParameter(e.panning,E.bipolar(),P.panning,"Panning",.5),stereo:fr(this,Sa,"f").createParameter(e.stereo,E.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:fr(this,Sa,"f").createParameter(e.invertL,E.bool,P.bool,"Invert Left"),invertR:fr(this,Sa,"f").createParameter(e.invertR,E.bool,P.bool,"Invert Right"),swap:fr(this,Sa,"f").createParameter(e.swap,E.bool,P.bool,"Swap")}};var Vf;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(Vf||(Vf={}));var EP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},fi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Jc,mi,_x=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=le.Zeitgeist,Jc.set(this,void 0),mi.set(this,void 0),EP(this,Jc,e,"f"),EP(this,mi,r,"f"),this.groove()}get box(){return fi(this,mi,"f")}get uuid(){return fi(this,mi,"f").address.uuid}get address(){return fi(this,mi,"f").address}get indexField(){return fi(this,mi,"f").index}get labelField(){return fi(this,mi,"f").label}get enabledField(){return fi(this,mi,"f").enabled}get minimizedField(){return fi(this,mi,"f").minimized}get host(){return fi(this,mi,"f").host}deviceHost(){return fi(this,Jc,"f").boxAdapters.adapterFor(fi(this,mi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}groove(){return fi(this,Jc,"f").boxAdapters.adapterFor(fi(this,mi,"f").groove.targetVertex.unwrap("no groove").box,Vf.checkType)}catchupAndSubscribeGroove(e){return fi(this,mi,"f").groove.catchupAndSubscribe(r=>e(fi(this,Jc,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,Vf.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Jc=new WeakMap,mi=new WeakMap;var SP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ax,Ci,Fx=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",Ax.set(this,void 0),Ci.set(this,void 0),SP(this,Ax,e,"f"),SP(this,Ci,r,"f")}get box(){return Wn(this,Ci,"f")}get uuid(){return Wn(this,Ci,"f").address.uuid}get address(){return Wn(this,Ci,"f").address}get indexField(){return Wn(this,Ci,"f").index}get labelField(){return Wn(this,Ci,"f").label}get enabledField(){return Wn(this,Ci,"f").enabled}get minimizedField(){return Wn(this,Ci,"f").minimized}get host(){return Wn(this,Ci,"f").host}get commentField(){return Wn(this,Ci,"f").comment}deviceHost(){return Wn(this,Ax,"f").boxAdapters.adapterFor(Wn(this,Ci,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Ax=new WeakMap,Ci=new WeakMap;var PP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ln=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ex,zi,Sx=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",Ex.set(this,void 0),zi.set(this,void 0),PP(this,Ex,e,"f"),PP(this,zi,r,"f")}get box(){return Ln(this,zi,"f")}get uuid(){return Ln(this,zi,"f").address.uuid}get address(){return Ln(this,zi,"f").address}get indexField(){return Ln(this,zi,"f").index}get labelField(){return Ln(this,zi,"f").label}get enabledField(){return Ln(this,zi,"f").enabled}get minimizedField(){return Ln(this,zi,"f").minimized}get host(){return Ln(this,zi,"f").host}get commentField(){return Ln(this,zi,"f").comment}deviceHost(){return Ln(this,Ex,"f").boxAdapters.adapterFor(Ln(this,zi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Ex=new WeakMap,zi=new WeakMap;var os=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},a_,o_,Uf,hi,Px,Xc,Zn,dn,Yc,$P,s_,$x=class{constructor(e,r){a_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=le.Soundfont,o_.set(this,new ee),Uf.set(this,void 0),hi.set(this,void 0),Px.set(this,void 0),Xc.set(this,void 0),Zn.set(this,void 0),dn.set(this,void 0),Yc.set(this,fe.Empty),s_.set(this,n=>n.match({none:()=>{Ke(this,dn,"f").clear(),Ke(this,Zn,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ke(this,dn,"f").clear(),Ke(this,Zn,"f").clear(),Ke(this,Yc,"f").terminate(),os(this,Yc,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");Ke(this,dn,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),Ke(this,Zn,"f").wrap(o)}else a.type==="error"?(Ke(this,dn,"f").clear(),Ke(this,Zn,"f").clear()):a.type==="idle"&&(Ke(this,dn,"f").clear(),Ke(this,Zn,"f").clear())}),"f")},some:a=>{Ke(this,Zn,"f").wrap(a),Ke(this,dn,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),os(this,Uf,e,"f"),os(this,hi,r,"f"),os(this,Px,new pe(Ke(this,Uf,"f")),"f"),this.namedParameter=Ke(this,a_,"m",$P).call(this,r),os(this,Xc,new wr,"f"),os(this,Zn,new wr,"f"),os(this,dn,new wr,"f"),Ke(this,o_,"f").ownAll(Ke(this,Xc,"f").subscribe(Ke(this,s_,"f")),Ke(this,hi,"f").file.catchupAndSubscribe(({targetVertex:n})=>Ke(this,Xc,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ke(this,hi,"f").presetIndex.catchupAndSubscribe(n=>Ke(this,Zn,"f").match({none:()=>Ke(this,dn,"f").clear(),some:i=>Ke(this,dn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Ke(this,Xc,"f")}get soundfont(){return Ke(this,Zn,"f")}get preset(){return Ke(this,dn,"f")}get presetIndex(){return Ke(this,hi,"f").presetIndex.getValue()}get box(){return Ke(this,hi,"f")}get uuid(){return Ke(this,hi,"f").address.uuid}get address(){return Ke(this,hi,"f").address}get labelField(){return Ke(this,hi,"f").label}get iconField(){return Ke(this,hi,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Ke(this,hi,"f").enabled}get minimizedField(){return Ke(this,hi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ke(this,Uf,"f").boxAdapters.adapterFor(Ke(this,hi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ke(this,Yc,"f").terminate(),os(this,Yc,fe.Empty,"f"),Ke(this,Px,"f").terminate()}};o_=new WeakMap,Uf=new WeakMap,hi=new WeakMap,Px=new WeakMap,Xc=new WeakMap,Zn=new WeakMap,dn=new WeakMap,Yc=new WeakMap,s_=new WeakMap,a_=new WeakSet,$P=function(e){return{}};var kP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},jf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kx,Rl,Mx=class{constructor(e,r){kx.set(this,void 0),Rl.set(this,void 0),kP(this,kx,e,"f"),kP(this,Rl,r,"f")}get box(){return jf(this,Rl,"f")}get uuid(){return jf(this,Rl,"f").address.uuid}get address(){return jf(this,Rl,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return jf(this,kx,"f").soundfontManager.getOrCreate(jf(this,Rl,"f").address.uuid)}terminate(){}};kx=new WeakMap,Rl=new WeakMap;var l_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},u_,Kf,pn,Wf,MP,Nx=class{constructor(e,r){u_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Maximizer,Kf.set(this,void 0),pn.set(this,void 0),Wf.set(this,void 0),l_(this,Kf,e,"f"),l_(this,pn,r,"f"),l_(this,Wf,new pe(gi(this,Kf,"f")),"f"),this.namedParameter=gi(this,u_,"m",MP).call(this,r)}get box(){return gi(this,pn,"f")}get uuid(){return gi(this,pn,"f").address.uuid}get address(){return gi(this,pn,"f").address}get indexField(){return gi(this,pn,"f").index}get labelField(){return gi(this,pn,"f").label}get enabledField(){return gi(this,pn,"f").enabled}get minimizedField(){return gi(this,pn,"f").minimized}get host(){return gi(this,pn,"f").host}deviceHost(){return gi(this,Kf,"f").boxAdapters.adapterFor(gi(this,pn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){gi(this,Wf,"f").terminate()}};Kf=new WeakMap,pn=new WeakMap,Wf=new WeakMap,u_=new WeakSet,MP=function(e){return{threshold:gi(this,Wf,"f").createParameter(e.threshold,E.linear(-24,0),P.decible,"Threshold")}};var c_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},bt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},d_,Lf,Oi,zr,NP,Ix=class{constructor(e,r){d_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Compressor,Lf.set(this,void 0),Oi.set(this,void 0),zr.set(this,void 0),c_(this,Lf,e,"f"),c_(this,Oi,r,"f"),c_(this,zr,new pe(bt(this,Lf,"f")),"f"),this.namedParameter=bt(this,d_,"m",NP).call(this,r)}get box(){return bt(this,Oi,"f")}get uuid(){return bt(this,Oi,"f").address.uuid}get address(){return bt(this,Oi,"f").address}get indexField(){return bt(this,Oi,"f").index}get labelField(){return bt(this,Oi,"f").label}get enabledField(){return bt(this,Oi,"f").enabled}get minimizedField(){return bt(this,Oi,"f").minimized}get host(){return bt(this,Oi,"f").host}get sideChain(){return bt(this,Oi,"f").sideChain}deviceHost(){return bt(this,Lf,"f").boxAdapters.adapterFor(bt(this,Oi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bt(this,zr,"f").terminate()}};Lf=new WeakMap,Oi=new WeakMap,zr=new WeakMap,d_=new WeakSet,NP=function(e){return{lookahead:bt(this,zr,"f").createParameter(e.lookahead,E.bool,P.bool,"Lookahead"),automakeup:bt(this,zr,"f").createParameter(e.automakeup,E.bool,P.bool,"Auto Makeup"),autoattack:bt(this,zr,"f").createParameter(e.autoattack,E.bool,P.bool,"Auto Attack"),autorelease:bt(this,zr,"f").createParameter(e.autorelease,E.bool,P.bool,"Auto Release"),inputgain:bt(this,zr,"f").createParameter(e.inputgain,E.linear(-30,30),P.decible,"Input Gain"),threshold:bt(this,zr,"f").createParameter(e.threshold,E.linear(-60,0),P.decible,"Threshold"),ratio:bt(this,zr,"f").createParameter(e.ratio,E.exponential(1,24),P.numeric({fractionDigits:1}),"Ratio"),knee:bt(this,zr,"f").createParameter(e.knee,E.linear(0,24),P.decible,"Knee"),attack:bt(this,zr,"f").createParameter(e.attack,E.linear(0,100),P.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:bt(this,zr,"f").createParameter(e.release,E.linear(5,1500),P.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:bt(this,zr,"f").createParameter(e.makeup,E.linear(-40,40),P.decible,"Makeup Gain"),mix:bt(this,zr,"f").createParameter(e.mix,E.unipolar(),P.percent(),"Dry/Wet")}};var p_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Zt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},f_,Zf,Vi,Gn,IP,Bx=class{constructor(e,r){f_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Gate,Zf.set(this,void 0),Vi.set(this,void 0),Gn.set(this,void 0),p_(this,Zf,e,"f"),p_(this,Vi,r,"f"),p_(this,Gn,new pe(Zt(this,Zf,"f")),"f"),this.namedParameter=Zt(this,f_,"m",IP).call(this,r)}get box(){return Zt(this,Vi,"f")}get uuid(){return Zt(this,Vi,"f").address.uuid}get address(){return Zt(this,Vi,"f").address}get indexField(){return Zt(this,Vi,"f").index}get labelField(){return Zt(this,Vi,"f").label}get enabledField(){return Zt(this,Vi,"f").enabled}get minimizedField(){return Zt(this,Vi,"f").minimized}get host(){return Zt(this,Vi,"f").host}get sideChain(){return Zt(this,Vi,"f").sideChain}deviceHost(){return Zt(this,Zf,"f").boxAdapters.adapterFor(Zt(this,Vi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Zt(this,Gn,"f").terminate()}};Zf=new WeakMap,Vi=new WeakMap,Gn=new WeakMap,f_=new WeakSet,IP=function(e){return{inverse:Zt(this,Gn,"f").createParameter(e.inverse,E.bool,P.bool,"Inverse"),threshold:Zt(this,Gn,"f").createParameter(e.threshold,E.linear(-80,0),P.decible,"Threshold"),return:Zt(this,Gn,"f").createParameter(e.return,E.linear(0,24),P.decible,"Return"),attack:Zt(this,Gn,"f").createParameter(e.attack,E.linear(0,1e3),P.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Zt(this,Gn,"f").createParameter(e.hold,E.linear(0,500),P.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Zt(this,Gn,"f").createParameter(e.release,E.linear(1,2e3),P.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Zt(this,Gn,"f").createParameter(e.floor,E.decibel(-72,-12,0),P.decible,"Floor")}};var m_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Sr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},h_,Gf,fn,ss,BP,Tx=class{constructor(e,r){h_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Crusher,Gf.set(this,void 0),fn.set(this,void 0),ss.set(this,void 0),m_(this,Gf,e,"f"),m_(this,fn,r,"f"),m_(this,ss,new pe(Sr(this,Gf,"f")),"f"),this.namedParameter=Sr(this,h_,"m",BP).call(this,r)}get box(){return Sr(this,fn,"f")}get uuid(){return Sr(this,fn,"f").address.uuid}get address(){return Sr(this,fn,"f").address}get indexField(){return Sr(this,fn,"f").index}get labelField(){return Sr(this,fn,"f").label}get enabledField(){return Sr(this,fn,"f").enabled}get minimizedField(){return Sr(this,fn,"f").minimized}get host(){return Sr(this,fn,"f").host}deviceHost(){return Sr(this,Gf,"f").boxAdapters.adapterFor(Sr(this,fn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Sr(this,ss,"f").terminate()}};Gf=new WeakMap,fn=new WeakMap,ss=new WeakMap,h_=new WeakSet,BP=function(e){return{crush:Sr(this,ss,"f").createParameter(e.crush,E.unipolar(),P.percent(),"Crush"),bits:Sr(this,ss,"f").createParameter(e.bits,E.linearInteger(1,16),P.numeric(),"Bits"),boost:Sr(this,ss,"f").createParameter(e.boost,E.linear(0,24),P.decible,"Boost"),mix:Sr(this,ss,"f").createParameter(e.mix,E.exponential(.001,1),P.percent(),"Mix")}};var g_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},v_,Hf,mn,Qc,TP,Dx=class{constructor(e,r){v_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Fold,Hf.set(this,void 0),mn.set(this,void 0),Qc.set(this,void 0),g_(this,Hf,e,"f"),g_(this,mn,r,"f"),g_(this,Qc,new pe(Jr(this,Hf,"f")),"f"),this.namedParameter=Jr(this,v_,"m",TP).call(this,r)}get box(){return Jr(this,mn,"f")}get uuid(){return Jr(this,mn,"f").address.uuid}get address(){return Jr(this,mn,"f").address}get indexField(){return Jr(this,mn,"f").index}get labelField(){return Jr(this,mn,"f").label}get enabledField(){return Jr(this,mn,"f").enabled}get minimizedField(){return Jr(this,mn,"f").minimized}get host(){return Jr(this,mn,"f").host}deviceHost(){return Jr(this,Hf,"f").boxAdapters.adapterFor(Jr(this,mn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Jr(this,Qc,"f").terminate()}};Hf=new WeakMap,mn=new WeakMap,Qc=new WeakMap,v_=new WeakSet,TP=function(e){return{drive:Jr(this,Qc,"f").createParameter(e.drive,E.linear(0,30),P.decible,"Drive"),volume:Jr(this,Qc,"f").createParameter(e.volume,E.linear(-18,0),P.decible,"Volume")}};var Rx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},or=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},qf,Jf,hn,ed,td,Cx=class{constructor(e,r){qf.set(this,new ee),this.type="instrument",this.accepts="midi",this.manualUrl=le.MIDIOutput,Jf.set(this,void 0),hn.set(this,void 0),ed.set(this,void 0),td.set(this,void 0),Rx(this,Jf,e,"f"),Rx(this,hn,r,"f"),Rx(this,ed,new wr,"f"),Rx(this,td,or(this,qf,"f").own(new pe(or(this,Jf,"f"))),"f"),or(this,qf,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>or(this,td,"f").createParameter(Ie(n,Os).value,E.unipolar(),P.percent({fractionDigits:1}),"",0)),onRemoved:(({box:n})=>or(this,td,"f").removeParameter(Ie(n,Os).value.address))}),or(this,hn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>or(this,ed,"f").clear(),some:({box:i})=>or(this,ed,"f").wrap(Ie(i,Po))})))}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 labelField(){return or(this,hn,"f").label}get iconField(){return or(this,hn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return or(this,hn,"f").enabled}get minimizedField(){return or(this,hn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return or(this,td,"f")}get midiDevice(){return or(this,ed,"f")}deviceHost(){return or(this,Jf,"f").boxAdapters.adapterFor(or(this,hn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){or(this,qf,"f").terminate()}};qf=new WeakMap,Jf=new WeakMap,hn=new WeakMap,ed=new WeakMap,td=new WeakMap;var zx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Gt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},x_,Xf,gn,Pa,Yf,DP,Ox=class{constructor(e,r){x_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=le.Velocity,Xf.set(this,void 0),gn.set(this,void 0),Pa.set(this,void 0),Yf.set(this,void 0),zx(this,Xf,e,"f"),zx(this,gn,r,"f"),zx(this,Pa,new pe(Gt(this,Xf,"f")),"f"),zx(this,Yf,dh.create(),"f"),this.namedParameter=Gt(this,x_,"m",DP).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:u}=this.namedParameter;Gt(this,Yf,"f").setSeed(a.valueAt(e)+e);let d=r+(n.valueAt(e)-r)*i.valueAt(e),m=(Gt(this,Yf,"f").uniform()*2-1)*o.valueAt(e),x=s.valueAt(e),g=u.valueAt(e);return r*(1-g)+yS(d+m+x)*g}get box(){return Gt(this,gn,"f")}get uuid(){return Gt(this,gn,"f").address.uuid}get address(){return Gt(this,gn,"f").address}get indexField(){return Gt(this,gn,"f").index}get labelField(){return Gt(this,gn,"f").label}get enabledField(){return Gt(this,gn,"f").enabled}get minimizedField(){return Gt(this,gn,"f").minimized}get host(){return Gt(this,gn,"f").host}deviceHost(){return Gt(this,Xf,"f").boxAdapters.adapterFor(Gt(this,gn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Gt(this,Pa,"f").terminate()}};Xf=new WeakMap,gn=new WeakMap,Pa=new WeakMap,Yf=new WeakMap,x_=new WeakSet,DP=function(e){return{magnetPosition:Gt(this,Pa,"f").createParameter(e.magnetPosition,E.unipolar(),P.percent(),"Position"),magnetStrength:Gt(this,Pa,"f").createParameter(e.magnetStrength,E.unipolar(),P.percent(),"Strength"),randomSeed:Gt(this,Pa,"f").createParameter(e.randomSeed,E.linearInteger(0,65535),P.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Gt(this,Pa,"f").createParameter(e.randomAmount,E.unipolar(),P.percent(),"Amount"),offset:Gt(this,Pa,"f").createParameter(e.offset,E.bipolar(),P.percent(),"Offset"),mix:Gt(this,Pa,"f").createParameter(e.mix,E.unipolar(),P.percent(),"Mix")}};var y_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},mr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},w_,b_,Qf,vn,$a,RP,Cl=class{constructor(e,r){w_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Tidal,Qf.set(this,void 0),vn.set(this,void 0),$a.set(this,void 0),y_(this,Qf,e,"f"),y_(this,vn,r,"f"),y_(this,$a,new pe(mr(this,Qf,"f")),"f"),this.namedParameter=mr(this,w_,"m",RP).call(this,r)}get box(){return mr(this,vn,"f")}get uuid(){return mr(this,vn,"f").address.uuid}get address(){return mr(this,vn,"f").address}get indexField(){return mr(this,vn,"f").index}get labelField(){return mr(this,vn,"f").label}get enabledField(){return mr(this,vn,"f").enabled}get minimizedField(){return mr(this,vn,"f").minimized}get host(){return mr(this,vn,"f").host}deviceHost(){return mr(this,Qf,"f").boxAdapters.adapterFor(mr(this,vn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){mr(this,$a,"f").terminate()}};b_=Cl,Qf=new WeakMap,vn=new WeakMap,$a=new WeakMap,w_=new WeakSet,RP=function(e){let{RateFractions:r,RateStringMapping:n}=b_;return{slope:mr(this,$a,"f").createParameter(e.slope,E.bipolar(),P.percent({fractionDigits:1}),"Slope",.5),symmetry:mr(this,$a,"f").createParameter(e.symmetry,E.unipolar(),P.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:mr(this,$a,"f").createParameter(e.rate,E.values(r.map((i,a)=>a)),n,"Rate",0),depth:mr(this,$a,"f").createParameter(e.depth,E.unipolar(),P.percent({fractionDigits:1}),"Depth",0),offset:mr(this,$a,"f").createParameter(e.offset,E.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:mr(this,$a,"f").createParameter(e.channelOffset,E.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Cl.RateFractions=vo.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();Cl.RateStringMapping=P.indices("",b_.RateFractions.map(([t,e])=>`${t}/${e}`));var __=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},_t=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},A_,em,Xr,vi,CP,Vx=class{constructor(e,r){A_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Vocoder,em.set(this,void 0),Xr.set(this,void 0),vi.set(this,void 0),__(this,em,e,"f"),__(this,Xr,r,"f"),__(this,vi,new pe(_t(this,em,"f")),"f"),this.namedParameter=_t(this,A_,"m",CP).call(this,r)}get box(){return _t(this,Xr,"f")}get uuid(){return _t(this,Xr,"f").address.uuid}get address(){return _t(this,Xr,"f").address}get indexField(){return _t(this,Xr,"f").index}get labelField(){return _t(this,Xr,"f").label}get enabledField(){return _t(this,Xr,"f").enabled}get minimizedField(){return _t(this,Xr,"f").minimized}get host(){return _t(this,Xr,"f").host}get sideChain(){return _t(this,Xr,"f").sideChain}get modulatorSpectrum(){return _t(this,Xr,"f").address.append(4094)}get carrierSpectrum(){return _t(this,Xr,"f").address.append(4095)}deviceHost(){return _t(this,em,"f").boxAdapters.adapterFor(_t(this,Xr,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){_t(this,vi,"f").terminate()}};em=new WeakMap,Xr=new WeakMap,vi=new WeakMap,A_=new WeakSet,CP=function(e){let r=E.exponential(20,2e4),n=P.numeric({unit:"Hz",fractionDigits:0}),i=E.exponential(1,60),a=P.numeric({fractionDigits:1});return{carrierMinFreq:_t(this,vi,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:_t(this,vi,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:_t(this,vi,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:_t(this,vi,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qMin:_t(this,vi,"f").createParameter(e.qMin,i,a,"Q Min"),qMax:_t(this,vi,"f").createParameter(e.qMax,i,a,"Q Max"),envAttack:_t(this,vi,"f").createParameter(e.envAttack,E.exponential(.1,100),P.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:_t(this,vi,"f").createParameter(e.envRelease,E.exponential(1,1e3),P.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:_t(this,vi,"f").createParameter(e.gain,E.linear(-20,20),P.decible,"Gain"),mix:_t(this,vi,"f").createParameter(e.mix,E.unipolar(),P.percent(),"Mix")}};var F_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},St=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},E_,tm,xn,Or,zP,Ux=class{constructor(e,r){E_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.DattorroReverb,tm.set(this,void 0),xn.set(this,void 0),Or.set(this,void 0),F_(this,tm,e,"f"),F_(this,xn,r,"f"),F_(this,Or,new pe(St(this,tm,"f")),"f"),this.namedParameter=St(this,E_,"m",zP).call(this,r)}get box(){return St(this,xn,"f")}get uuid(){return St(this,xn,"f").address.uuid}get address(){return St(this,xn,"f").address}get indexField(){return St(this,xn,"f").index}get labelField(){return St(this,xn,"f").label}get enabledField(){return St(this,xn,"f").enabled}get minimizedField(){return St(this,xn,"f").minimized}get host(){return St(this,xn,"f").host}deviceHost(){return St(this,tm,"f").boxAdapters.adapterFor(St(this,xn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){St(this,Or,"f").terminate()}};tm=new WeakMap,xn=new WeakMap,Or=new WeakMap,E_=new WeakSet,zP=function(e){return{preDelay:St(this,Or,"f").createParameter(e.preDelay,E.linear(0,1e3),P.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:St(this,Or,"f").createParameter(e.bandwidth,E.unipolar(),P.percent(),"Bandwidth"),inputDiffusion1:St(this,Or,"f").createParameter(e.inputDiffusion1,E.unipolar(),P.percent(),"Tank 1"),inputDiffusion2:St(this,Or,"f").createParameter(e.inputDiffusion2,E.unipolar(),P.percent(),"Tank 2"),decay:St(this,Or,"f").createParameter(e.decay,E.unipolar(),P.percent(),"Decay"),decayDiffusion1:St(this,Or,"f").createParameter(e.decayDiffusion1,E.unipolar(),P.percent(),"Tank 1"),decayDiffusion2:St(this,Or,"f").createParameter(e.decayDiffusion2,E.unipolar(),P.percent(),"Tank 2"),damping:St(this,Or,"f").createParameter(e.damping,E.unipolar(),P.percent(),"Damping"),excursionRate:St(this,Or,"f").createParameter(e.excursionRate,E.unipolar(),P.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:St(this,Or,"f").createParameter(e.excursionDepth,E.unipolar(),P.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:St(this,Or,"f").createParameter(e.wet,E.DefaultDecibel,P.decible,"Wet"),dry:St(this,Or,"f").createParameter(e.dry,E.DefaultDecibel,P.decible,"Dry")}};var OP=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},rd=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},S_,oo,id=class{constructor(e,r){S_.set(this,void 0),oo.set(this,void 0),OP(this,S_,e,"f"),OP(this,oo,r,"f")}get box(){return rd(this,oo,"f")}get uuid(){return rd(this,oo,"f").address.uuid}get address(){return rd(this,oo,"f").address}get labelField(){return rd(this,oo,"f").label}get modelField(){return rd(this,oo,"f").model}getModelJson(){return rd(this,oo,"f").model.getValue()}terminate(){}};S_=new WeakMap,oo=new WeakMap;var P_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ut=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$_,nd,Pr,zl,VP,jx=class{constructor(e,r){$_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.NeuralAmp,nd.set(this,void 0),Pr.set(this,void 0),zl.set(this,void 0),P_(this,nd,e,"f"),P_(this,Pr,r,"f"),P_(this,zl,new pe(Ut(this,nd,"f")),"f"),this.namedParameter=Ut(this,$_,"m",VP).call(this,r)}get box(){return Ut(this,Pr,"f")}get uuid(){return Ut(this,Pr,"f").address.uuid}get address(){return Ut(this,Pr,"f").address}get indexField(){return Ut(this,Pr,"f").index}get labelField(){return Ut(this,Pr,"f").label}get enabledField(){return Ut(this,Pr,"f").enabled}get minimizedField(){return Ut(this,Pr,"f").minimized}get host(){return Ut(this,Pr,"f").host}get modelField(){return Ut(this,Pr,"f").model}get monoField(){return Ut(this,Pr,"f").mono}get spectrum(){return Ut(this,Pr,"f").address.append(4095)}getModelAdapter(){let e=Ut(this,Pr,"f").model.targetVertex;return e.isEmpty()?b.None:b.wrap(Ut(this,nd,"f").boxAdapters.adapterFor(e.unwrap().box,id))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Ut(this,Pr,"f").modelJson.getValue()}deviceHost(){return Ut(this,nd,"f").boxAdapters.adapterFor(Ut(this,Pr,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ut(this,zl,"f").terminate()}};nd=new WeakMap,Pr=new WeakMap,zl=new WeakMap,$_=new WeakSet,VP=function(e){return{inputGain:Ut(this,zl,"f").createParameter(e.inputGain,E.decibel(-72,0,12),P.numeric({unit:"dB",fractionDigits:1}),"input"),outputGain:Ut(this,zl,"f").createParameter(e.outputGain,E.decibel(-72,0,12),P.numeric({unit:"dB",fractionDigits:1}),"output"),mix:Ut(this,zl,"f").createParameter(e.mix,E.linear(0,1),P.percent(),"Mix")}};var k_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},M_,rm,yn,Ol,UP,Kx=class{constructor(e,r){M_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Waveshaper,rm.set(this,void 0),yn.set(this,void 0),Ol.set(this,void 0),k_(this,rm,e,"f"),k_(this,yn,r,"f"),k_(this,Ol,new pe(Vr(this,rm,"f")),"f"),this.namedParameter=Vr(this,M_,"m",UP).call(this,r)}get box(){return Vr(this,yn,"f")}get uuid(){return Vr(this,yn,"f").address.uuid}get address(){return Vr(this,yn,"f").address}get indexField(){return Vr(this,yn,"f").index}get labelField(){return Vr(this,yn,"f").label}get enabledField(){return Vr(this,yn,"f").enabled}get minimizedField(){return Vr(this,yn,"f").minimized}get host(){return Vr(this,yn,"f").host}deviceHost(){return Vr(this,rm,"f").boxAdapters.adapterFor(Vr(this,yn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Vr(this,Ol,"f").terminate()}};rm=new WeakMap,yn=new WeakMap,Ol=new WeakMap,M_=new WeakSet,UP=function(e){return{inputGain:Vr(this,Ol,"f").createParameter(e.inputGain,E.linear(0,40),P.decible,"Input"),outputGain:Vr(this,Ol,"f").createParameter(e.outputGain,E.linear(-24,24),P.decible,"Output"),mix:Vr(this,Ol,"f").createParameter(e.mix,E.unipolar(),P.percent(),"Mix")}};var Wx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$r=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},im,nm,wn,am,Lx,Zx=class{constructor(e,r){im.set(this,new ee),this.type="audio-effect",this.accepts="audio",this.manualUrl=le.Werkstatt,nm.set(this,void 0),wn.set(this,void 0),am.set(this,void 0),Lx.set(this,void 0),Wx(this,nm,e,"f"),Wx(this,wn,r,"f"),Wx(this,am,$r(this,im,"f").own(new pe($r(this,nm,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams($r(this,am,"f"),r.code,r.parameters);$r(this,im,"f").own(n),Wx(this,Lx,i,"f")}get box(){return $r(this,wn,"f")}get uuid(){return $r(this,wn,"f").address.uuid}get address(){return $r(this,wn,"f").address}get indexField(){return $r(this,wn,"f").index}get labelField(){return $r(this,wn,"f").label}get enabledField(){return $r(this,wn,"f").enabled}get minimizedField(){return $r(this,wn,"f").minimized}get host(){return $r(this,wn,"f").host}get parameters(){return $r(this,am,"f")}get codeChanged(){return $r(this,Lx,"f")}deviceHost(){return $r(this,nm,"f").boxAdapters.adapterFor($r(this,wn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){$r(this,im,"f").terminate()}};im=new WeakMap,nm=new WeakMap,wn=new WeakMap,am=new WeakMap,Lx=new WeakMap;var de=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hB,ce,gB,vB,xB,yB;ce=new WeakMap,gB=new WeakMap,vB=new WeakMap,xB=new WeakMap,hB=new WeakSet,yB=function(e){return ze(e.accept({visitArpeggioDeviceBox:r=>new Il(de(this,ce,"f"),r),visitAudioBusBox:r=>new Si(de(this,ce,"f"),r),visitAudioClipBox:r=>new Wu(de(this,ce,"f"),r),visitAudioFileBox:r=>new kn(de(this,ce,"f"),r),visitAudioTimeStretchBox:r=>new da(de(this,ce,"f"),r),visitAudioPitchStretchBox:r=>new ca(de(this,ce,"f"),r),visitTransientMarkerBox:r=>new Ru(r),visitWarpMarkerBox:r=>new Do(de(this,ce,"f"),r),visitApparatDeviceBox:r=>new gx(de(this,ce,"f"),r),visitAudioRegionBox:r=>new oc(de(this,ce,"f"),r),visitAudioUnitBox:r=>new Qi(de(this,ce,"f"),r),visitAuxSendBox:r=>new yc(de(this,ce,"f"),r),visitMaximizerDeviceBox:r=>new Nx(de(this,ce,"f"),r),visitCompressorDeviceBox:r=>new Ix(de(this,ce,"f"),r),visitGateDeviceBox:r=>new Bx(de(this,ce,"f"),r),visitCrusherDeviceBox:r=>new Tx(de(this,ce,"f"),r),visitDattorroReverbDeviceBox:r=>new Ux(de(this,ce,"f"),r),visitDelayDeviceBox:r=>new Cn(de(this,ce,"f"),r),visitDeviceInterfaceKnobBox:r=>new Bc(de(this,ce,"f"),r),visitTidalDeviceBox:r=>new Cl(de(this,ce,"f"),r),visitFoldDeviceBox:r=>new Dx(de(this,ce,"f"),r),visitGrooveShuffleBox:r=>new _a(de(this,ce,"f"),r),visitMarkerBox:r=>new Ho(de(this,ce,"f"),r),visitSignatureEventBox:r=>new wl(de(this,ce,"f"),r),visitMIDIOutputDeviceBox:r=>new Cx(de(this,ce,"f"),r),visitModularAudioInputBox:r=>new Nc(de(this,ce,"f"),r),visitModularAudioOutputBox:r=>new $c(de(this,ce,"f"),r),visitModularBox:r=>new Qo(de(this,ce,"f"),r),visitModularDeviceBox:r=>new Dc(de(this,ce,"f"),r),visitModuleConnectionBox:r=>new Yo(de(this,ce,"f"),r),visitModuleDelayBox:r=>new Pc(de(this,ce,"f"),r),visitModuleGainBox:r=>new kc(de(this,ce,"f"),r),visitModuleMultiplierBox:r=>new Mc(de(this,ce,"f"),r),visitNanoDeviceBox:r=>new vx(de(this,ce,"f"),r),visitNeuralAmpDeviceBox:r=>new jx(de(this,ce,"f"),r),visitNeuralAmpModelBox:r=>new id(de(this,ce,"f"),r),visitNoteClipBox:r=>new Hu(de(this,ce,"f"),r),visitNoteEventBox:r=>new el(de(this,ce,"f"),r),visitNoteEventCollectionBox:r=>new Hi(de(this,ce,"f"),r),visitNoteRegionBox:r=>new lc(de(this,ce,"f"),r),visitPitchDeviceBox:r=>new cx(de(this,ce,"f"),r),visitPlayfieldDeviceBox:r=>new Gc(de(this,ce,"f"),r),visitPlayfieldSampleBox:r=>new Zc(de(this,ce,"f"),r),visitRevampDeviceBox:r=>new _v(de(this,ce,"f"),r),visitReverbDeviceBox:r=>new bv(de(this,ce,"f"),r),visitRootBox:r=>new ox(de(this,ce,"f"),r),visitSoundfontDeviceBox:r=>new $x(de(this,ce,"f"),r),visitSoundfontFileBox:r=>new Mx(de(this,ce,"f"),r),visitSpielwerkDeviceBox:r=>new fx(de(this,ce,"f"),r),visitStereoToolDeviceBox:r=>new bx(de(this,ce,"f"),r),visitTapeDeviceBox:r=>new sx(de(this,ce,"f"),r),visitTimelineBox:r=>new wa(de(this,ce,"f"),r),visitTrackBox:r=>new er(de(this,ce,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new Fx(de(this,ce,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new Sx(de(this,ce,"f"),r),visitValueClipBox:r=>new To(de(this,ce,"f"),r),visitValueEventBox:r=>new La(de(this,ce,"f"),r),visitValueEventCollectionBox:r=>new _r(de(this,ce,"f"),r),visitValueRegionBox:r=>new Ya(de(this,ce,"f"),r),visitVaporisateurDeviceBox:r=>new lx(de(this,ce,"f"),r),visitVocoderDeviceBox:r=>new Vx(de(this,ce,"f"),r),visitWaveshaperDeviceBox:r=>new Kx(de(this,ce,"f"),r),visitWerkstattDeviceBox:r=>new Zx(de(this,ce,"f"),r),visitVelocityDeviceBox:r=>new Ox(de(this,ce,"f"),r),visitZeitgeistDeviceBox:r=>new _x(de(this,ce,"f"),r)}),`Could not find factory for ${e}`)};var om;(function(t){t.PEAKS=Re.compose(k.Lowest).append(0),t.SPECTRUM=Re.compose(k.Lowest).append(1),t.WAVEFORM=Re.compose(k.Lowest).append(2)})(om||(om={}));var jP;(function(t){t.countStems=e=>e.match({none:()=>1,some:r=>K(r.stems)?Object.keys(r.stems).length:1}),t.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),t.sanitizeExportNamesInPlace=e=>{if(!K(e.stems))return;let r=e.stems,n=new Map,i=a=>{let o=n.get(a)??0,s=a;for(;n.has(s);)o++,s=`${a} ${o}`;return n.set(a,o),n.set(s,1),s};Object.keys(r).forEach(a=>{let o=r[a];o.fileName=i(t.sanitizeFileName(o.fileName))})}})(jP||(jP={}));var wB=512,KP=bi.createBuilder({position:bi.float,bpm:bi.float,playbackTimestamp:bi.float,countInBeatsRemaining:bi.float,isPlaying:bi.bool,isCountingIn:bi.bool,isRecording:bi.bool,perfIndex:bi.int32,perfBuffer:bi.floats(wB)});var WP;(function(t){t.store=(e,r,n)=>{if(n==="")return V("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof En&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};ab(i)?a(i):En.create(e.graph,k.generate(),a)},t.read=(e,r)=>{if(r==="")return V("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof En&&i.origin.getValue()===r);if(ab(n)){let{status:i,value:a,error:o}=Ht(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return V("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof En&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return V("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=k.newSet(s=>s.uuid),a=s=>{let{status:u,value:d,error:m}=Ht(()=>JSON.parse(s.value.getValue()));u==="success"?n(b.wrap(d)):(console.warn(m),n(b.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof En)||s.origin.getValue()!==r)return;let u=s.value.catchupAndSubscribe(()=>a(s));i.add({uuid:s.address.uuid,subscription:u})},onRemoved:({box:s})=>{if(!(s instanceof En)||s.origin.getValue()!==r)return;i.removeByKey(s.address.uuid).subscription.terminate(),n(b.None)}},l.MetaData);return{terminate:()=>{o.terminate(),i.forEach(({subscription:s})=>s.terminate()),i.clear()}}}})(WP||(WP={}));var bB,_B,AB,FB;bB=new WeakMap,_B=new WeakMap,AB=new WeakMap,FB=new WeakMap;var ls;(function(t){let e;(function(r){r[r.NoteOn=144]="NoteOn",r[r.NoteOff=128]="NoteOff",r[r.PitchBend=224]="PitchBend",r[r.Controller=176]="Controller",r[r.Start=250]="Start",r[r.Continue=251]="Continue",r[r.Stop=252]="Stop",r[r.Clock=248]="Clock",r[r.Position=242]="Position"})(e=t.Command||(t.Command={})),t.readCommand=r=>r[0]&240,t.readChannel=r=>r[0]&15,t.readParam1=r=>r.length>1?r[1]&255:0,t.readParam2=r=>r.length>2?r[2]&255:0,t.readPitch=r=>r[1],t.readVelocity=r=>r[2]/127,t.isNoteOn=r=>t.readCommand(r)===e.NoteOn&&t.readVelocity(r)>0,t.isNoteOff=r=>t.readCommand(r)===e.NoteOff||t.readCommand(r)===e.NoteOn&&t.readVelocity(r)===0,t.isPitchWheel=r=>t.readCommand(r)===e.PitchBend,t.isController=r=>t.readCommand(r)===e.Controller,t.isClock=r=>r[0]===e.Clock,t.isStart=r=>r[0]===e.Start,t.isContinue=r=>r[0]===e.Continue,t.isStop=r=>r[0]===e.Stop,t.isPosition=r=>r[0]===e.Position,t.asPitchBend=r=>{let n=t.readParam1(r)&127,i=t.readParam2(r)&127,a=n|i<<7;return 8192>=a?a/8192-1:(a-8191)/8192},t.asValue=r=>{let n=t.readParam2(r);return n>64?.5+(n-63)/128:n<64?n/128:.5},t.Clock=new Uint8Array([e.Clock]),t.Start=new Uint8Array([e.Start]),t.Continue=new Uint8Array([e.Continue]),t.Stop=new Uint8Array([e.Stop]),t.noteOn=(r,n,i)=>new Uint8Array([e.NoteOn|r,n,i]),t.noteOff=(r,n)=>new Uint8Array([e.NoteOff|r,n,0]),t.control=(r,n,i)=>new Uint8Array([e.Controller|r,n&127,i&127]),t.position=(r,n)=>new Uint8Array([e.Position,r&127,n&127]),t.positionInPPQN=r=>{let n=Math.floor(r/96),i=n&127,a=n>>7&127;return new Uint8Array([e.Position,i,a])},t.accept=(r,n)=>{Yn(r)||(t.isNoteOn(r)?S(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?S(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?S(n.pitchBend,t.asPitchBend(r)):t.isController(r)?S(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?S(n.clock):t.isStart(r)?S(n.start):t.isContinue(r)?S(n.continue):t.isStop(r)?S(n.stop):t.isPosition(r)&&S(n.songPos,t.readParam1(r)|t.readParam2(r)<<7))},t.debug=r=>r===null?"null":t.isNoteOn(r)?`NoteOn #${t.readChannel(r)} ${t.readPitch(r)} : ${t.readVelocity(r).toFixed(2)}`:t.isNoteOff(r)?`NoteOff #${t.readChannel(r)} ${t.readPitch(r)}`:t.isPitchWheel(r)?`PitchWheel #${t.readChannel(r)} ${t.asPitchBend(r)}`:t.isController(r)?`Control #${t.readChannel(r)} ${t.asValue(r)}`:t.isClock(r)?"Clock":t.isStart(r)?"Start":t.isContinue(r)?"Continue":t.isStop(r)?"Stop":t.isPosition(r)?`SongPosition ${t.readParam1(r)|t.readParam2(r)<<7}`:"Unknown"})(ls||(ls={}));var sm;(function(t){t.on=(e,r,n)=>({type:"note-on",uuid:e,pitch:r,velocity:n}),t.off=(e,r)=>({type:"note-off",uuid:e,pitch:r}),t.audition=(e,r,n,i)=>({type:"note-audition",uuid:e,pitch:r,duration:n,velocity:i}),t.isOn=e=>e.type==="note-on",t.isOff=e=>e.type==="note-off",t.isAudition=e=>e.type==="note-audition",t.fromEvent=(e,r)=>{let n=e.data;if(ls.isNoteOn(n)){let i=ls.readPitch(n),a=ls.readVelocity(n);return{type:"note-on",uuid:r,pitch:i,velocity:a}}else if(ls.isNoteOff(n)){let i=ls.readPitch(n);return{type:"note-off",uuid:r,pitch:i}}return V("Unknown MIDI event")}})(sm||(sm={}));var LP;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(sm.on(r,n,i)),{terminate:()=>{a&&(e(sm.off(r,n)),a=!1)}}}})(LP||(LP={}));var ZP=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},EB,SB,GP,HP,PB,$B;SB=new WeakMap,GP=new WeakMap,HP=new WeakMap,PB=new WeakMap,EB=new WeakSet,$B=function(e,r){return e.subscribeIntegers(r,n=>{ZP(this,GP,"f").replace(n.buffer)&&ZP(this,HP,"f").notify(this)})};var kB,MB,NB,IB,BB,TB;kB=new WeakMap,MB=new WeakMap,NB=new WeakMap,IB=new WeakMap,BB=new WeakMap,TB=new WeakMap;var Hn={isClipBox:t=>t.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:t=>t.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??V("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var Gx={min:30,max:1e3,default:120};var Hx;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?Mr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?Mr.err("Denominator must be a power of two between 1 and 32"):Mr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?at(e,Gx.min,Gx.max):Gx.default,t.clampBaseFrequency=e=>Number.isFinite(e)?at(e,xv.min,xv.max):xv.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of se.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>Hn.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof Eo&&i.timeBase.getValue()===Kr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(Hx||(Hx={}));var qP;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return Hx.isTimeSignatureValid(i,a)}})(qP||(qP={}));var JP;(function(t){t.reader=({sab:e,numChunks:r,numberOfChannels:n,bufferSize:i},a)=>{let o=!0,s=new Int32Array(e,0,2),u=new Float32Array(e,8),d=new Float32Array(n*i),m=typeof document>"u",x=()=>{if(!o)return;let g=Atomics.load(s,1),w=Atomics.load(s,0);if(g===w){if(m)Atomics.wait(s,0,w);else{setTimeout(x,1);return}w=Atomics.load(s,0)}for(;g!==w;){let _=g*n*i;d.set(u.subarray(_,_+n*i));let N=[];for(let j=0;j<n;j++){let W=j*i,O=W+i;N.push(d.slice(W,O))}if(g=(g+1)%r,Atomics.store(s,1,g),!o)return;a(N)}x()};return x(),{stop:()=>o=!1}},t.writer=({sab:e,numChunks:r,numberOfChannels:n,bufferSize:i})=>{let a=new Int32Array(e,0,2),o=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==n)return;for(let m of s)if(m.length!==i)return V("Each channel buffer must contain 'bufferSize' samples");let u=Atomics.load(a,0),d=u*n*i;s.forEach((m,x)=>o.set(m,d+x*i)),Atomics.store(a,0,(u+1)%r),Atomics.notify(a,0)}})}})(JP||(JP={}));var DB=1,RB=t=>new RegExp(`^// @${t} (\\w+) (\\d+) (\\d+)
|
|
4
|
+
`),qx=(t,e)=>{let r=t.match(e);return r!==null?{userCode:t.slice(r[0].length),update:parseInt(r[3])}:{userCode:t,update:0}},I_=new WeakMap,CB=(t,e,r)=>{let n=t.graph,i=I_.get(t)??new Map,a=t.parameters.pointerHub.filter(),o=new Map;for(let d of a){let m=Ie(d.box,sa);o.set(m.label.getValue(),m)}let s=new Set;for(let{label:d}of e)s.add(d);for(let[d,m]of o)s.has(d)||m.delete();s.clear();let u=new Map;for(let d of e){if(s.has(d.label))continue;s.add(d.label);let m=r.get(d.label)??0,x=o.get(d.label),g=i.get(d.label),w=!K(g)||!xr.isEqual(g,d);K(x)&&w&&(x.delete(),o.delete(d.label));let _=o.get(d.label);K(_)?_.index.getValue()!==m&&_.index.setValue(m):sa.create(n,k.generate(),N=>{N.owner.refer(t.parameters),N.label.setValue(d.label),N.index.setValue(m),N.value.setValue(d.defaultValue),N.defaultValue.setValue(d.defaultValue)}),u.set(d.label,d)}I_.set(t,u)},zB=(t,e,r)=>{let n=t.graph,i=t.samples.pointerHub.filter(),a=new Map;for(let s of i){let u=Ie(s.box,Vs);a.set(u.label.getValue(),u)}let o=new Set;for(let{label:s}of e)o.add(s);for(let[s,u]of a)o.has(s)||(u.file.targetVertex.ifSome(({box:d})=>{let m=d.pointerHub.size()===1;u.file.defer(),m&&d.delete()}),u.delete());o.clear();for(let s of e){if(o.has(s.label))continue;o.add(s.label);let u=r.get(s.label)??0,d=a.get(s.label);K(d)?d.index.getValue()!==u&&d.index.setValue(u):Vs.create(n,k.generate(),m=>{m.owner.refer(t.samples),m.label.setValue(s.label),m.index.setValue(u)})}},N_=(t,e,r,n)=>{let i=xr.parseDeclarationOrder(n),a=xr.parseParams(n).map(s=>({label:s.label,index:i.get(s.label)??0,mapping:s.mapping,min:s.min,max:s.max,unit:s.unit})),o=xr.parseSamples(n).map(s=>({label:s.label,index:i.get(s.label)??0}));return`
|
|
5
|
+
if (typeof globalThis.openDAW === "undefined") { globalThis.openDAW = {} }
|
|
6
|
+
if (typeof globalThis.openDAW.${t.registryName} === "undefined") { globalThis.openDAW.${t.registryName} = {} }
|
|
7
|
+
globalThis.openDAW.${t.registryName}["${e}"] = {
|
|
8
|
+
update: ${r},
|
|
9
|
+
create: (function ${t.functionName}() {
|
|
10
|
+
${n}
|
|
11
|
+
return Processor
|
|
12
|
+
})(),
|
|
13
|
+
params: ${JSON.stringify(a)},
|
|
14
|
+
samples: ${JSON.stringify(o)}
|
|
15
|
+
}
|
|
16
|
+
`},XP=t=>{new Function(t)},YP=async(t,e)=>{let r=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(r);try{await t.audioWorklet.addModule(n)}finally{URL.revokeObjectURL(n)}},QP;(function(t){t.wrap=N_,t.create=e=>{let r=RB(e.headerTag),n=a=>`// @${e.headerTag} js ${DB} ${a}
|
|
17
|
+
`,i=0;return{stripHeader:a=>qx(a,r).userCode,load:async(a,o)=>{let{userCode:s,update:u}=qx(o.code.getValue(),r);if(u===0)return;let d=xr.parseParams(s),m=new Map;for(let w of d)m.set(w.label,w);I_.set(o,m);let x=k.toString(o.address.uuid),g=N_(e,x,u,s);return XP(g),YP(a,g)},compile:async(a,o,s,u,d=!1)=>{let m=qx(u,r).userCode,x=qx(s.code.getValue(),r).update;i=Math.max(i,x);let g=i+1;i=g;let w=k.toString(s.address.uuid),_=xr.parseParams(m),N=xr.parseSamples(m),j=xr.parseDeclarationOrder(m),W=N_(e,w,g,m);XP(W);let O=xr.parseLabel(m),te=()=>{s.code.setValue(n(g)+m),O.ifSome(ie=>s.label.setValue(ie)),CB(s,_,j),zB(s,N,j)};return d?o.append(te):o.modify(te),YP(a,W)}}}})(QP||(QP={}));var B_={isRegion:t=>Hn.isRegionBox(t.box),isLoopableRegion:t=>Hn.isLoopableRegionBox(t.box)};var st=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nt=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},e$,Jx,T_,Xx,lm,us,Vl,Ul,OB,VB,t$,UB,jB,jl,Kl,Wl,Yx,r$,KB,WB,LB,ZB,GB;Jx=new WeakMap,T_=new WeakMap,Xx=new WeakMap,lm=new WeakMap,us=new WeakMap,Vl=new WeakMap,Ul=new WeakMap,e$=new WeakSet,OB=function(e,r){Nt(this,Jx,e,"f"),Nt(this,T_,r,"f"),Nt(this,Xx,-2,"f"),Nt(this,lm,Number.NEGATIVE_INFINITY,"f"),Nt(this,us,0,"f"),Nt(this,Vl,1,"f"),Nt(this,Ul,0,"f")},VB=function(e){let r=st(this,Jx,"f");if(r.length===0)return st(this,T_,"f");let n=st(this,e$,"m",t$).call(this,e);if(n===st(this,Xx,"f")&&e===st(this,lm,"f")+gh)return Nt(this,lm,e,"f"),Nt(this,us,st(this,Vl,"f")*st(this,us,"f")+st(this,Ul,"f"),"f");if(Nt(this,Xx,n,"f"),Nt(this,lm,e,"f"),n<0)return Nt(this,Vl,1,"f"),Nt(this,Ul,0,"f"),Nt(this,us,n===-1?r[0].value:r[r.length-1].value,"f");let i=r[n],a=r[n+1],o=i.interpolation;if(o.type==="none")return Nt(this,Vl,1,"f"),Nt(this,Ul,0,"f"),Nt(this,us,i.value,"f");if(o.type==="linear")return Nt(this,Vl,1,"f"),Nt(this,Ul,(a.value-i.value)*gh/(a.position-i.position),"f"),Nt(this,us,i.value+(e-i.position)/(a.position-i.position)*(a.value-i.value),"f");{let{m:s,q:u}=Jt.coefficients({slope:o.slope,steps:(a.position-i.position)/gh,y0:i.value,y1:a.value});return Nt(this,Vl,s,"f"),Nt(this,Ul,u,"f"),Nt(this,us,Jt.valueAt({slope:o.slope,steps:a.position-i.position,y0:i.value,y1:a.value},e-i.position),"f")}},t$=function(e){let r=st(this,Jx,"f");if(e<r[0].position)return-1;let n=r.length-1;if(e>=r[n].position)return-3;let i=0,a=n;for(;i<a;){let o=i+a+1>>1;r[o].position<=e?i=o:a=o-1}return i};jB=new WeakMap,jl=new WeakMap,Kl=new WeakMap,Wl=new WeakMap,Yx=new WeakMap,r$=new WeakMap,KB=new WeakMap,WB=new WeakMap,UB=new WeakSet,LB=function(){st(this,Kl,"f").length=0,st(this,Wl,"f").length=0,Nt(this,r$,Number.NaN,"f");let e=st(this,jl,"f").tempoTrackEvents;if(e.isEmpty())return;let r=e.unwrap();if(r.events.isEmpty())return;let n=r.events.asArray(),i=st(this,jl,"f").box.bpm.getValue(),a=[{ppqn:0,seconds:0,bpm:r.valueAt(0,i)}],o=0,s=0;for(let d of n){let m=d.position;m<=s||(o+=st(this,Yx,"f").integrate(n,s,m,i),s=m,a.push({ppqn:m,seconds:o,bpm:r.valueAt(m,i)}))}st(this,Kl,"f").push(...a);let u=a.slice().sort((d,m)=>d.seconds-m.seconds);st(this,Wl,"f").push(...u)},ZB=function(e){if(e<=0)return 0;let r=st(this,jl,"f").box.bpm.getValue(),n=st(this,jl,"f").tempoTrackEvents;if(n.isEmpty())return Me.pulsesToSeconds(e,r);let i=n.unwrap();if(i.events.isEmpty())return Me.pulsesToSeconds(e,r);let a=i.events.asArray(),o=0,s=0;if(st(this,Kl,"f").length>0){let u=ht.rightMostMapped(st(this,Kl,"f"),e,mo,d=>d.ppqn);if(u>=0){let d=st(this,Kl,"f")[u];if(o=d.ppqn,s=d.seconds,u===st(this,Kl,"f").length-1)return s+Me.pulsesToSeconds(e-o,d.bpm)}}return s+st(this,Yx,"f").integrate(a,o,e,r)},GB=function(e){if(e<=0)return 0;let r=st(this,jl,"f").box.bpm.getValue(),n=st(this,jl,"f").tempoTrackEvents;if(n.isEmpty())return Me.secondsToPulses(e,r);let i=n.unwrap();if(i.events.isEmpty())return Me.secondsToPulses(e,r);let a=i.events.asArray(),o=0,s=0;if(st(this,Wl,"f").length>0){let u=ht.rightMostMapped(st(this,Wl,"f"),e,mo,d=>d.seconds);if(u>=0){let d=st(this,Wl,"f")[u];if(o=d.ppqn,s=d.seconds,u===st(this,Wl,"f").length-1)return o+Me.secondsToPulses(e-s,d.bpm)}}return st(this,Yx,"f").advance(a,o,s,e,r)};var i$;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Loop=2]="Loop"})(i$||(i$={}));var HB,qB,JB,XB;HB=new WeakMap,qB=new WeakMap,JB=new WeakMap,XB=new WeakMap;var YB,QB,eT,tT;YB=new WeakMap,QB=new WeakMap,eT=new WeakMap,tT=new WeakMap;var ke={};Ta(ke,{$brand:()=>R_,$input:()=>i1,$output:()=>r1,NEVER:()=>D_,TimePrecision:()=>s1,ZodAny:()=>JF,ZodArray:()=>eE,ZodBase64:()=>Ew,ZodBase64URL:()=>Sw,ZodBigInt:()=>Dd,ZodBigIntFormat:()=>kw,ZodBoolean:()=>Td,ZodCIDRv4:()=>Aw,ZodCIDRv6:()=>Fw,ZodCUID:()=>gw,ZodCUID2:()=>vw,ZodCatch:()=>_E,ZodCodec:()=>Vm,ZodCustom:()=>Um,ZodCustomStringFormat:()=>Id,ZodDate:()=>Dm,ZodDefault:()=>gE,ZodDiscriminatedUnion:()=>rE,ZodE164:()=>Pw,ZodEmail:()=>fw,ZodEmoji:()=>mw,ZodEnum:()=>Md,ZodError:()=>IR,ZodExactOptional:()=>fE,ZodFile:()=>dE,ZodFirstPartyTypeKind:()=>DE,ZodFunction:()=>IE,ZodGUID:()=>Mm,ZodIPv4:()=>bw,ZodIPv6:()=>_w,ZodISODate:()=>sw,ZodISODateTime:()=>ow,ZodISODuration:()=>uw,ZodISOTime:()=>lw,ZodIntersection:()=>iE,ZodIssueCode:()=>TR,ZodJWT:()=>$w,ZodKSUID:()=>ww,ZodLazy:()=>kE,ZodLiteral:()=>cE,ZodMAC:()=>KF,ZodMap:()=>lE,ZodNaN:()=>FE,ZodNanoID:()=>hw,ZodNever:()=>YF,ZodNonOptional:()=>Dw,ZodNull:()=>HF,ZodNullable:()=>hE,ZodNumber:()=>Bd,ZodNumberFormat:()=>Ql,ZodObject:()=>Cm,ZodOptional:()=>Tw,ZodPipe:()=>Om,ZodPrefault:()=>xE,ZodPreprocess:()=>EE,ZodPromise:()=>NE,ZodReadonly:()=>SE,ZodRealError:()=>wi,ZodRecord:()=>kd,ZodSet:()=>uE,ZodString:()=>Nd,ZodStringFormat:()=>pt,ZodSuccess:()=>bE,ZodSymbol:()=>ZF,ZodTemplateLiteral:()=>$E,ZodTransform:()=>pE,ZodTuple:()=>aE,ZodType:()=>Te,ZodULID:()=>xw,ZodURL:()=>Tm,ZodUUID:()=>Ia,ZodUndefined:()=>GF,ZodUnion:()=>zm,ZodUnknown:()=>XF,ZodVoid:()=>QF,ZodXID:()=>yw,ZodXor:()=>tE,_ZodString:()=>pw,_default:()=>vE,_function:()=>LM,any:()=>_M,array:()=>Rm,base64:()=>aM,base64url:()=>oM,bigint:()=>vM,boolean:()=>LF,catch:()=>AE,check:()=>ZM,cidrv4:()=>iM,cidrv6:()=>nM,clone:()=>Yr,codec:()=>UM,coerce:()=>RE,config:()=>jt,core:()=>uo,cuid:()=>qk,cuid2:()=>Jk,custom:()=>GM,date:()=>FM,decode:()=>RF,decodeAsync:()=>zF,describe:()=>HM,discriminatedUnion:()=>MM,e164:()=>sM,email:()=>Ok,emoji:()=>Gk,encode:()=>DF,encodeAsync:()=>CF,endsWith:()=>yd,enum:()=>Iw,exactOptional:()=>mE,file:()=>CM,flattenError:()=>gm,float32:()=>fM,float64:()=>mM,formatError:()=>vm,fromJSONSchema:()=>tN,function:()=>LM,getErrorMap:()=>RR,globalRegistry:()=>kr,gt:()=>Ma,gte:()=>ei,guid:()=>Vk,hash:()=>pM,hex:()=>dM,hostname:()=>cM,httpUrl:()=>Zk,includes:()=>vd,instanceof:()=>JM,int:()=>cw,int32:()=>hM,int64:()=>xM,intersection:()=>nE,invertCodec:()=>jM,ipv4:()=>eM,ipv6:()=>rM,iso:()=>$d,json:()=>YM,jwt:()=>lM,keyof:()=>EM,ksuid:()=>Qk,lazy:()=>ME,length:()=>Xl,literal:()=>RM,locales:()=>Em,looseObject:()=>$M,looseRecord:()=>IM,lowercase:()=>hd,lt:()=>ka,lte:()=>ji,mac:()=>tM,map:()=>BM,maxLength:()=>Jl,maxSize:()=>gs,meta:()=>qM,mime:()=>wd,minLength:()=>lo,minSize:()=>Na,multipleOf:()=>hs,nan:()=>VM,nanoid:()=>Hk,nativeEnum:()=>DM,negative:()=>Jy,never:()=>Mw,nonnegative:()=>Yy,nonoptional:()=>wE,nonpositive:()=>Xy,normalize:()=>bd,null:()=>qF,nullable:()=>Im,nullish:()=>zM,number:()=>WF,object:()=>SM,optional:()=>Nm,overwrite:()=>Jn,parse:()=>NF,parseAsync:()=>IF,partialRecord:()=>NM,pipe:()=>dw,positive:()=>qy,prefault:()=>yE,preprocess:()=>QM,prettifyError:()=>q_,promise:()=>WM,property:()=>Qy,readonly:()=>PE,record:()=>sE,refine:()=>BE,regex:()=>md,regexes:()=>Ui,registry:()=>$y,safeDecode:()=>VF,safeDecodeAsync:()=>jF,safeEncode:()=>OF,safeEncodeAsync:()=>UF,safeParse:()=>BF,safeParseAsync:()=>TF,set:()=>TM,setErrorMap:()=>DR,size:()=>ql,slugify:()=>Ed,startsWith:()=>xd,strictObject:()=>PM,string:()=>km,stringFormat:()=>uM,stringbool:()=>XM,success:()=>OM,superRefine:()=>TE,symbol:()=>wM,templateLiteral:()=>KM,toJSONSchema:()=>iw,toLowerCase:()=>Ad,toUpperCase:()=>Fd,transform:()=>Bw,treeifyError:()=>H_,trim:()=>_d,tuple:()=>oE,uint32:()=>gM,uint64:()=>yM,ulid:()=>Xk,undefined:()=>bM,union:()=>Nw,unknown:()=>Yl,uppercase:()=>gd,url:()=>Lk,util:()=>q,uuid:()=>Uk,uuidv4:()=>jk,uuidv6:()=>Kk,uuidv7:()=>Wk,void:()=>AM,xid:()=>Yk,xor:()=>kM});var uo={};Ta(uo,{$ZodAny:()=>FA,$ZodArray:()=>kA,$ZodAsyncError:()=>qn,$ZodBase64:()=>mA,$ZodBase64URL:()=>hA,$ZodBigInt:()=>wy,$ZodBigIntFormat:()=>wA,$ZodBoolean:()=>bm,$ZodCIDRv4:()=>dA,$ZodCIDRv6:()=>pA,$ZodCUID:()=>Q0,$ZodCUID2:()=>eA,$ZodCatch:()=>GA,$ZodCheck:()=>mt,$ZodCheckBigIntFormat:()=>k0,$ZodCheckEndsWith:()=>U0,$ZodCheckGreaterThan:()=>my,$ZodCheckIncludes:()=>O0,$ZodCheckLengthEquals:()=>D0,$ZodCheckLessThan:()=>fy,$ZodCheckLowerCase:()=>C0,$ZodCheckMaxLength:()=>B0,$ZodCheckMaxSize:()=>M0,$ZodCheckMimeType:()=>K0,$ZodCheckMinLength:()=>T0,$ZodCheckMinSize:()=>N0,$ZodCheckMultipleOf:()=>P0,$ZodCheckNumberFormat:()=>$0,$ZodCheckOverwrite:()=>W0,$ZodCheckProperty:()=>j0,$ZodCheckRegex:()=>R0,$ZodCheckSizeEquals:()=>I0,$ZodCheckStartsWith:()=>V0,$ZodCheckStringFormat:()=>pd,$ZodCheckUpperCase:()=>z0,$ZodCodec:()=>Am,$ZodCustom:()=>t1,$ZodCustomStringFormat:()=>xA,$ZodDate:()=>$A,$ZodDefault:()=>KA,$ZodDiscriminatedUnion:()=>IA,$ZodE164:()=>gA,$ZodEmail:()=>q0,$ZodEmoji:()=>X0,$ZodEncodeError:()=>cs,$ZodEnum:()=>CA,$ZodError:()=>hm,$ZodExactOptional:()=>UA,$ZodFile:()=>OA,$ZodFunction:()=>YA,$ZodGUID:()=>G0,$ZodIPv4:()=>lA,$ZodIPv6:()=>uA,$ZodISODate:()=>aA,$ZodISODateTime:()=>nA,$ZodISODuration:()=>sA,$ZodISOTime:()=>oA,$ZodIntersection:()=>BA,$ZodJWT:()=>vA,$ZodKSUID:()=>iA,$ZodLazy:()=>e1,$ZodLiteral:()=>zA,$ZodMAC:()=>cA,$ZodMap:()=>DA,$ZodNaN:()=>HA,$ZodNanoID:()=>Y0,$ZodNever:()=>SA,$ZodNonOptional:()=>LA,$ZodNull:()=>AA,$ZodNullable:()=>jA,$ZodNumber:()=>yy,$ZodNumberFormat:()=>yA,$ZodObject:()=>T$,$ZodObjectJIT:()=>MA,$ZodOptional:()=>_y,$ZodPipe:()=>Ay,$ZodPrefault:()=>WA,$ZodPreprocess:()=>qA,$ZodPromise:()=>QA,$ZodReadonly:()=>JA,$ZodRealError:()=>yi,$ZodRecord:()=>TA,$ZodRegistry:()=>Py,$ZodSet:()=>RA,$ZodString:()=>Hl,$ZodStringFormat:()=>dt,$ZodSuccess:()=>ZA,$ZodSymbol:()=>bA,$ZodTemplateLiteral:()=>XA,$ZodTransform:()=>VA,$ZodTuple:()=>by,$ZodType:()=>$e,$ZodULID:()=>tA,$ZodURL:()=>J0,$ZodUUID:()=>H0,$ZodUndefined:()=>_A,$ZodUnion:()=>_m,$ZodUnknown:()=>EA,$ZodVoid:()=>PA,$ZodXID:()=>rA,$ZodXor:()=>NA,$brand:()=>R_,$constructor:()=>I,$input:()=>i1,$output:()=>r1,Doc:()=>wm,JSONSchema:()=>Rk,JSONSchemaGenerator:()=>nw,NEVER:()=>D_,TimePrecision:()=>s1,_any:()=>$1,_array:()=>D1,_base64:()=>Ly,_base64url:()=>Zy,_bigint:()=>b1,_boolean:()=>y1,_catch:()=>FR,_check:()=>Dk,_cidrv4:()=>Ky,_cidrv6:()=>Wy,_coercedBigint:()=>_1,_coercedBoolean:()=>w1,_coercedDate:()=>B1,_coercedNumber:()=>f1,_coercedString:()=>a1,_cuid:()=>Ry,_cuid2:()=>Cy,_custom:()=>C1,_date:()=>I1,_decode:()=>ny,_decodeAsync:()=>oy,_default:()=>bR,_discriminatedUnion:()=>uR,_e164:()=>Gy,_email:()=>ky,_emoji:()=>Ty,_encode:()=>iy,_encodeAsync:()=>ay,_endsWith:()=>yd,_enum:()=>hR,_file:()=>R1,_float32:()=>h1,_float64:()=>g1,_gt:()=>Ma,_gte:()=>ei,_guid:()=>Sm,_includes:()=>vd,_int:()=>m1,_int32:()=>v1,_int64:()=>A1,_intersection:()=>cR,_ipv4:()=>Uy,_ipv6:()=>jy,_isoDate:()=>u1,_isoDateTime:()=>l1,_isoDuration:()=>d1,_isoTime:()=>c1,_jwt:()=>Hy,_ksuid:()=>Vy,_lazy:()=>$R,_length:()=>Xl,_literal:()=>vR,_lowercase:()=>hd,_lt:()=>ka,_lte:()=>ji,_mac:()=>o1,_map:()=>fR,_max:()=>ji,_maxLength:()=>Jl,_maxSize:()=>gs,_mime:()=>wd,_min:()=>ei,_minLength:()=>lo,_minSize:()=>Na,_multipleOf:()=>hs,_nan:()=>T1,_nanoid:()=>Dy,_nativeEnum:()=>gR,_negative:()=>Jy,_never:()=>M1,_nonnegative:()=>Yy,_nonoptional:()=>_R,_nonpositive:()=>Xy,_normalize:()=>bd,_null:()=>P1,_nullable:()=>wR,_number:()=>p1,_optional:()=>yR,_overwrite:()=>Jn,_parse:()=>ld,_parseAsync:()=>ud,_pipe:()=>ER,_positive:()=>qy,_promise:()=>kR,_property:()=>Qy,_readonly:()=>SR,_record:()=>pR,_refine:()=>z1,_regex:()=>md,_safeDecode:()=>ly,_safeDecodeAsync:()=>cy,_safeEncode:()=>sy,_safeEncodeAsync:()=>uy,_safeParse:()=>cd,_safeParseAsync:()=>dd,_set:()=>mR,_size:()=>ql,_slugify:()=>Ed,_startsWith:()=>xd,_string:()=>n1,_stringFormat:()=>Sd,_stringbool:()=>j1,_success:()=>AR,_superRefine:()=>O1,_symbol:()=>E1,_templateLiteral:()=>PR,_toLowerCase:()=>Ad,_toUpperCase:()=>Fd,_transform:()=>xR,_trim:()=>_d,_tuple:()=>dR,_uint32:()=>x1,_uint64:()=>F1,_ulid:()=>zy,_undefined:()=>S1,_union:()=>sR,_unknown:()=>k1,_uppercase:()=>gd,_url:()=>Pm,_uuid:()=>My,_uuidv4:()=>Ny,_uuidv6:()=>Iy,_uuidv7:()=>By,_void:()=>N1,_xid:()=>Oy,_xor:()=>lR,clone:()=>Yr,config:()=>jt,createStandardJSONSchemaMethod:()=>Pd,createToJSONSchemaMethod:()=>K1,decode:()=>kT,decodeAsync:()=>NT,describe:()=>V1,encode:()=>$T,encodeAsync:()=>MT,extractDefs:()=>xs,finalize:()=>ys,flattenError:()=>gm,formatError:()=>vm,globalConfig:()=>Ll,globalRegistry:()=>kr,initializeContext:()=>vs,isValidBase64:()=>fA,isValidBase64URL:()=>M$,isValidJWT:()=>N$,locales:()=>Em,meta:()=>U1,parse:()=>ty,parseAsync:()=>ry,prettifyError:()=>q_,process:()=>lt,regexes:()=>Ui,registry:()=>$y,safeDecode:()=>BT,safeDecodeAsync:()=>DT,safeEncode:()=>IT,safeEncodeAsync:()=>TT,safeParse:()=>J_,safeParseAsync:()=>X_,toDotPath:()=>u$,toJSONSchema:()=>iw,treeifyError:()=>H_,util:()=>q,version:()=>L0});var n$,D_=Object.freeze({status:"aborted"});function I(t,e,r){function n(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),s._zod.traits.has(t))return;s._zod.traits.add(t),e(s,u);let d=o.prototype,m=Object.keys(d);for(let x=0;x<m.length;x++){let g=m[x];g in s||(s[g]=d[g].bind(s))}}let i=r?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:t});function o(s){var u;let d=r?.Parent?new a:this;n(d,s),(u=d._zod).deferred??(u.deferred=[]);for(let m of d._zod.deferred)m();return d}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var R_=Symbol("zod_brand"),qn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},cs=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(n$=globalThis).__zod_globalConfig??(n$.__zod_globalConfig={});var Ll=globalThis.__zod_globalConfig;function jt(t){return t&&Object.assign(Ll,t),Ll}var q={};Ta(q,{BIGINT_FORMAT_RANGES:()=>Z_,Class:()=>z_,NUMBER_FORMAT_RANGES:()=>L_,aborted:()=>ms,allowsEval:()=>U_,assert:()=>oT,assertEqual:()=>rT,assertIs:()=>nT,assertNever:()=>aT,assertNotEqual:()=>iT,assignProp:()=>ps,base64ToUint8Array:()=>o$,base64urlToUint8Array:()=>AT,cached:()=>od,captureStackTrace:()=>ey,cleanEnum:()=>_T,cleanRegex:()=>dm,clone:()=>Yr,cloneDef:()=>lT,createTransparentProxy:()=>mT,defineLazy:()=>We,esc:()=>Qx,escapeRegex:()=>bn,explicitlyAborted:()=>G_,extend:()=>vT,finalizeIssue:()=>Qr,floatSafeRemainder:()=>O_,getElementAtPath:()=>uT,getEnumValues:()=>cm,getLengthableOrigin:()=>mm,getParsedType:()=>fT,getSizableOrigin:()=>fm,hexToUint8Array:()=>ET,isObject:()=>Zl,isPlainObject:()=>fs,issue:()=>sd,joinValues:()=>z,jsonStringifyReplacer:()=>ad,merge:()=>yT,mergeDefs:()=>so,normalizeParams:()=>X,nullish:()=>ds,numKeys:()=>pT,objectClone:()=>sT,omit:()=>gT,optionalKeys:()=>W_,parsedType:()=>G,partial:()=>wT,pick:()=>hT,prefixIssues:()=>xi,primitiveTypes:()=>K_,promiseAllObject:()=>cT,propertyKeyTypes:()=>pm,randomString:()=>dT,required:()=>bT,safeExtend:()=>xT,shallowClone:()=>j_,slugify:()=>V_,stringifyPrimitive:()=>Z,uint8ArrayToBase64:()=>s$,uint8ArrayToBase64url:()=>FT,uint8ArrayToHex:()=>ST,unwrapMessage:()=>um});function rT(t){return t}function iT(t){return t}function nT(t){}function aT(t){throw new Error("Unexpected value in exhaustive check")}function oT(t){}function cm(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function z(t,e="|"){return t.map(r=>Z(r)).join(e)}function ad(t,e){return typeof e=="bigint"?e.toString():e}function od(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ds(t){return t==null}function dm(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function O_(t,e){let r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}var a$=Symbol("evaluating");function We(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==a$)return n===void 0&&(n=a$,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function sT(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function ps(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function so(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function lT(t){return so(t._zod.def)}function uT(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function cT(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let i={};for(let a=0;a<e.length;a++)i[e[a]]=n[a];return i})}function dT(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function Qx(t){return JSON.stringify(t)}function V_(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ey="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Zl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var U_=od(()=>{if(Ll.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function fs(t){if(Zl(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Zl(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function j_(t){return fs(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function pT(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var fT=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},pm=new Set(["string","number","symbol"]),K_=new Set(["string","number","bigint","boolean","symbol","undefined"]);function bn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yr(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function X(t){let e=t;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 mT(t){let e;return new Proxy({},{get(r,n,i){return e??(e=t()),Reflect.get(e,n,i)},set(r,n,i,a){return e??(e=t()),Reflect.set(e,n,i,a)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,i){return e??(e=t()),Reflect.defineProperty(e,n,i)}})}function Z(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function W_(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var L_={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]},Z_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hT(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=so(t._zod.def,{get shape(){let o={};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(o[s]=r.shape[s])}return ps(this,"shape",o),o},checks:[]});return Yr(t,a)}function gT(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=so(t._zod.def,{get shape(){let o={...t._zod.def.shape};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete o[s]}return ps(this,"shape",o),o},checks:[]});return Yr(t,a)}function vT(t,e){if(!fs(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let a=t._zod.def.shape;for(let o in e)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=so(t._zod.def,{get shape(){let a={...t._zod.def.shape,...e};return ps(this,"shape",a),a}});return Yr(t,i)}function xT(t,e){if(!fs(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=so(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return ps(this,"shape",n),n}});return Yr(t,r)}function yT(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=so(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return ps(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Yr(t,r)}function wT(t,e,r){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=so(e._zod.def,{get shape(){let s=e._zod.def.shape,u={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=t?new t({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)u[d]=t?new t({type:"optional",innerType:s[d]}):s[d];return ps(this,"shape",u),u},checks:[]});return Yr(e,o)}function bT(t,e,r){let n=so(e._zod.def,{get shape(){let i=e._zod.def.shape,a={...i};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)a[o]=new t({type:"nonoptional",innerType:i[o]});return ps(this,"shape",a),a}});return Yr(e,n)}function ms(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function G_(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function xi(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function um(t){return typeof t=="string"?t:t?.message}function Qr(t,e,r){let n=t.message?t.message:um(t.inst?._zod.def?.error?.(t))??um(e?.error?.(t))??um(r.customError?.(t))??um(r.localeError?.(t))??"Invalid input",{inst:i,continue:a,input:o,...s}=t;return s.path??(s.path=[]),s.message=n,e?.reportInput&&(s.input=o),s}function fm(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function mm(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function G(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function sd(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function _T(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function o$(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function s$(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function AT(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return o$(e+r)}function FT(t){return s$(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ET(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function ST(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var z_=class{constructor(...e){}};var l$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,ad,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},hm=I("$ZodError",l$),yi=I("$ZodError",l$,{Parent:Error});function gm(t,e=r=>r.message){let r={},n=[];for(let i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function vm(t,e=r=>r.message){let r={_errors:[]},n=(i,a=[])=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s},[...a,...o.path]));else if(o.code==="invalid_key")n({issues:o.issues},[...a,...o.path]);else if(o.code==="invalid_element")n({issues:o.issues},[...a,...o.path]);else{let s=[...a,...o.path];if(s.length===0)r._errors.push(e(o));else{let u=r,d=0;for(;d<s.length;){let m=s[d];d===s.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(e(o))):u[m]=u[m]||{_errors:[]},u=u[m],d++}}}};return n(t),r}function H_(t,e=r=>r.message){let r={errors:[]},n=(i,a=[])=>{var o,s;for(let u of i.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>n({issues:d},[...a,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...a,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...a,...u.path]);else{let d=[...a,...u.path];if(d.length===0){r.errors.push(e(u));continue}let m=r,x=0;for(;x<d.length;){let g=d[x],w=x===d.length-1;typeof g=="string"?(m.properties??(m.properties={}),(o=m.properties)[g]??(o[g]={errors:[]}),m=m.properties[g]):(m.items??(m.items=[]),(s=m.items)[g]??(s[g]={errors:[]}),m=m.items[g]),w&&m.errors.push(e(u)),x++}}};return n(t),r}function u$(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function q_(t){let e=[],r=[...t.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${u$(n.path)}`);return e.join(`
|
|
18
|
+
`)}var ld=t=>(e,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new qn;if(o.issues.length){let s=new(i?.Err??t)(o.issues.map(u=>Qr(u,a,jt())));throw ey(s,i?.callee),s}return o.value},ty=ld(yi),ud=t=>async(e,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let s=new(i?.Err??t)(o.issues.map(u=>Qr(u,a,jt())));throw ey(s,i?.callee),s}return o.value},ry=ud(yi),cd=t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new qn;return a.issues.length?{success:!1,error:new(t??hm)(a.issues.map(o=>Qr(o,i,jt())))}:{success:!0,data:a.value}},J_=cd(yi),dd=t=>async(e,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(o=>Qr(o,i,jt())))}:{success:!0,data:a.value}},X_=dd(yi),iy=t=>(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return ld(t)(e,r,i)},$T=iy(yi),ny=t=>(e,r,n)=>ld(t)(e,r,n),kT=ny(yi),ay=t=>async(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return ud(t)(e,r,i)},MT=ay(yi),oy=t=>async(e,r,n)=>ud(t)(e,r,n),NT=oy(yi),sy=t=>(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return cd(t)(e,r,i)},IT=sy(yi),ly=t=>(e,r,n)=>cd(t)(e,r,n),BT=ly(yi),uy=t=>async(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return dd(t)(e,r,i)},TT=uy(yi),cy=t=>async(e,r,n)=>dd(t)(e,r,n),DT=cy(yi);var Ui={};Ta(Ui,{base64:()=>f0,base64url:()=>dy,bigint:()=>w0,boolean:()=>_0,browserEmail:()=>KT,cidrv4:()=>d0,cidrv6:()=>p0,cuid:()=>Y_,cuid2:()=>Q_,date:()=>g0,datetime:()=>x0,domain:()=>ZT,duration:()=>n0,e164:()=>h0,email:()=>o0,emoji:()=>s0,extendedDuration:()=>RT,guid:()=>a0,hex:()=>GT,hostname:()=>LT,html5Email:()=>VT,httpProtocol:()=>m0,idnEmail:()=>jT,integer:()=>b0,ipv4:()=>l0,ipv6:()=>u0,ksuid:()=>r0,lowercase:()=>E0,mac:()=>c0,md5_base64:()=>qT,md5_base64url:()=>JT,md5_hex:()=>HT,nanoid:()=>i0,null:()=>A0,number:()=>py,rfc5322Email:()=>UT,sha1_base64:()=>YT,sha1_base64url:()=>QT,sha1_hex:()=>XT,sha256_base64:()=>tD,sha256_base64url:()=>rD,sha256_hex:()=>eD,sha384_base64:()=>nD,sha384_base64url:()=>aD,sha384_hex:()=>iD,sha512_base64:()=>sD,sha512_base64url:()=>lD,sha512_hex:()=>oD,string:()=>y0,time:()=>v0,ulid:()=>e0,undefined:()=>F0,unicodeEmail:()=>c$,uppercase:()=>S0,uuid:()=>Gl,uuid4:()=>CT,uuid6:()=>zT,uuid7:()=>OT,xid:()=>t0});var Y_=/^[cC][0-9a-z]{6,}$/,Q_=/^[0-9a-z]+$/,e0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,t0=/^[0-9a-vA-V]{20}$/,r0=/^[A-Za-z0-9]{27}$/,i0=/^[a-zA-Z0-9_-]{21}$/,n0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,RT=/^[-+]?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)?)??$/,a0=/^([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})$/,Gl=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,CT=Gl(4),zT=Gl(6),OT=Gl(7),o0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,VT=/^[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])?)*$/,UT=/^(([^<>()\[\]\\.,;:\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,}))$/,c$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,jT=c$,KT=/^[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])?)*$/,WT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function s0(){return new RegExp(WT,"u")}var l0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,u0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,c0=t=>{let e=bn(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},d0=/^((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])$/,p0=/^(([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])$/,f0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dy=/^[A-Za-z0-9_-]*$/,LT=/^(?=.{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])?)*\.?$/,ZT=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,m0=/^https?$/,h0=/^\+[1-9]\d{6,14}$/,d$="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",g0=new RegExp(`^${d$}$`);function p$(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function v0(t){return new RegExp(`^${p$(t)}$`)}function x0(t){let e=p$({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${d$}T(?:${n})$`)}var y0=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},w0=/^-?\d+n?$/,b0=/^-?\d+$/,py=/^-?\d+(?:\.\d+)?$/,_0=/^(?:true|false)$/i,A0=/^null$/i;var F0=/^undefined$/i;var E0=/^[^A-Z]*$/,S0=/^[^a-z]*$/,GT=/^[0-9a-fA-F]*$/;function xm(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function ym(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var HT=/^[0-9a-fA-F]{32}$/,qT=xm(22,"=="),JT=ym(22),XT=/^[0-9a-fA-F]{40}$/,YT=xm(27,"="),QT=ym(27),eD=/^[0-9a-fA-F]{64}$/,tD=xm(43,"="),rD=ym(43),iD=/^[0-9a-fA-F]{96}$/,nD=xm(64,""),aD=ym(64),oD=/^[0-9a-fA-F]{128}$/,sD=xm(86,"=="),lD=ym(86);var mt=I("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),m$={number:"number",bigint:"bigint",object:"date"},fy=I("$ZodCheckLessThan",(t,e)=>{mt.init(t,e);let r=m$[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<a&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),my=I("$ZodCheckGreaterThan",(t,e)=>{mt.init(t,e);let r=m$[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),P0=I("$ZodCheckMultipleOf",(t,e)=>{mt.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):O_(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),$0=I("$ZodCheckNumberFormat",(t,e)=>{mt.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,a]=L_[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=i,s.maximum=a,r&&(s.pattern=b0)}),t._zod.check=o=>{let s=o.value;if(r){if(!Number.isInteger(s)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:t,continue:!e.abort})}}),k0=I("$ZodCheckBigIntFormat",(t,e)=>{mt.init(t,e);let[r,n]=Z_[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=r,a.maximum=n}),t._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}}),M0=I("$ZodCheckMaxSize",(t,e)=>{var r;mt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!ds(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:fm(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),N0=I("$ZodCheckMinSize",(t,e)=>{var r;mt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!ds(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:fm(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),I0=I("$ZodCheckSizeEquals",(t,e)=>{var r;mt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!ds(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),t._zod.check=n=>{let i=n.value,a=i.size;if(a===e.size)return;let o=a>e.size;n.issues.push({origin:fm(i),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),B0=I("$ZodCheckMaxLength",(t,e)=>{var r;mt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!ds(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let o=mm(i);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),T0=I("$ZodCheckMinLength",(t,e)=>{var r;mt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!ds(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let o=mm(i);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),D0=I("$ZodCheckLengthEquals",(t,e)=>{var r;mt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!ds(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{let i=n.value,a=i.length;if(a===e.length)return;let o=mm(i),s=a>e.length;n.issues.push({origin:o,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),pd=I("$ZodCheckStringFormat",(t,e)=>{var r,n;mt.init(t,e),t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.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:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),R0=I("$ZodCheckRegex",(t,e)=>{pd.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),C0=I("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=E0),pd.init(t,e)}),z0=I("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=S0),pd.init(t,e)}),O0=I("$ZodCheckIncludes",(t,e)=>{mt.init(t,e);let r=bn(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),t._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:t,continue:!e.abort})}}),V0=I("$ZodCheckStartsWith",(t,e)=>{mt.init(t,e);let r=new RegExp(`^${bn(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),U0=I("$ZodCheckEndsWith",(t,e)=>{mt.init(t,e);let r=new RegExp(`.*${bn(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function f$(t,e,r){t.issues.length&&e.issues.push(...xi(r,t.issues))}var j0=I("$ZodCheckProperty",(t,e)=>{mt.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>f$(i,r,e.property));f$(n,r,e.property)}}),K0=I("$ZodCheckMimeType",(t,e)=>{mt.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),W0=I("$ZodCheckOverwrite",(t,e)=>{mt.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var wm=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
19
|
+
`).filter(o=>o),i=Math.min(...n.map(o=>o.length-o.trimStart().length)),a=n.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(let o of a)this.content.push(o)}compile(){let e=Function,r=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new e(...r,i.join(`
|
|
20
|
+
`))}};var L0={major:4,minor:4,patch:3};var $e=I("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=L0;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let a of i._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=(o,s,u)=>{let d=ms(o),m;for(let x of s){if(x._zod.def.when){if(G_(o)||!x._zod.def.when(o))continue}else if(d)continue;let g=o.issues.length,w=x._zod.check(o);if(w instanceof Promise&&u?.async===!1)throw new qn;if(m||w instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await w,o.issues.length!==g&&(d||(d=ms(o,g)))});else{if(o.issues.length===g)continue;d||(d=ms(o,g))}}return m?m.then(()=>o):o},a=(o,s,u)=>{if(ms(o))return o.aborted=!0,o;let d=i(s,n,u);if(d instanceof Promise){if(u.async===!1)throw new qn;return d.then(m=>t._zod.parse(m,u))}return t._zod.parse(d,u)};t._zod.run=(o,s)=>{if(s.skipChecks)return t._zod.parse(o,s);if(s.direction==="backward"){let d=t._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(m=>a(m,o,s)):a(d,o,s)}let u=t._zod.parse(o,s);if(u instanceof Promise){if(s.async===!1)throw new qn;return u.then(d=>i(d,n,s))}return i(u,n,s)}}We(t,"~standard",()=>({validate:i=>{try{let a=J_(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return X_(t,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Hl=I("$ZodString",(t,e)=>{$e.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??y0(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),dt=I("$ZodStringFormat",(t,e)=>{pd.init(t,e),Hl.init(t,e)}),G0=I("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=a0),dt.init(t,e)}),H0=I("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Gl(n))}else e.pattern??(e.pattern=Gl());dt.init(t,e)}),q0=I("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=o0),dt.init(t,e)}),J0=I("$ZodURL",(t,e)=>{dt.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===m0.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),X0=I("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=s0()),dt.init(t,e)}),Y0=I("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=i0),dt.init(t,e)}),Q0=I("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Y_),dt.init(t,e)}),eA=I("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Q_),dt.init(t,e)}),tA=I("$ZodULID",(t,e)=>{e.pattern??(e.pattern=e0),dt.init(t,e)}),rA=I("$ZodXID",(t,e)=>{e.pattern??(e.pattern=t0),dt.init(t,e)}),iA=I("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=r0),dt.init(t,e)}),nA=I("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=x0(e)),dt.init(t,e)}),aA=I("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=g0),dt.init(t,e)}),oA=I("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=v0(e)),dt.init(t,e)}),sA=I("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=n0),dt.init(t,e)}),lA=I("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=l0),dt.init(t,e),t._zod.bag.format="ipv4"}),uA=I("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=u0),dt.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),cA=I("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=c0(e.delimiter)),dt.init(t,e),t._zod.bag.format="mac"}),dA=I("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=d0),dt.init(t,e)}),pA=I("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=p0),dt.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,a]=n;if(!a)throw new Error;let o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function fA(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var mA=I("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=f0),dt.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{fA(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function M$(t){if(!dy.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return fA(r)}var hA=I("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=dy),dt.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{M$(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),gA=I("$ZodE164",(t,e)=>{e.pattern??(e.pattern=h0),dt.init(t,e)});function N$(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var vA=I("$ZodJWT",(t,e)=>{dt.init(t,e),t._zod.check=r=>{N$(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),xA=I("$ZodCustomStringFormat",(t,e)=>{dt.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),yy=I("$ZodNumber",(t,e)=>{$e.init(t,e),t._zod.pattern=t._zod.bag.pattern??py,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}}),yA=I("$ZodNumberFormat",(t,e)=>{$0.init(t,e),yy.init(t,e)}),bm=I("$ZodBoolean",(t,e)=>{$e.init(t,e),t._zod.pattern=_0,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),wy=I("$ZodBigInt",(t,e)=>{$e.init(t,e),t._zod.pattern=w0,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),wA=I("$ZodBigIntFormat",(t,e)=>{k0.init(t,e),wy.init(t,e)}),bA=I("$ZodSymbol",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:t}),r}}),_A=I("$ZodUndefined",(t,e)=>{$e.init(t,e),t._zod.pattern=F0,t._zod.values=new Set([void 0]),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:t}),r}}),AA=I("$ZodNull",(t,e)=>{$e.init(t,e),t._zod.pattern=A0,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),r}}),FA=I("$ZodAny",(t,e)=>{$e.init(t,e),t._zod.parse=r=>r}),EA=I("$ZodUnknown",(t,e)=>{$e.init(t,e),t._zod.parse=r=>r}),SA=I("$ZodNever",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),PA=I("$ZodVoid",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),$A=I("$ZodDate",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:t}),r}});function g$(t,e,r){t.issues.length&&e.issues.push(...xi(r,t.issues)),e.value[r]=t.value}var kA=I("$ZodArray",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let a=[];for(let o=0;o<i.length;o++){let s=i[o],u=e.element._zod.run({value:s,issues:[]},n);u instanceof Promise?a.push(u.then(d=>g$(d,r,o))):g$(u,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function xy(t,e,r,n,i,a){let o=r in n;if(t.issues.length){if(i&&a&&!o)return;e.issues.push(...xi(r,t.issues))}if(!o&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?o&&(e.value[r]=void 0):e.value[r]=t.value}function I$(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=W_(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function B$(t,e,r,n,i,a){let o=[],s=i.keySet,u=i.catchall._zod,d=u.def.type,m=u.optin==="optional",x=u.optout==="optional";for(let g in e){if(g==="__proto__"||s.has(g))continue;if(d==="never"){o.push(g);continue}let w=u.run({value:e[g],issues:[]},n);w instanceof Promise?t.push(w.then(_=>xy(_,r,g,e,m,x))):xy(w,r,g,e,m,x)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}var T$=I("$ZodObject",(t,e)=>{if($e.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...s};return Object.defineProperty(e,"shape",{value:u}),u}})}let n=od(()=>I$(e));We(t._zod,"propValues",()=>{let s=e.shape,u={};for(let d in s){let m=s[d]._zod;if(m.values){u[d]??(u[d]=new Set);for(let x of m.values)u[d].add(x)}}return u});let i=Zl,a=e.catchall,o;t._zod.parse=(s,u)=>{o??(o=n.value);let d=s.value;if(!i(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),s;s.value={};let m=[],x=o.shape;for(let g of o.keys){let w=x[g],_=w._zod.optin==="optional",N=w._zod.optout==="optional",j=w._zod.run({value:d[g],issues:[]},u);j instanceof Promise?m.push(j.then(W=>xy(W,s,g,d,_,N))):xy(j,s,g,d,_,N)}return a?B$(m,d,s,u,n.value,t):m.length?Promise.all(m).then(()=>s):s}}),MA=I("$ZodObjectJIT",(t,e)=>{T$.init(t,e);let r=t._zod.parse,n=od(()=>I$(e)),i=g=>{let w=new wm(["shape","payload","ctx"]),_=n.value,N=te=>{let ie=Qx(te);return`shape[${ie}]._zod.run({ value: input[${ie}], issues: [] }, ctx)`};w.write("const input = payload.value;");let j=Object.create(null),W=0;for(let te of _.keys)j[te]=`key_${W++}`;w.write("const newResult = {};");for(let te of _.keys){let ie=j[te],be=Qx(te),Q=g[te],L=Q?._zod?.optin==="optional",we=Q?._zod?.optout==="optional";w.write(`const ${ie} = ${N(te)};`),L&&we?w.write(`
|
|
21
|
+
if (${ie}.issues.length) {
|
|
22
|
+
if (${be} in input) {
|
|
23
|
+
payload.issues = payload.issues.concat(${ie}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${be}, ...iss.path] : [${be}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${ie}.value === undefined) {
|
|
31
|
+
if (${be} in input) {
|
|
32
|
+
newResult[${be}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${be}] = ${ie}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):L?w.write(`
|
|
39
|
+
if (${ie}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${ie}.issues.map(iss => ({
|
|
41
|
+
...iss,
|
|
42
|
+
path: iss.path ? [${be}, ...iss.path] : [${be}]
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (${ie}.value === undefined) {
|
|
47
|
+
if (${be} in input) {
|
|
48
|
+
newResult[${be}] = undefined;
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
newResult[${be}] = ${ie}.value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
`):w.write(`
|
|
55
|
+
const ${ie}_present = ${be} in input;
|
|
56
|
+
if (${ie}.issues.length) {
|
|
57
|
+
payload.issues = payload.issues.concat(${ie}.issues.map(iss => ({
|
|
58
|
+
...iss,
|
|
59
|
+
path: iss.path ? [${be}, ...iss.path] : [${be}]
|
|
60
|
+
})));
|
|
61
|
+
}
|
|
62
|
+
if (!${ie}_present && !${ie}.issues.length) {
|
|
63
|
+
payload.issues.push({
|
|
64
|
+
code: "invalid_type",
|
|
65
|
+
expected: "nonoptional",
|
|
66
|
+
input: undefined,
|
|
67
|
+
path: [${be}]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (${ie}_present) {
|
|
72
|
+
if (${ie}.value === undefined) {
|
|
73
|
+
newResult[${be}] = undefined;
|
|
74
|
+
} else {
|
|
75
|
+
newResult[${be}] = ${ie}.value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
`)}w.write("payload.value = newResult;"),w.write("return payload;");let O=w.compile();return(te,ie)=>O(g,te,ie)},a,o=Zl,s=!Ll.jitless,d=s&&U_.value,m=e.catchall,x;t._zod.parse=(g,w)=>{x??(x=n.value);let _=g.value;return o(_)?s&&d&&w?.async===!1&&w.jitless!==!0?(a||(a=i(e.shape)),g=a(g,w),m?B$([],_,g,w,x,t):g):r(g,w):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),g)}});function v$(t,e,r,n){for(let a of t)if(a.issues.length===0)return e.value=a.value,e;let i=t.filter(a=>!ms(a));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(o=>Qr(o,n,jt())))}),e)}var _m=I("$ZodUnion",(t,e)=>{$e.init(t,e),We(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),We(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),We(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),We(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>dm(i.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of e.options){let u=s._zod.run({value:n.value,issues:[]},i);if(u instanceof Promise)o.push(u),a=!0;else{if(u.issues.length===0)return u;o.push(u)}}return a?Promise.all(o).then(s=>v$(s,n,t,i)):v$(o,n,t,i)}});function x$(t,e,r,n){let i=t.filter(a=>a.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(o=>Qr(o,n,jt())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var NA=I("$ZodXor",(t,e)=>{_m.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of e.options){let u=s._zod.run({value:n.value,issues:[]},i);u instanceof Promise?(o.push(u),a=!0):o.push(u)}return a?Promise.all(o).then(s=>x$(s,n,t,i)):x$(o,n,t,i)}}),IA=I("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,_m.init(t,e);let r=t._zod.parse;We(t._zod,"propValues",()=>{let i={};for(let a of e.options){let o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let[s,u]of Object.entries(o)){i[s]||(i[s]=new Set);for(let d of u)i[s].add(d)}}return i});let n=od(()=>{let i=e.options,a=new Map;for(let o of i){let s=o._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let u of s){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,o)}}return a});t._zod.parse=(i,a)=>{let o=i.value;if(!Zl(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),i;let s=n.value.get(o?.[e.discriminator]);return s?s._zod.run(i,a):e.unionFallback||a.direction==="backward"?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:o,path:[e.discriminator],inst:t}),i)}}),BA=I("$ZodIntersection",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value,a=e.left._zod.run({value:i,issues:[]},n),o=e.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([u,d])=>y$(r,u,d)):y$(r,a,o)}});function Z0(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(fs(t)&&fs(e)){let r=Object.keys(e),n=Object.keys(t).filter(a=>r.indexOf(a)!==-1),i={...t,...e};for(let a of n){let o=Z0(t[a],e[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let i=t[n],a=e[n],o=Z0(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function y$(t,e,r){let n=new Map,i;for(let s of e.issues)if(s.code==="unrecognized_keys"){i??(i=s);for(let u of s.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else t.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let u of s.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else t.issues.push(s);let a=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&i&&t.issues.push({...i,keys:a}),ms(t))return t;let o=Z0(e.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}var by=I("$ZodTuple",(t,e)=>{$e.init(t,e);let r=e.items;t._zod.parse=(n,i)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let o=[],s=w$(r,"optin"),u=w$(r,"optout");if(!e.rest){if(a.length<s)return n.issues.push({code:"too_small",minimum:s,inclusive:!0,input:a,inst:t,origin:"array"}),n;a.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:t,origin:"array"})}let d=new Array(r.length);for(let m=0;m<r.length;m++){let x=r[m]._zod.run({value:a[m],issues:[]},i);x instanceof Promise?o.push(x.then(g=>{d[m]=g})):d[m]=x}if(e.rest){let m=r.length-1,x=a.slice(r.length);for(let g of x){m++;let w=e.rest._zod.run({value:g,issues:[]},i);w instanceof Promise?o.push(w.then(_=>b$(_,n,m))):b$(w,n,m)}}return o.length?Promise.all(o).then(()=>_$(d,n,r,a,u)):_$(d,n,r,a,u)}});function w$(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function b$(t,e,r){t.issues.length&&e.issues.push(...xi(r,t.issues)),e.value[r]=t.value}function _$(t,e,r,n,i){for(let a=0;a<r.length;a++){let o=t[a],s=a<n.length;if(o.issues.length){if(!s&&a>=i){e.value.length=a;break}e.issues.push(...xi(a,o.issues))}e.value[a]=o.value}for(let a=e.value.length-1;a>=n.length&&(r[a]._zod.optout==="optional"&&e.value[a]===void 0);a--)e.value.length=a;return e}var TA=I("$ZodRecord",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!fs(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let a=[],o=e.keyType._zod.values;if(o){r.value={};let s=new Set;for(let d of o)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){s.add(typeof d=="number"?d.toString():d);let m=e.keyType._zod.run({value:d,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(w=>Qr(w,n,jt())),input:d,path:[d],inst:t});continue}let x=m.value,g=e.valueType._zod.run({value:i[d],issues:[]},n);g instanceof Promise?a.push(g.then(w=>{w.issues.length&&r.issues.push(...xi(d,w.issues)),r.value[x]=w.value})):(g.issues.length&&r.issues.push(...xi(d,g.issues)),r.value[x]=g.value)}let u;for(let d in i)s.has(d)||(u=u??[],u.push(d));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:u})}else{r.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let u=e.keyType._zod.run({value:s,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&py.test(s)&&u.issues.length){let x=e.keyType._zod.run({value:Number(s),issues:[]},n);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(u=x)}if(u.issues.length){e.mode==="loose"?r.value[s]=i[s]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(x=>Qr(x,n,jt())),input:s,path:[s],inst:t});continue}let m=e.valueType._zod.run({value:i[s],issues:[]},n);m instanceof Promise?a.push(m.then(x=>{x.issues.length&&r.issues.push(...xi(s,x.issues)),r.value[u.value]=x.value})):(m.issues.length&&r.issues.push(...xi(s,m.issues)),r.value[u.value]=m.value)}}return a.length?Promise.all(a).then(()=>r):r}}),DA=I("$ZodMap",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:t}),r;let a=[];r.value=new Map;for(let[o,s]of i){let u=e.keyType._zod.run({value:o,issues:[]},n),d=e.valueType._zod.run({value:s,issues:[]},n);u instanceof Promise||d instanceof Promise?a.push(Promise.all([u,d]).then(([m,x])=>{A$(m,x,r,o,i,t,n)})):A$(u,d,r,o,i,t,n)}return a.length?Promise.all(a).then(()=>r):r}});function A$(t,e,r,n,i,a,o){t.issues.length&&(pm.has(typeof n)?r.issues.push(...xi(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:t.issues.map(s=>Qr(s,o,jt()))})),e.issues.length&&(pm.has(typeof n)?r.issues.push(...xi(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:n,issues:e.issues.map(s=>Qr(s,o,jt()))})),r.value.set(t.value,e.value)}var RA=I("$ZodSet",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:t,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let o of i){let s=e.valueType._zod.run({value:o,issues:[]},n);s instanceof Promise?a.push(s.then(u=>F$(u,r))):F$(s,r)}return a.length?Promise.all(a).then(()=>r):r}});function F$(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var CA=I("$ZodEnum",(t,e)=>{$e.init(t,e);let r=cm(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>pm.has(typeof i)).map(i=>typeof i=="string"?bn(i):i.toString()).join("|")})$`),t._zod.parse=(i,a)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:r,input:o,inst:t}),i}}),zA=I("$ZodLiteral",(t,e)=>{if($e.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?bn(n):n?bn(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),n}}),OA=I("$ZodFile",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),VA=I("$ZodTransform",(t,e)=>{$e.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new cs(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(r.value=o,r.fallback=!0,r));if(i instanceof Promise)throw new qn;return r.value=i,r.fallback=!0,r}});function E$(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var _y=I("$ZodOptional",(t,e)=>{$e.init(t,e),t._zod.optin="optional",t._zod.optout="optional",We(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),We(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dm(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=r.value,a=e.innerType._zod.run(r,n);return a instanceof Promise?a.then(o=>E$(o,i)):E$(a,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),UA=I("$ZodExactOptional",(t,e)=>{_y.init(t,e),We(t._zod,"values",()=>e.innerType._zod.values),We(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),jA=I("$ZodNullable",(t,e)=>{$e.init(t,e),We(t._zod,"optin",()=>e.innerType._zod.optin),We(t._zod,"optout",()=>e.innerType._zod.optout),We(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dm(r.source)}|null)$`):void 0}),We(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),KA=I("$ZodDefault",(t,e)=>{$e.init(t,e),t._zod.optin="optional",We(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>S$(a,e)):S$(i,e)}});function S$(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var WA=I("$ZodPrefault",(t,e)=>{$e.init(t,e),t._zod.optin="optional",We(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),LA=I("$ZodNonOptional",(t,e)=>{$e.init(t,e),We(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>P$(a,t)):P$(i,t)}});function P$(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var ZA=I("$ZodSuccess",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new cs("ZodSuccess");let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),GA=I("$ZodCatch",(t,e)=>{$e.init(t,e),t._zod.optin="optional",We(t._zod,"optout",()=>e.innerType._zod.optout),We(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=e.catchValue({...r,error:{issues:a.issues.map(o=>Qr(o,n,jt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(a=>Qr(a,n,jt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),HA=I("$ZodNaN",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Ay=I("$ZodPipe",(t,e)=>{$e.init(t,e),We(t._zod,"values",()=>e.in._zod.values),We(t._zod,"optin",()=>e.in._zod.optin),We(t._zod,"optout",()=>e.out._zod.optout),We(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(o=>hy(o,e.in,n)):hy(a,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>hy(a,e.out,n)):hy(i,e.out,n)}});function hy(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var Am=I("$ZodCodec",(t,e)=>{$e.init(t,e),We(t._zod,"values",()=>e.in._zod.values),We(t._zod,"optin",()=>e.in._zod.optin),We(t._zod,"optout",()=>e.out._zod.optout),We(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let a=e.in._zod.run(r,n);return a instanceof Promise?a.then(o=>gy(o,e,n)):gy(a,e,n)}else{let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(o=>gy(o,e,n)):gy(a,e,n)}}});function gy(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let i=e.transform(t.value,t);return i instanceof Promise?i.then(a=>vy(t,a,e.out,r)):vy(t,i,e.out,r)}else{let i=e.reverseTransform(t.value,t);return i instanceof Promise?i.then(a=>vy(t,a,e.in,r)):vy(t,i,e.in,r)}}function vy(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}var qA=I("$ZodPreprocess",(t,e)=>{Ay.init(t,e)}),JA=I("$ZodReadonly",(t,e)=>{$e.init(t,e),We(t._zod,"propValues",()=>e.innerType._zod.propValues),We(t._zod,"values",()=>e.innerType._zod.values),We(t._zod,"optin",()=>e.innerType?._zod?.optin),We(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then($$):$$(i)}});function $$(t){return t.value=Object.freeze(t.value),t}var XA=I("$ZodTemplateLiteral",(t,e)=>{$e.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let a=i.startsWith("^")?1:0,o=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(a,o))}else if(n===null||K_.has(typeof n))r.push(bn(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),YA=I("$ZodFunction",(t,e)=>($e.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=t._def.input?ty(t._def.input,n):n,a=Reflect.apply(r,this,i);return t._def.output?ty(t._def.output,a):a}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await ry(t._def.input,n):n,a=await Reflect.apply(r,this,i);return t._def.output?await ry(t._def.output,a):a}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new by({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),QA=I("$ZodPromise",(t,e)=>{$e.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),e1=I("$ZodLazy",(t,e)=>{$e.init(t,e),We(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),We(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),We(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),We(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),We(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),t1=I("$ZodCustom",(t,e)=>{mt.init(t,e),$e.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(a=>k$(a,r,n,t));k$(i,r,n,t)}});function k$(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(sd(i))}}var Em={};Ta(Em,{ar:()=>D$,az:()=>R$,be:()=>z$,bg:()=>O$,ca:()=>V$,cs:()=>U$,da:()=>j$,de:()=>K$,el:()=>W$,en:()=>Fy,eo:()=>L$,es:()=>Z$,fa:()=>G$,fi:()=>H$,fr:()=>q$,frCA:()=>J$,he:()=>X$,hr:()=>Y$,hu:()=>Q$,hy:()=>tk,id:()=>rk,is:()=>ik,it:()=>nk,ja:()=>ak,ka:()=>ok,kh:()=>sk,km:()=>Ey,ko:()=>lk,lt:()=>ck,mk:()=>dk,ms:()=>pk,nl:()=>fk,no:()=>mk,ota:()=>hk,pl:()=>vk,ps:()=>gk,pt:()=>xk,ro:()=>yk,ru:()=>bk,sl:()=>_k,sv:()=>Ak,ta:()=>Fk,th:()=>Ek,tr:()=>Sk,ua:()=>Pk,uk:()=>Sy,ur:()=>$k,uz:()=>kk,vi:()=>Mk,yo:()=>Bk,zhCN:()=>Nk,zhTW:()=>Ik});var cD=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${a}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Z(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()} ${o.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:a.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${a.suffix}"`:a.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${a.includes}"`:a.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${a.pattern}`:`${r[a.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${z(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 D$(){return{localeError:cD()}}var dD=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${a}, daxil olan ${s}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Z(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()} ${o.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:a.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`:a.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`:a.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[a.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${z(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 R$(){return{localeError:dD()}}function C$(t,e,r,n){let i=Math.abs(t),a=i%10,o=i%100;return o>=11&&o<=19?n:a===1?e:a>=2&&a<=4?r:n}var pD=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${a}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Z(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),u=C$(s,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${a}${i.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),u=C$(s,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${a}${i.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${z(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 z$(){return{localeError:pD()}}var fD=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${Z(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;if(a.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${a.prefix}"`;if(a.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${a.suffix}"`;if(a.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${a.includes}"`;if(a.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${a.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return a.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),a.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${z(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 O$(){return{localeError:fD()}}var mD=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${a}, s'ha rebut ${s}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${Z(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${z(i.values," o ")}`;case"too_big":{let a=i.inclusive?"com a m\xE0xim":"menys de",o=e(i.origin);return o?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${a} ${i.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"com a m\xEDnim":"m\xE9s de",o=e(i.origin);return o?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${a} ${i.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`:a.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format inv\xE0lid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`:`Format inv\xE0lid per a ${r[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${z(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 V$(){return{localeError:mD()}}var hD=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(i){return t[i]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${a}, obdr\u017Eeno ${s}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Z(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.maximum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.minimum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`:a.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`:a.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`:a.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`:`Neplatn\xFD form\xE1t ${r[a.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${z(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 U$(){return{localeError:hD()}}var gD=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${s}`:`Ugyldigt input: forventede ${a}, fik ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${Z(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`For stor: forventede ${s??"value"} ${o.verb} ${a} ${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`For lille: forventede ${s} ${o.verb} ${a} ${i.minimum.toString()} ${o.unit}`:`For lille: forventede ${s} havde ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${z(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}};function j$(){return{localeError:gD()}}var vD=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(i){return t[i]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${a}, erhalten ${s}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Z(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ist`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ist`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ung\xFCltiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ung\xFCltiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`:`Ung\xFCltig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${z(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 K$(){return{localeError:vD()}}var xD=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(i){return t[i]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return typeof i.expected=="string"&&/^[A-Z]/.test(i.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${i.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${a}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return i.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${Z(i.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${i.maximum.toString()} ${o.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${i.minimum.toString()} ${o.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${a.prefix}"`:a.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${a.suffix}"`:a.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${a.includes}"`:a.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${a.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[a.format]??i.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${i.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${i.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${i.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${z(i.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${i.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${i.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function W$(){return{localeError:xD()}}var yD=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return`Invalid input: expected ${a}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Z(i.values[0])}`:`Invalid option: expected one of ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${z(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(o=>`'${o}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Fy(){return{localeError:yD()}}var wD=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return t[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${a}, ricevi\u011Dis ${s}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${Z(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${a}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${a.prefix}"`:a.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${a.suffix}"`:a.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${a.includes}"`:a.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`:`Nevalida ${r[a.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${z(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 L$(){return{localeError:wD()}}var bD=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${a}, recibido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${Z(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${a}${i.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${a}${i.minimum.toString()} ${o.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${r[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${z(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function Z$(){return{localeError:bD()}}var _D=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${a} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Z(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${z(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${o.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:a.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:a.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`:a.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[a.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${z(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 G$(){return{localeError:_D()}}var AD=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(i){return t[i]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${a}, oli ${s}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Z(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Liian suuri: ${o.subject} t\xE4ytyy olla ${a}${i.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Liian pieni: ${o.subject} t\xE4ytyy olla ${a}${i.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`:a.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`:`Virheellinen ${r[a.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${z(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 H$(){return{localeError:AD()}}var FD=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${a} attendu, ${s} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${Z(i.values[0])} attendu`:`Option invalide : une valeur parmi ${z(i.values,"|")} attendue`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Trop grand : ${n[i.origin]??"valeur"} doit ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[i.origin]??"valeur"} doit \xEAtre ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Trop petit : ${n[i.origin]??"valeur"} doit ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Trop petit : ${n[i.origin]??"valeur"} doit \xEAtre ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${z(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 q$(){return{localeError:FD()}}var ED=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${a}, re\xE7u ${s}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${Z(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u2264":"<",o=e(i.origin);return o?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${a}${i.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u2265":">",o=e(i.origin);return o?`Trop petit : attendu que ${i.origin} ait ${a}${i.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${i.origin} soit ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${z(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 J$(){return{localeError:ED()}}var SD=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=d=>d?t[d]:void 0,n=d=>{let m=r(d);return m?m.label:d??t.unknown.label},i=d=>`\u05D4${n(d)}`,a=d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",o=d=>d?e[d]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let m=d.expected,x=u[m??""]??n(m),g=G(d.input),w=u[g]??t[g]?.label??g;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${w}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${x}, \u05D4\u05EA\u05E7\u05D1\u05DC ${w}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${Z(d.values[0])}`;let m=d.values.map(w=>Z(w));if(d.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 ${m[0]} \u05D0\u05D5 ${m[1]}`;let x=m[m.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 ${m.slice(0,-1).join(", ")} \u05D0\u05D5 ${x}`}case"too_big":{let m=o(d.origin),x=i(d.origin??"value");if(d.origin==="string")return`${m?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${m?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let _=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(d.origin==="array"||d.origin==="set"){let _=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",N=d.inclusive?`${d.maximum} ${m?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${m?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${x} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${N}`.trim()}let g=d.inclusive?"<=":"<",w=a(d.origin??"value");return m?.unit?`${m.longLabel} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.maximum.toString()} ${m.unit}`:`${m?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.maximum.toString()}`}case"too_small":{let m=o(d.origin),x=i(d.origin??"value");if(d.origin==="string")return`${m?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${m?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let _=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(d.origin==="array"||d.origin==="set"){let _=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let j=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${x} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${j}`}let N=d.inclusive?`${d.minimum} ${m?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${m?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${x} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${N}`.trim()}let g=d.inclusive?">=":">",w=a(d.origin??"value");return m?.unit?`${m.shortLabel} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.minimum.toString()} ${m.unit}`:`${m?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.minimum.toString()}`}case"invalid_format":{let m=d;if(m.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${m.prefix}"`;if(m.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${m.suffix}"`;if(m.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${m.includes}"`;if(m.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 ${m.pattern}`;let x=s[m.format],g=x?.label??m.format,_=(x?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${g} \u05DC\u05D0 ${_}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${z(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function X$(){return{localeError:SD()}}var PD=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(i){return t[i]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${i.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${a}, a primljeno je ${s}`}case"invalid_value":return i.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${Z(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${a}${i.maximum.toString()} ${o.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Premalo: o\u010Dekivano da ${s} ima ${a}${i.minimum.toString()} ${o.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${a.prefix}"`:a.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${a.suffix}"`:a.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${a.includes}"`:a.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${a.pattern}`:`Neispravna ${r[a.format]??i.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${z(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[i.origin]??i.origin}`;default:return"Neispravan unos"}}};function Y$(){return{localeError:PD()}}var $D=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return t[i]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${a}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Z(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${a}${i.maximum.toString()} ${o.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${a}${i.minimum.toString()} ${o.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:a.format==="ends_with"?`\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:a.format==="includes"?`\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`:a.format==="regex"?`\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[a.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${z(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 Q$(){return{localeError:$D()}}function ek(t,e,r){return Math.abs(t)===1?e:r}function fd(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var kD=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(i){return t[i]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${a}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${Z(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),u=ek(s,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${fd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${fd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),u=ek(s,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${fd(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${fd(i.origin)} \u056C\u056B\u0576\u056B ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${a.prefix}"-\u0578\u057E`:a.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${a.suffix}"-\u0578\u057E`:a.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${a.includes}"`:a.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${a.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[a.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${z(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${fd(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${fd(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function tk(){return{localeError:kD()}}var MD=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${a}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${Z(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${a}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: diharapkan ${i.origin} memiliki ${a}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${r[a.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${z(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 rk(){return{localeError:MD()}}var ND=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return t[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${a}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${Z(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${a}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${a}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${a.prefix}"`:a.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${a.suffix}"`:a.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${a.includes}"`:a.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${a.pattern}`:`Rangt ${r[a.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${z(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 ik(){return{localeError:ND()}}var ID=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return t[i]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${s}`:`Input non valido: atteso ${a}, ricevuto ${s}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${Z(i.values[0])}`:`Opzione non valida: atteso uno tra ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Troppo grande: ${i.origin??"valore"} deve avere ${a}${i.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Troppo piccolo: ${i.origin} deve avere ${a}${i.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${i.origin} deve essere ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Input non valido: ${r[a.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${z(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 nk(){return{localeError:ID()}}var BD=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(i){return t[i]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${a}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Z(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${z(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let a=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",o=e(i.origin);return o?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o.unit??"\u8981\u7D20"}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let a=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",o=e(i.origin);return o?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o.unit}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${z(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 ak(){return{localeError:BD()}}var TD=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return t[i]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${a}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${Z(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${z(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.prefix}"-\u10D8\u10D7`:a.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.suffix}"-\u10D8\u10D7`:a.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${a.includes}"-\u10E1`:a.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${a.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${z(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 ok(){return{localeError:TD()}}var DD=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(i){return t[i]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${a} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Z(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()} ${o.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()} ${o.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${a.prefix}"`:a.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${a.suffix}"`:a.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${a.includes}"`:a.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${a.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${z(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 Ey(){return{localeError:DD()}}function sk(){return Ey()}var RD=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${a}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Z(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${z(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let a=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",o=a==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),u=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${u} ${a}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${a}${o}`}case"too_small":{let a=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",o=a==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),u=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${u} ${a}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${a}${o}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:a.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[a.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${z(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 lk(){return{localeError:RD()}}var Fm=t=>t.charAt(0).toUpperCase()+t.slice(1);function uk(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}var CD=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,a,o,s){let u=t[i]??null;return u===null?u:{unit:u.unit[a],verb:u.verb[s][o?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${a}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${Z(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${z(i.values,"|")} pasirinkim\u0173`;case"too_big":{let a=n[i.origin]??i.origin,o=e(i.origin,uk(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${Fm(a??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let s=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Fm(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let a=n[i.origin]??i.origin,o=e(i.origin,uk(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${Fm(a??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let s=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Fm(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${a.prefix}"`:a.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${a.suffix}"`:a.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${a.includes}"`:a.format==="regex"?`Eilut\u0117 privalo atitikti ${a.pattern}`:`Neteisingas ${r[a.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${z(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let a=n[i.origin]??i.origin;return`${Fm(a??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function ck(){return{localeError:CD()}}var zD=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(i){return t[i]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${a}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Z(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.minimum.toString()} ${o.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${z(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 dk(){return{localeError:zD()}}var OD=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${s}`:`Input tidak sah: dijangka ${a}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${Z(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: dijangka ${i.origin??"nilai"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: dijangka ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${r[a.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${z(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 pk(){return{localeError:OD()}}var VD=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(i){return t[i]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${a}, ontving ${s}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${Z(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return o?`Te ${s}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${s}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} is`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return o?`Te ${s}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${s}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} is`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${z(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function fk(){return{localeError:VD()}}var UD=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${s}`:`Ugyldig input: forventet ${a}, fikk ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${Z(i.values[0])}`:`Ugyldig valg: forventet en av ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${z(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 mk(){return{localeError:UD()}}var jD=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${a}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${Z(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} ${o.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} ${o.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let a=i;return a.format==="starts_with"?`F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`:a.format==="ends_with"?`F\xE2sit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`:a.format==="regex"?`F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[a.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${z(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 hk(){return{localeError:jD()}}var KD=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${a} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Z(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${z(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${o.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:a.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:a.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`:a.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[a.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${z(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 gk(){return{localeError:KD()}}var WD=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(i){return t[i]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${a}, otrzymano ${s}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Z(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.maximum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.minimum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`:a.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`:a.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`:a.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[a.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${z(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 vk(){return{localeError:WD()}}var LD=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return t[i]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${a}, recebido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${Z(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${a}${i.maximum.toString()} ${o.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Muito pequeno: esperado que ${i.origin} tivesse ${a}${i.minimum.toString()} ${o.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`${r[a.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${z(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 xk(){return{localeError:LD()}}var ZD=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(i){return t[i]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return`Intrare invalid\u0103: a\u0219teptat ${a}, primit ${s}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${Z(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} s\u0103 fie ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Prea mic: a\u0219teptat ca ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Prea mic: a\u0219teptat ca ${i.origin} s\u0103 fie ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${a.prefix}"`:a.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${a.suffix}"`:a.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${a.includes}"`:a.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${a.pattern}`:`Format invalid: ${r[a.format]??i.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${z(i.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${i.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${i.origin}`;default:return"Intrare invalid\u0103"}}};function yk(){return{localeError:ZD()}}function wk(t,e,r,n){let i=Math.abs(t),a=i%10,o=i%100;return o>=11&&o<=19?n:a===1?e:a>=2&&a<=4?r:n}var GD=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Z(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),u=wk(s,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),u=wk(s,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${z(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function bk(){return{localeError:GD()}}var HD=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return t[i]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${a}, prejeto ${s}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Z(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${a}${i.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${a}${i.minimum.toString()} ${o.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${r[a.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${z(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 _k(){return{localeError:HD()}}var qD=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(i){return t[i]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${a}, fick ${s}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Z(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()} ${o.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()} ${o.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`:a.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`:`Ogiltig(t) ${r[a.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${z(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 Ak(){return{localeError:qD()}}var JD=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(i){return t[i]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Z(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} ${o.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} ${o.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${z(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 Fk(){return{localeError:JD()}}var XD=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(i){return t[i]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${a} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Z(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()} ${o.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()} ${o.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${a.prefix}"`:a.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${a.suffix}"`:a.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:a.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${a.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${z(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 Ek(){return{localeError:XD()}}var YD=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${a}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Z(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ge\xE7ersiz metin: "${a.prefix}" ile ba\u015Flamal\u0131`:a.format==="ends_with"?`Ge\xE7ersiz metin: "${a.suffix}" ile bitmeli`:a.format==="includes"?`Ge\xE7ersiz metin: "${a.includes}" i\xE7ermeli`:a.format==="regex"?`Ge\xE7ersiz metin: ${a.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[a.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${z(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 Sk(){return{localeError:YD()}}var QD=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${a}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Z(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${z(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 Sy(){return{localeError:QD()}}function Pk(){return Sy()}var eR=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(i){return t[i]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${a} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Z(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${z(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${a}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${a}${i.minimum.toString()} ${o.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${a}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${z(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 $k(){return{localeError:eR()}}var tR=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(i){return t[i]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${a}, qabul qilingan ${s}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${Z(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${a.prefix}" bilan boshlanishi kerak`:a.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${a.suffix}" bilan tugashi kerak`:a.format==="includes"?`Noto\u2018g\u2018ri satr: "${a.includes}" ni o\u2018z ichiga olishi kerak`:a.format==="regex"?`Noto\u2018g\u2018ri satr: ${a.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[a.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${z(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function kk(){return{localeError:tR()}}var rR=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(i){return t[i]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${a}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Z(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`:a.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`:a.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`:a.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`:`${r[a.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${z(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 Mk(){return{localeError:rR()}}var iR=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(i){return t[i]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${a}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Z(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()} ${o.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`:a.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`:a.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`:`\u65E0\u6548${r[a.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${z(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 Nk(){return{localeError:iR()}}var nR=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(i){return t[i]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${a}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Z(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()} ${o.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()} ${o.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`:a.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`:a.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`:`\u7121\u6548\u7684 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${z(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 Ik(){return{localeError:nR()}}var aR=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(i){return t[i]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${a}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${Z(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${z(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${o.verb} ${a}${i.maximum} ${o.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.maximum}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${o.verb} ${a}${i.minimum} ${o.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.minimum}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${a.prefix}"`:a.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${a.suffix}"`:a.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${a.includes}"`:a.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${a.pattern}`:`A\u1E63\xEC\u1E63e: ${r[a.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${z(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 Bk(){return{localeError:aR()}}var Tk,r1=Symbol("ZodOutput"),i1=Symbol("ZodInput"),Py=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function $y(){return new Py}(Tk=globalThis).__zod_globalRegistry??(Tk.__zod_globalRegistry=$y());var kr=globalThis.__zod_globalRegistry;function n1(t,e){return new t({type:"string",...X(e)})}function a1(t,e){return new t({type:"string",coerce:!0,...X(e)})}function ky(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...X(e)})}function Sm(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...X(e)})}function My(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...X(e)})}function Ny(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...X(e)})}function Iy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...X(e)})}function By(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...X(e)})}function Pm(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...X(e)})}function Ty(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...X(e)})}function Dy(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...X(e)})}function Ry(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...X(e)})}function Cy(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...X(e)})}function zy(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...X(e)})}function Oy(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...X(e)})}function Vy(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...X(e)})}function Uy(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...X(e)})}function jy(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...X(e)})}function o1(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...X(e)})}function Ky(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...X(e)})}function Wy(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...X(e)})}function Ly(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...X(e)})}function Zy(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...X(e)})}function Gy(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...X(e)})}function Hy(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...X(e)})}var s1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function l1(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...X(e)})}function u1(t,e){return new t({type:"string",format:"date",check:"string_format",...X(e)})}function c1(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...X(e)})}function d1(t,e){return new t({type:"string",format:"duration",check:"string_format",...X(e)})}function p1(t,e){return new t({type:"number",checks:[],...X(e)})}function f1(t,e){return new t({type:"number",coerce:!0,checks:[],...X(e)})}function m1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...X(e)})}function h1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...X(e)})}function g1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...X(e)})}function v1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...X(e)})}function x1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...X(e)})}function y1(t,e){return new t({type:"boolean",...X(e)})}function w1(t,e){return new t({type:"boolean",coerce:!0,...X(e)})}function b1(t,e){return new t({type:"bigint",...X(e)})}function _1(t,e){return new t({type:"bigint",coerce:!0,...X(e)})}function A1(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...X(e)})}function F1(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...X(e)})}function E1(t,e){return new t({type:"symbol",...X(e)})}function S1(t,e){return new t({type:"undefined",...X(e)})}function P1(t,e){return new t({type:"null",...X(e)})}function $1(t){return new t({type:"any"})}function k1(t){return new t({type:"unknown"})}function M1(t,e){return new t({type:"never",...X(e)})}function N1(t,e){return new t({type:"void",...X(e)})}function I1(t,e){return new t({type:"date",...X(e)})}function B1(t,e){return new t({type:"date",coerce:!0,...X(e)})}function T1(t,e){return new t({type:"nan",...X(e)})}function ka(t,e){return new fy({check:"less_than",...X(e),value:t,inclusive:!1})}function ji(t,e){return new fy({check:"less_than",...X(e),value:t,inclusive:!0})}function Ma(t,e){return new my({check:"greater_than",...X(e),value:t,inclusive:!1})}function ei(t,e){return new my({check:"greater_than",...X(e),value:t,inclusive:!0})}function qy(t){return Ma(0,t)}function Jy(t){return ka(0,t)}function Xy(t){return ji(0,t)}function Yy(t){return ei(0,t)}function hs(t,e){return new P0({check:"multiple_of",...X(e),value:t})}function gs(t,e){return new M0({check:"max_size",...X(e),maximum:t})}function Na(t,e){return new N0({check:"min_size",...X(e),minimum:t})}function ql(t,e){return new I0({check:"size_equals",...X(e),size:t})}function Jl(t,e){return new B0({check:"max_length",...X(e),maximum:t})}function lo(t,e){return new T0({check:"min_length",...X(e),minimum:t})}function Xl(t,e){return new D0({check:"length_equals",...X(e),length:t})}function md(t,e){return new R0({check:"string_format",format:"regex",...X(e),pattern:t})}function hd(t){return new C0({check:"string_format",format:"lowercase",...X(t)})}function gd(t){return new z0({check:"string_format",format:"uppercase",...X(t)})}function vd(t,e){return new O0({check:"string_format",format:"includes",...X(e),includes:t})}function xd(t,e){return new V0({check:"string_format",format:"starts_with",...X(e),prefix:t})}function yd(t,e){return new U0({check:"string_format",format:"ends_with",...X(e),suffix:t})}function Qy(t,e,r){return new j0({check:"property",property:t,schema:e,...X(r)})}function wd(t,e){return new K0({check:"mime_type",mime:t,...X(e)})}function Jn(t){return new W0({check:"overwrite",tx:t})}function bd(t){return Jn(e=>e.normalize(t))}function _d(){return Jn(t=>t.trim())}function Ad(){return Jn(t=>t.toLowerCase())}function Fd(){return Jn(t=>t.toUpperCase())}function Ed(){return Jn(t=>V_(t))}function D1(t,e,r){return new t({type:"array",element:e,...X(r)})}function sR(t,e,r){return new t({type:"union",options:e,...X(r)})}function lR(t,e,r){return new t({type:"union",options:e,inclusive:!1,...X(r)})}function uR(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...X(n)})}function cR(t,e,r){return new t({type:"intersection",left:e,right:r})}function dR(t,e,r,n){let i=r instanceof $e,a=i?n:r,o=i?r:null;return new t({type:"tuple",items:e,rest:o,...X(a)})}function pR(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...X(n)})}function fR(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...X(n)})}function mR(t,e,r){return new t({type:"set",valueType:e,...X(r)})}function hR(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new t({type:"enum",entries:n,...X(r)})}function gR(t,e,r){return new t({type:"enum",entries:e,...X(r)})}function vR(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...X(r)})}function R1(t,e){return new t({type:"file",...X(e)})}function xR(t,e){return new t({type:"transform",transform:e})}function yR(t,e){return new t({type:"optional",innerType:e})}function wR(t,e){return new t({type:"nullable",innerType:e})}function bR(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():j_(r)}})}function _R(t,e,r){return new t({type:"nonoptional",innerType:e,...X(r)})}function AR(t,e){return new t({type:"success",innerType:e})}function FR(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function ER(t,e,r){return new t({type:"pipe",in:e,out:r})}function SR(t,e){return new t({type:"readonly",innerType:e})}function PR(t,e,r){return new t({type:"template_literal",parts:e,...X(r)})}function $R(t,e){return new t({type:"lazy",getter:e})}function kR(t,e){return new t({type:"promise",innerType:e})}function C1(t,e,r){let n=X(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function z1(t,e,r){return new t({type:"custom",check:"custom",fn:e,...X(r)})}function O1(t,e){let r=Dk(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(sd(i,n.value,r._zod.def));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(sd(a))}},t(n.value,n)),e);return r}function Dk(t,e){let r=new mt({check:"custom",...X(e)});return r._zod.check=t,r}function V1(t){let e=new mt({check:"describe"});return e._zod.onattach=[r=>{let n=kr.get(r)??{};kr.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function U1(t){let e=new mt({check:"meta"});return e._zod.onattach=[r=>{let n=kr.get(r)??{};kr.add(r,{...n,...t})}],e._zod.check=()=>{},e}function j1(t,e){let r=X(e),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(w=>typeof w=="string"?w.toLowerCase():w),i=i.map(w=>typeof w=="string"?w.toLowerCase():w));let a=new Set(n),o=new Set(i),s=t.Codec??Am,u=t.Boolean??bm,d=t.String??Hl,m=new d({type:"string",error:r.error}),x=new u({type:"boolean",error:r.error}),g=new s({type:"pipe",in:m,out:x,transform:((w,_)=>{let N=w;return r.case!=="sensitive"&&(N=N.toLowerCase()),a.has(N)?!0:o.has(N)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...o],input:_.value,inst:g,continue:!1}),{})}),reverseTransform:((w,_)=>w===!0?n[0]||"true":i[0]||"false"),error:r.error});return g}function Sd(t,e,r,n={}){let i=X(n),a={...X(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...i};return r instanceof RegExp&&(a.pattern=r),new t(a)}function vs(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??kr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function lt(t,e,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,a=e.seen.get(t);if(a)return a.count++,r.schemaPath.includes(t)&&(a.cycle=r.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,o);let s=t._zod.toJSONSchema?.();if(s)o.schema=s;else{let m={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,m);else{let g=o.schema,w=e.processors[i.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);w(t,e,g,m)}let x=t._zod.parent;x&&(o.ref||(o.ref=x),lt(x,e,m),e.seen.get(x).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(o.schema,u),e.io==="input"&&ti(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function xs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let o of t.seen.entries()){let s=t.metadataRegistry.get(o[0])?.id;if(s){let u=n.get(s);if(u&&u!==o[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,o[0])}}let i=o=>{let s=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let x=t.external.registry.get(o[0])?.id,g=t.external.uri??(_=>_);if(x)return{ref:g(x)};let w=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=w,{defId:w,ref:`${g("__shared")}#/${s}/${w}`}}if(o[1]===r)return{ref:"#"};let d=`#/${s}/`,m=o[1].schema.id??`__schema${t.counter++}`;return{defId:m,ref:d+m}},a=o=>{if(o[1].schema.$ref)return;let s=o[1],{ref:u,defId:d}=i(o);s.def={...s.schema},d&&(s.defId=d);let m=s.schema;for(let x in m)delete m[x];m.$ref=u};if(t.cycles==="throw")for(let o of t.seen.entries()){let s=o[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
80
|
+
|
|
81
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let s=o[1];if(e===o[0]){a(o);continue}if(t.external){let d=t.external.registry.get(o[0])?.id;if(e!==o[0]&&d){a(o);continue}}if(t.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&t.reused==="ref"){a(o);continue}}}function ys(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let u=t.seen.get(s);if(u.ref===null)return;let d=u.def??u.schema,m={...d},x=u.ref;if(u.ref=null,x){n(x);let w=t.seen.get(x),_=w.schema;if(_.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(_)):Object.assign(d,_),Object.assign(d,m),s._zod.parent===x)for(let j in d)j==="$ref"||j==="allOf"||j in m||delete d[j];if(_.$ref&&w.def)for(let j in d)j==="$ref"||j==="allOf"||j in w.def&&JSON.stringify(d[j])===JSON.stringify(w.def[j])&&delete d[j]}let g=s._zod.parent;if(g&&g!==x){n(g);let w=t.seen.get(g);if(w?.schema.$ref&&(d.$ref=w.schema.$ref,w.def))for(let _ in d)_==="$ref"||_==="allOf"||_ in w.def&&JSON.stringify(d[_])===JSON.stringify(w.def[_])&&delete d[_]}t.override({zodSchema:s,jsonSchema:d,path:u.path??[]})};for(let s of[...t.seen.entries()].reverse())n(s[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(s)}Object.assign(i,r.def??r.schema);let a=t.metadataRegistry.get(e)?.id;a!==void 0&&i.id===a&&delete i.id;let o=t.external?.defs??{};for(let s of t.seen.entries()){let u=s[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,o[u.defId]=u.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Pd(e,"input",t.processors),output:Pd(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ti(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return ti(n.element,r);if(n.type==="set")return ti(n.valueType,r);if(n.type==="lazy")return ti(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return ti(n.innerType,r);if(n.type==="intersection")return ti(n.left,r)||ti(n.right,r);if(n.type==="record"||n.type==="map")return ti(n.keyType,r)||ti(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:ti(n.in,r)||ti(n.out,r);if(n.type==="object"){for(let i in n.shape)if(ti(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(ti(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(ti(i,r))return!0;return!!(n.rest&&ti(n.rest,r))}return!1}var K1=(t,e={})=>r=>{let n=vs({...r,processors:e});return lt(t,n),xs(n,t),ys(n,t)},Pd=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=vs({...i??{},target:a,io:e,processors:r});return lt(t,o),xs(o,t),ys(o,t)};var MR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},W1=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:o,format:s,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),s&&(i.format=MR[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),d&&(i.contentEncoding=d),u&&u.size>0){let m=[...u];m.length===1?i.pattern=m[0].source:m.length>1&&(i.allOf=[...m.map(x=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},L1=(t,e,r,n)=>{let i=r,{minimum:a,maximum:o,format:s,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:m}=t._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number";let x=typeof m=="number"&&m>=(a??Number.NEGATIVE_INFINITY),g=typeof d=="number"&&d<=(o??Number.POSITIVE_INFINITY),w=e.target==="draft-04"||e.target==="openapi-3.0";x?w?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m:typeof a=="number"&&(i.minimum=a),g?w?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d:typeof o=="number"&&(i.maximum=o),typeof u=="number"&&(i.multipleOf=u)},Z1=(t,e,r,n)=>{r.type="boolean"},G1=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},H1=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},q1=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},J1=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},X1=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Y1=(t,e,r,n)=>{r.not={}},Q1=(t,e,r,n)=>{},eF=(t,e,r,n)=>{},tF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},rF=(t,e,r,n)=>{let i=t._zod.def,a=cm(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},iF=(t,e,r,n)=>{let i=t._zod.def,a=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},nF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},aF=(t,e,r,n)=>{let i=r,a=t._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},oF=(t,e,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:u}=t._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),u?u.length===1?(a.contentMediaType=u[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(i,a)},sF=(t,e,r,n)=>{r.type="boolean"},lF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},cF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},dF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},pF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},fF=(t,e,r,n)=>{let i=r,a=t._zod.def,{minimum:o,maximum:s}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=lt(a.element,e,{...n,path:[...n.path,"items"]})},mF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object",i.properties={};let o=a.shape;for(let d in o)i.properties[d]=lt(o[d],e,{...n,path:[...n.path,"properties",d]});let s=new Set(Object.keys(o)),u=new Set([...s].filter(d=>{let m=a.shape[d]._zod;return e.io==="input"?m.optin===void 0:m.optout===void 0}));u.size>0&&(i.required=Array.from(u)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=lt(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},tw=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,u)=>lt(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",u]}));a?r.oneOf=o:r.anyOf=o},hF=(t,e,r,n)=>{let i=t._zod.def,a=lt(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=lt(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,u=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];r.allOf=u},gF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((g,w)=>lt(g,e,{...n,path:[...n.path,o,w]})),d=a.rest?lt(a.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[a.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=u,d&&(i.items=d)):e.target==="openapi-3.0"?(i.items={anyOf:u},d&&i.items.anyOf.push(d),i.minItems=u.length,d||(i.maxItems=u.length)):(i.items=u,d&&(i.additionalItems=d));let{minimum:m,maximum:x}=t._zod.bag;typeof m=="number"&&(i.minItems=m),typeof x=="number"&&(i.maxItems=x)},vF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object";let o=a.keyType,u=o._zod.bag?.patterns;if(a.mode==="loose"&&u&&u.size>0){let m=lt(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let x of u)i.patternProperties[x.source]=m}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=lt(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=lt(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let d=o._zod.values;if(d){let m=[...d].filter(x=>typeof x=="string"||typeof x=="number");m.length>0&&(i.required=m)}},xF=(t,e,r,n)=>{let i=t._zod.def,a=lt(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},yF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},wF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},bF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},_F=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},AF=(t,e,r,n)=>{let i=t._zod.def,a=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?a?i.out:i.in:i.out;lt(o,e,n);let s=e.seen.get(t);s.ref=o},FF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},EF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},rw=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},SF=(t,e,r,n)=>{let i=t._zod.innerType;lt(i,e,n);let a=e.seen.get(t);a.ref=i},ew={string:W1,number:L1,boolean:Z1,bigint:G1,symbol:H1,null:q1,undefined:J1,void:X1,never:Y1,any:Q1,unknown:eF,date:tF,enum:rF,literal:iF,nan:nF,template_literal:aF,file:oF,success:sF,custom:lF,function:uF,transform:cF,map:dF,set:pF,array:fF,object:mF,union:tw,intersection:hF,tuple:gF,record:vF,nullable:xF,nonoptional:yF,default:wF,prefault:bF,catch:_F,pipe:AF,readonly:FF,promise:EF,optional:rw,lazy:SF};function iw(t,e){if("_idmap"in t){let n=t,i=vs({...e,processors:ew}),a={};for(let u of n._idmap.entries()){let[d,m]=u;lt(m,i)}let o={},s={registry:n,uri:e?.uri,defs:a};i.external=s;for(let u of n._idmap.entries()){let[d,m]=u;xs(i,m),o[d]=ys(i,m)}if(Object.keys(a).length>0){let u=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[u]:a}}return{schemas:o}}let r=vs({...e,processors:ew});return lt(t,r),xs(r,t),ys(r,t)}var nw=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=vs({processors:ew,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return lt(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),xs(this.ctx,e);let n=ys(this.ctx,e),{"~standard":i,...a}=n;return a}};var Rk={};var $m={};Ta($m,{ZodAny:()=>JF,ZodArray:()=>eE,ZodBase64:()=>Ew,ZodBase64URL:()=>Sw,ZodBigInt:()=>Dd,ZodBigIntFormat:()=>kw,ZodBoolean:()=>Td,ZodCIDRv4:()=>Aw,ZodCIDRv6:()=>Fw,ZodCUID:()=>gw,ZodCUID2:()=>vw,ZodCatch:()=>_E,ZodCodec:()=>Vm,ZodCustom:()=>Um,ZodCustomStringFormat:()=>Id,ZodDate:()=>Dm,ZodDefault:()=>gE,ZodDiscriminatedUnion:()=>rE,ZodE164:()=>Pw,ZodEmail:()=>fw,ZodEmoji:()=>mw,ZodEnum:()=>Md,ZodExactOptional:()=>fE,ZodFile:()=>dE,ZodFunction:()=>IE,ZodGUID:()=>Mm,ZodIPv4:()=>bw,ZodIPv6:()=>_w,ZodIntersection:()=>iE,ZodJWT:()=>$w,ZodKSUID:()=>ww,ZodLazy:()=>kE,ZodLiteral:()=>cE,ZodMAC:()=>KF,ZodMap:()=>lE,ZodNaN:()=>FE,ZodNanoID:()=>hw,ZodNever:()=>YF,ZodNonOptional:()=>Dw,ZodNull:()=>HF,ZodNullable:()=>hE,ZodNumber:()=>Bd,ZodNumberFormat:()=>Ql,ZodObject:()=>Cm,ZodOptional:()=>Tw,ZodPipe:()=>Om,ZodPrefault:()=>xE,ZodPreprocess:()=>EE,ZodPromise:()=>NE,ZodReadonly:()=>SE,ZodRecord:()=>kd,ZodSet:()=>uE,ZodString:()=>Nd,ZodStringFormat:()=>pt,ZodSuccess:()=>bE,ZodSymbol:()=>ZF,ZodTemplateLiteral:()=>$E,ZodTransform:()=>pE,ZodTuple:()=>aE,ZodType:()=>Te,ZodULID:()=>xw,ZodURL:()=>Tm,ZodUUID:()=>Ia,ZodUndefined:()=>GF,ZodUnion:()=>zm,ZodUnknown:()=>XF,ZodVoid:()=>QF,ZodXID:()=>yw,ZodXor:()=>tE,_ZodString:()=>pw,_default:()=>vE,_function:()=>LM,any:()=>_M,array:()=>Rm,base64:()=>aM,base64url:()=>oM,bigint:()=>vM,boolean:()=>LF,catch:()=>AE,check:()=>ZM,cidrv4:()=>iM,cidrv6:()=>nM,codec:()=>UM,cuid:()=>qk,cuid2:()=>Jk,custom:()=>GM,date:()=>FM,describe:()=>HM,discriminatedUnion:()=>MM,e164:()=>sM,email:()=>Ok,emoji:()=>Gk,enum:()=>Iw,exactOptional:()=>mE,file:()=>CM,float32:()=>fM,float64:()=>mM,function:()=>LM,guid:()=>Vk,hash:()=>pM,hex:()=>dM,hostname:()=>cM,httpUrl:()=>Zk,instanceof:()=>JM,int:()=>cw,int32:()=>hM,int64:()=>xM,intersection:()=>nE,invertCodec:()=>jM,ipv4:()=>eM,ipv6:()=>rM,json:()=>YM,jwt:()=>lM,keyof:()=>EM,ksuid:()=>Qk,lazy:()=>ME,literal:()=>RM,looseObject:()=>$M,looseRecord:()=>IM,mac:()=>tM,map:()=>BM,meta:()=>qM,nan:()=>VM,nanoid:()=>Hk,nativeEnum:()=>DM,never:()=>Mw,nonoptional:()=>wE,null:()=>qF,nullable:()=>Im,nullish:()=>zM,number:()=>WF,object:()=>SM,optional:()=>Nm,partialRecord:()=>NM,pipe:()=>dw,prefault:()=>yE,preprocess:()=>QM,promise:()=>WM,readonly:()=>PE,record:()=>sE,refine:()=>BE,set:()=>TM,strictObject:()=>PM,string:()=>km,stringFormat:()=>uM,stringbool:()=>XM,success:()=>OM,superRefine:()=>TE,symbol:()=>wM,templateLiteral:()=>KM,transform:()=>Bw,tuple:()=>oE,uint32:()=>gM,uint64:()=>yM,ulid:()=>Xk,undefined:()=>bM,union:()=>Nw,unknown:()=>Yl,url:()=>Lk,uuid:()=>Uk,uuidv4:()=>jk,uuidv6:()=>Kk,uuidv7:()=>Wk,void:()=>AM,xid:()=>Yk,xor:()=>kM});var aw={};Ta(aw,{endsWith:()=>yd,gt:()=>Ma,gte:()=>ei,includes:()=>vd,length:()=>Xl,lowercase:()=>hd,lt:()=>ka,lte:()=>ji,maxLength:()=>Jl,maxSize:()=>gs,mime:()=>wd,minLength:()=>lo,minSize:()=>Na,multipleOf:()=>hs,negative:()=>Jy,nonnegative:()=>Yy,nonpositive:()=>Xy,normalize:()=>bd,overwrite:()=>Jn,positive:()=>qy,property:()=>Qy,regex:()=>md,size:()=>ql,slugify:()=>Ed,startsWith:()=>xd,toLowerCase:()=>Ad,toUpperCase:()=>Fd,trim:()=>_d,uppercase:()=>gd});var $d={};Ta($d,{ZodISODate:()=>sw,ZodISODateTime:()=>ow,ZodISODuration:()=>uw,ZodISOTime:()=>lw,date:()=>$F,datetime:()=>PF,duration:()=>MF,time:()=>kF});var ow=I("ZodISODateTime",(t,e)=>{nA.init(t,e),pt.init(t,e)});function PF(t){return l1(ow,t)}var sw=I("ZodISODate",(t,e)=>{aA.init(t,e),pt.init(t,e)});function $F(t){return u1(sw,t)}var lw=I("ZodISOTime",(t,e)=>{oA.init(t,e),pt.init(t,e)});function kF(t){return c1(lw,t)}var uw=I("ZodISODuration",(t,e)=>{sA.init(t,e),pt.init(t,e)});function MF(t){return d1(uw,t)}var Ck=(t,e)=>{hm.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>vm(t,r)},flatten:{value:r=>gm(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,ad,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,ad,2)}},isEmpty:{get(){return t.issues.length===0}}})},IR=I("ZodError",Ck),wi=I("ZodError",Ck,{Parent:Error});var NF=ld(wi),IF=ud(wi),BF=cd(wi),TF=dd(wi),DF=iy(wi),RF=ny(wi),CF=ay(wi),zF=oy(wi),OF=sy(wi),VF=ly(wi),UF=uy(wi),jF=cy(wi);var zk=new WeakMap;function Bm(t,e,r){let n=Object.getPrototypeOf(t),i=zk.get(n);if(i||(i=new Set,zk.set(n,i)),!i.has(e)){i.add(e);for(let a in r){let o=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){let s=o.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var Te=I("ZodType",(t,e)=>($e.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Pd(t,"input"),output:Pd(t,"output")}}),t.toJSONSchema=K1(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>NF(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>BF(t,r,n),t.parseAsync=async(r,n)=>IF(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>TF(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>DF(t,r,n),t.decode=(r,n)=>RF(t,r,n),t.encodeAsync=async(r,n)=>CF(t,r,n),t.decodeAsync=async(r,n)=>zF(t,r,n),t.safeEncode=(r,n)=>OF(t,r,n),t.safeDecode=(r,n)=>VF(t,r,n),t.safeEncodeAsync=async(r,n)=>UF(t,r,n),t.safeDecodeAsync=async(r,n)=>jF(t,r,n),Bm(t,"ZodType",{check(...r){let n=this.def;return this.clone(q.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Yr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(BE(r,n))},superRefine(r,n){return this.check(TE(r,n))},overwrite(r){return this.check(Jn(r))},optional(){return Nm(this)},exactOptional(){return mE(this)},nullable(){return Im(this)},nullish(){return Nm(Im(this))},nonoptional(r){return wE(this,r)},array(){return Rm(this)},or(r){return Nw([this,r])},and(r){return nE(this,r)},transform(r){return dw(this,Bw(r))},default(r){return vE(this,r)},prefault(r){return yE(this,r)},catch(r){return AE(this,r)},pipe(r){return dw(this,r)},readonly(){return PE(this)},describe(r){let n=this.clone();return kr.add(n,{description:r}),n},meta(...r){if(r.length===0)return kr.get(this);let n=this.clone();return kr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return kr.get(t)?.description},configurable:!0}),t)),pw=I("_ZodString",(t,e)=>{Hl.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(n,i,a)=>W1(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Bm(t,"_ZodString",{regex(...n){return this.check(md(...n))},includes(...n){return this.check(vd(...n))},startsWith(...n){return this.check(xd(...n))},endsWith(...n){return this.check(yd(...n))},min(...n){return this.check(lo(...n))},max(...n){return this.check(Jl(...n))},length(...n){return this.check(Xl(...n))},nonempty(...n){return this.check(lo(1,...n))},lowercase(n){return this.check(hd(n))},uppercase(n){return this.check(gd(n))},trim(){return this.check(_d())},normalize(...n){return this.check(bd(...n))},toLowerCase(){return this.check(Ad())},toUpperCase(){return this.check(Fd())},slugify(){return this.check(Ed())}})}),Nd=I("ZodString",(t,e)=>{Hl.init(t,e),pw.init(t,e),t.email=r=>t.check(ky(fw,r)),t.url=r=>t.check(Pm(Tm,r)),t.jwt=r=>t.check(Hy($w,r)),t.emoji=r=>t.check(Ty(mw,r)),t.guid=r=>t.check(Sm(Mm,r)),t.uuid=r=>t.check(My(Ia,r)),t.uuidv4=r=>t.check(Ny(Ia,r)),t.uuidv6=r=>t.check(Iy(Ia,r)),t.uuidv7=r=>t.check(By(Ia,r)),t.nanoid=r=>t.check(Dy(hw,r)),t.guid=r=>t.check(Sm(Mm,r)),t.cuid=r=>t.check(Ry(gw,r)),t.cuid2=r=>t.check(Cy(vw,r)),t.ulid=r=>t.check(zy(xw,r)),t.base64=r=>t.check(Ly(Ew,r)),t.base64url=r=>t.check(Zy(Sw,r)),t.xid=r=>t.check(Oy(yw,r)),t.ksuid=r=>t.check(Vy(ww,r)),t.ipv4=r=>t.check(Uy(bw,r)),t.ipv6=r=>t.check(jy(_w,r)),t.cidrv4=r=>t.check(Ky(Aw,r)),t.cidrv6=r=>t.check(Wy(Fw,r)),t.e164=r=>t.check(Gy(Pw,r)),t.datetime=r=>t.check(PF(r)),t.date=r=>t.check($F(r)),t.time=r=>t.check(kF(r)),t.duration=r=>t.check(MF(r))});function km(t){return n1(Nd,t)}var pt=I("ZodStringFormat",(t,e)=>{dt.init(t,e),pw.init(t,e)}),fw=I("ZodEmail",(t,e)=>{q0.init(t,e),pt.init(t,e)});function Ok(t){return ky(fw,t)}var Mm=I("ZodGUID",(t,e)=>{G0.init(t,e),pt.init(t,e)});function Vk(t){return Sm(Mm,t)}var Ia=I("ZodUUID",(t,e)=>{H0.init(t,e),pt.init(t,e)});function Uk(t){return My(Ia,t)}function jk(t){return Ny(Ia,t)}function Kk(t){return Iy(Ia,t)}function Wk(t){return By(Ia,t)}var Tm=I("ZodURL",(t,e)=>{J0.init(t,e),pt.init(t,e)});function Lk(t){return Pm(Tm,t)}function Zk(t){return Pm(Tm,{protocol:Ui.httpProtocol,hostname:Ui.domain,...q.normalizeParams(t)})}var mw=I("ZodEmoji",(t,e)=>{X0.init(t,e),pt.init(t,e)});function Gk(t){return Ty(mw,t)}var hw=I("ZodNanoID",(t,e)=>{Y0.init(t,e),pt.init(t,e)});function Hk(t){return Dy(hw,t)}var gw=I("ZodCUID",(t,e)=>{Q0.init(t,e),pt.init(t,e)});function qk(t){return Ry(gw,t)}var vw=I("ZodCUID2",(t,e)=>{eA.init(t,e),pt.init(t,e)});function Jk(t){return Cy(vw,t)}var xw=I("ZodULID",(t,e)=>{tA.init(t,e),pt.init(t,e)});function Xk(t){return zy(xw,t)}var yw=I("ZodXID",(t,e)=>{rA.init(t,e),pt.init(t,e)});function Yk(t){return Oy(yw,t)}var ww=I("ZodKSUID",(t,e)=>{iA.init(t,e),pt.init(t,e)});function Qk(t){return Vy(ww,t)}var bw=I("ZodIPv4",(t,e)=>{lA.init(t,e),pt.init(t,e)});function eM(t){return Uy(bw,t)}var KF=I("ZodMAC",(t,e)=>{cA.init(t,e),pt.init(t,e)});function tM(t){return o1(KF,t)}var _w=I("ZodIPv6",(t,e)=>{uA.init(t,e),pt.init(t,e)});function rM(t){return jy(_w,t)}var Aw=I("ZodCIDRv4",(t,e)=>{dA.init(t,e),pt.init(t,e)});function iM(t){return Ky(Aw,t)}var Fw=I("ZodCIDRv6",(t,e)=>{pA.init(t,e),pt.init(t,e)});function nM(t){return Wy(Fw,t)}var Ew=I("ZodBase64",(t,e)=>{mA.init(t,e),pt.init(t,e)});function aM(t){return Ly(Ew,t)}var Sw=I("ZodBase64URL",(t,e)=>{hA.init(t,e),pt.init(t,e)});function oM(t){return Zy(Sw,t)}var Pw=I("ZodE164",(t,e)=>{gA.init(t,e),pt.init(t,e)});function sM(t){return Gy(Pw,t)}var $w=I("ZodJWT",(t,e)=>{vA.init(t,e),pt.init(t,e)});function lM(t){return Hy($w,t)}var Id=I("ZodCustomStringFormat",(t,e)=>{xA.init(t,e),pt.init(t,e)});function uM(t,e,r={}){return Sd(Id,t,e,r)}function cM(t){return Sd(Id,"hostname",Ui.hostname,t)}function dM(t){return Sd(Id,"hex",Ui.hex,t)}function pM(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Ui[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Sd(Id,n,i,e)}var Bd=I("ZodNumber",(t,e)=>{yy.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(n,i,a)=>L1(t,n,i,a),Bm(t,"ZodNumber",{gt(n,i){return this.check(Ma(n,i))},gte(n,i){return this.check(ei(n,i))},min(n,i){return this.check(ei(n,i))},lt(n,i){return this.check(ka(n,i))},lte(n,i){return this.check(ji(n,i))},max(n,i){return this.check(ji(n,i))},int(n){return this.check(cw(n))},safe(n){return this.check(cw(n))},positive(n){return this.check(Ma(0,n))},nonnegative(n){return this.check(ei(0,n))},negative(n){return this.check(ka(0,n))},nonpositive(n){return this.check(ji(0,n))},multipleOf(n,i){return this.check(hs(n,i))},step(n,i){return this.check(hs(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function WF(t){return p1(Bd,t)}var Ql=I("ZodNumberFormat",(t,e)=>{yA.init(t,e),Bd.init(t,e)});function cw(t){return m1(Ql,t)}function fM(t){return h1(Ql,t)}function mM(t){return g1(Ql,t)}function hM(t){return v1(Ql,t)}function gM(t){return x1(Ql,t)}var Td=I("ZodBoolean",(t,e)=>{bm.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Z1(t,r,n,i)});function LF(t){return y1(Td,t)}var Dd=I("ZodBigInt",(t,e)=>{wy.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(n,i,a)=>G1(t,n,i,a),t.gte=(n,i)=>t.check(ei(n,i)),t.min=(n,i)=>t.check(ei(n,i)),t.gt=(n,i)=>t.check(Ma(n,i)),t.gte=(n,i)=>t.check(ei(n,i)),t.min=(n,i)=>t.check(ei(n,i)),t.lt=(n,i)=>t.check(ka(n,i)),t.lte=(n,i)=>t.check(ji(n,i)),t.max=(n,i)=>t.check(ji(n,i)),t.positive=n=>t.check(Ma(BigInt(0),n)),t.negative=n=>t.check(ka(BigInt(0),n)),t.nonpositive=n=>t.check(ji(BigInt(0),n)),t.nonnegative=n=>t.check(ei(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(hs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function vM(t){return b1(Dd,t)}var kw=I("ZodBigIntFormat",(t,e)=>{wA.init(t,e),Dd.init(t,e)});function xM(t){return A1(kw,t)}function yM(t){return F1(kw,t)}var ZF=I("ZodSymbol",(t,e)=>{bA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>H1(t,r,n,i)});function wM(t){return E1(ZF,t)}var GF=I("ZodUndefined",(t,e)=>{_A.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>J1(t,r,n,i)});function bM(t){return S1(GF,t)}var HF=I("ZodNull",(t,e)=>{AA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>q1(t,r,n,i)});function qF(t){return P1(HF,t)}var JF=I("ZodAny",(t,e)=>{FA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Q1(t,r,n,i)});function _M(){return $1(JF)}var XF=I("ZodUnknown",(t,e)=>{EA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eF(t,r,n,i)});function Yl(){return k1(XF)}var YF=I("ZodNever",(t,e)=>{SA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Y1(t,r,n,i)});function Mw(t){return M1(YF,t)}var QF=I("ZodVoid",(t,e)=>{PA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>X1(t,r,n,i)});function AM(t){return N1(QF,t)}var Dm=I("ZodDate",(t,e)=>{$A.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(n,i,a)=>tF(t,n,i,a),t.min=(n,i)=>t.check(ei(n,i)),t.max=(n,i)=>t.check(ji(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function FM(t){return I1(Dm,t)}var eE=I("ZodArray",(t,e)=>{kA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fF(t,r,n,i),t.element=e.element,Bm(t,"ZodArray",{min(r,n){return this.check(lo(r,n))},nonempty(r){return this.check(lo(1,r))},max(r,n){return this.check(Jl(r,n))},length(r,n){return this.check(Xl(r,n))},unwrap(){return this.element}})});function Rm(t,e){return D1(eE,t,e)}function EM(t){let e=t._zod.def.shape;return Iw(Object.keys(e))}var Cm=I("ZodObject",(t,e)=>{MA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mF(t,r,n,i),q.defineLazy(t,"shape",()=>e.shape),Bm(t,"ZodObject",{keyof(){return Iw(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Yl()})},loose(){return this.clone({...this._zod.def,catchall:Yl()})},strict(){return this.clone({...this._zod.def,catchall:Mw()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return q.extend(this,r)},safeExtend(r){return q.safeExtend(this,r)},merge(r){return q.merge(this,r)},pick(r){return q.pick(this,r)},omit(r){return q.omit(this,r)},partial(...r){return q.partial(Tw,this,r[0])},required(...r){return q.required(Dw,this,r[0])}})});function SM(t,e){let r={type:"object",shape:t??{},...q.normalizeParams(e)};return new Cm(r)}function PM(t,e){return new Cm({type:"object",shape:t,catchall:Mw(),...q.normalizeParams(e)})}function $M(t,e){return new Cm({type:"object",shape:t,catchall:Yl(),...q.normalizeParams(e)})}var zm=I("ZodUnion",(t,e)=>{_m.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tw(t,r,n,i),t.options=e.options});function Nw(t,e){return new zm({type:"union",options:t,...q.normalizeParams(e)})}var tE=I("ZodXor",(t,e)=>{zm.init(t,e),NA.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tw(t,r,n,i),t.options=e.options});function kM(t,e){return new tE({type:"union",options:t,inclusive:!1,...q.normalizeParams(e)})}var rE=I("ZodDiscriminatedUnion",(t,e)=>{zm.init(t,e),IA.init(t,e)});function MM(t,e,r){return new rE({type:"union",options:e,discriminator:t,...q.normalizeParams(r)})}var iE=I("ZodIntersection",(t,e)=>{BA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hF(t,r,n,i)});function nE(t,e){return new iE({type:"intersection",left:t,right:e})}var aE=I("ZodTuple",(t,e)=>{by.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gF(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function oE(t,e,r){let n=e instanceof $e,i=n?r:e,a=n?e:null;return new aE({type:"tuple",items:t,rest:a,...q.normalizeParams(i)})}var kd=I("ZodRecord",(t,e)=>{TA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vF(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function sE(t,e,r){return!e||!e._zod?new kd({type:"record",keyType:km(),valueType:t,...q.normalizeParams(e)}):new kd({type:"record",keyType:t,valueType:e,...q.normalizeParams(r)})}function NM(t,e,r){let n=Yr(t);return n._zod.values=void 0,new kd({type:"record",keyType:n,valueType:e,...q.normalizeParams(r)})}function IM(t,e,r){return new kd({type:"record",keyType:t,valueType:e,mode:"loose",...q.normalizeParams(r)})}var lE=I("ZodMap",(t,e)=>{DA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dF(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(Na(...r)),t.nonempty=r=>t.check(Na(1,r)),t.max=(...r)=>t.check(gs(...r)),t.size=(...r)=>t.check(ql(...r))});function BM(t,e,r){return new lE({type:"map",keyType:t,valueType:e,...q.normalizeParams(r)})}var uE=I("ZodSet",(t,e)=>{RA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pF(t,r,n,i),t.min=(...r)=>t.check(Na(...r)),t.nonempty=r=>t.check(Na(1,r)),t.max=(...r)=>t.check(gs(...r)),t.size=(...r)=>t.check(ql(...r))});function TM(t,e){return new uE({type:"set",valueType:t,...q.normalizeParams(e)})}var Md=I("ZodEnum",(t,e)=>{CA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(n,i,a)=>rF(t,n,i,a),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Md({...e,checks:[],...q.normalizeParams(i),entries:a})},t.exclude=(n,i)=>{let a={...e.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Md({...e,checks:[],...q.normalizeParams(i),entries:a})}});function Iw(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Md({type:"enum",entries:r,...q.normalizeParams(e)})}function DM(t,e){return new Md({type:"enum",entries:t,...q.normalizeParams(e)})}var cE=I("ZodLiteral",(t,e)=>{zA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iF(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function RM(t,e){return new cE({type:"literal",values:Array.isArray(t)?t:[t],...q.normalizeParams(e)})}var dE=I("ZodFile",(t,e)=>{OA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oF(t,r,n,i),t.min=(r,n)=>t.check(Na(r,n)),t.max=(r,n)=>t.check(gs(r,n)),t.mime=(r,n)=>t.check(wd(Array.isArray(r)?r:[r],n))});function CM(t){return R1(dE,t)}var pE=I("ZodTransform",(t,e)=>{VA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cF(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new cs(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(q.issue(a,r.value,e));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(q.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function Bw(t){return new pE({type:"transform",transform:t})}var Tw=I("ZodOptional",(t,e)=>{_y.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rw(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Nm(t){return new Tw({type:"optional",innerType:t})}var fE=I("ZodExactOptional",(t,e)=>{UA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rw(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function mE(t){return new fE({type:"optional",innerType:t})}var hE=I("ZodNullable",(t,e)=>{jA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Im(t){return new hE({type:"nullable",innerType:t})}function zM(t){return Nm(Im(t))}var gE=I("ZodDefault",(t,e)=>{KA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function vE(t,e){return new gE({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():q.shallowClone(e)}})}var xE=I("ZodPrefault",(t,e)=>{WA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function yE(t,e){return new xE({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():q.shallowClone(e)}})}var Dw=I("ZodNonOptional",(t,e)=>{LA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function wE(t,e){return new Dw({type:"nonoptional",innerType:t,...q.normalizeParams(e)})}var bE=I("ZodSuccess",(t,e)=>{ZA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function OM(t){return new bE({type:"success",innerType:t})}var _E=I("ZodCatch",(t,e)=>{GA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_F(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function AE(t,e){return new _E({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var FE=I("ZodNaN",(t,e)=>{HA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nF(t,r,n,i)});function VM(t){return T1(FE,t)}var Om=I("ZodPipe",(t,e)=>{Ay.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AF(t,r,n,i),t.in=e.in,t.out=e.out});function dw(t,e){return new Om({type:"pipe",in:t,out:e})}var Vm=I("ZodCodec",(t,e)=>{Om.init(t,e),Am.init(t,e)});function UM(t,e,r){return new Vm({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function jM(t){let e=t._zod.def;return new Vm({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var EE=I("ZodPreprocess",(t,e)=>{Om.init(t,e),qA.init(t,e)}),SE=I("ZodReadonly",(t,e)=>{JA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function PE(t){return new SE({type:"readonly",innerType:t})}var $E=I("ZodTemplateLiteral",(t,e)=>{XA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aF(t,r,n,i)});function KM(t,e){return new $E({type:"template_literal",parts:t,...q.normalizeParams(e)})}var kE=I("ZodLazy",(t,e)=>{e1.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SF(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function ME(t){return new kE({type:"lazy",getter:t})}var NE=I("ZodPromise",(t,e)=>{QA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function WM(t){return new NE({type:"promise",innerType:t})}var IE=I("ZodFunction",(t,e)=>{YA.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uF(t,r,n,i)});function LM(t){return new IE({type:"function",input:Array.isArray(t?.input)?oE(t?.input):t?.input??Rm(Yl()),output:t?.output??Yl()})}var Um=I("ZodCustom",(t,e)=>{t1.init(t,e),Te.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lF(t,r,n,i)});function ZM(t){let e=new mt({check:"custom"});return e._zod.check=t,e}function GM(t,e){return C1(Um,t??(()=>!0),e)}function BE(t,e={}){return z1(Um,t,e)}function TE(t,e){return O1(t,e)}var HM=V1,qM=U1;function JM(t,e={}){let r=new Um({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...q.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var XM=(...t)=>j1({Codec:Vm,Boolean:Td,String:Nd},...t);function YM(t){let e=ME(()=>Nw([km(t),WF(),LF(),qF(),Rm(e),sE(km(),e)]));return e}function QM(t,e){return new EE({type:"pipe",in:Bw(t),out:e})}var TR={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 DR(t){jt({customError:t})}function RR(){return jt().customError}var DE;DE||(DE={});var ne={...$m,...aw,iso:$d},CR=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function zR(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function OR(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function eN(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return ne.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return ne.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let a=OR(i,e),o=Ur(a,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return ne.null();if(i.length===0)return ne.never();if(i.length===1)return ne.literal(i[0]);if(i.every(o=>typeof o=="string"))return ne.enum(i);let a=i.map(o=>ne.literal(o));return a.length<2?a[0]:ne.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return ne.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return eN(o,e)});return i.length===0?ne.never():i.length===1?i[0]:ne.union(i)}if(!r)return ne.any();let n;switch(r){case"string":{let i=ne.string();if(t.format){let a=t.format;a==="email"?i=i.check(ne.email()):a==="uri"||a==="uri-reference"?i=i.check(ne.url()):a==="uuid"||a==="guid"?i=i.check(ne.uuid()):a==="date-time"?i=i.check(ne.iso.datetime()):a==="date"?i=i.check(ne.iso.date()):a==="time"?i=i.check(ne.iso.time()):a==="duration"?i=i.check(ne.iso.duration()):a==="ipv4"?i=i.check(ne.ipv4()):a==="ipv6"?i=i.check(ne.ipv6()):a==="mac"?i=i.check(ne.mac()):a==="cidr"?i=i.check(ne.cidrv4()):a==="cidr-v6"?i=i.check(ne.cidrv6()):a==="base64"?i=i.check(ne.base64()):a==="base64url"?i=i.check(ne.base64url()):a==="e164"?i=i.check(ne.e164()):a==="jwt"?i=i.check(ne.jwt()):a==="emoji"?i=i.check(ne.emoji()):a==="nanoid"?i=i.check(ne.nanoid()):a==="cuid"?i=i.check(ne.cuid()):a==="cuid2"?i=i.check(ne.cuid2()):a==="ulid"?i=i.check(ne.ulid()):a==="xid"?i=i.check(ne.xid()):a==="ksuid"&&(i=i.check(ne.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?ne.number().int():ne.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=ne.boolean();break}case"null":{n=ne.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[u,d]of Object.entries(a)){let m=Ur(d,e);i[u]=o.has(u)?m:m.optional()}if(t.propertyNames){let u=Ur(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?Ur(t.additionalProperties,e):ne.any();if(Object.keys(i).length===0){n=ne.record(u,d);break}let m=ne.object(i).passthrough(),x=ne.looseRecord(u,d);n=ne.intersection(m,x);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),m=[];for(let g of d){let w=Ur(u[g],e),_=ne.string().regex(new RegExp(g));m.push(ne.looseRecord(_,w))}let x=[];if(Object.keys(i).length>0&&x.push(ne.object(i).passthrough()),x.push(...m),x.length===0)n=ne.object({}).passthrough();else if(x.length===1)n=x[0];else{let g=ne.intersection(x[0],x[1]);for(let w=2;w<x.length;w++)g=ne.intersection(g,x[w]);n=g}break}let s=ne.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(Ur(t.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=t.prefixItems,a=t.items;if(i&&Array.isArray(i)){let o=i.map(u=>Ur(u,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?Ur(a,e):void 0;s?n=ne.tuple(o).rest(s):n=ne.tuple(o),typeof t.minItems=="number"&&(n=n.check(ne.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ne.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(u=>Ur(u,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?Ur(t.additionalItems,e):void 0;s?n=ne.tuple(o).rest(s):n=ne.tuple(o),typeof t.minItems=="number"&&(n=n.check(ne.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ne.maxLength(t.maxItems)))}else if(a!==void 0){let o=Ur(a,e),s=ne.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=ne.array(ne.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Ur(t,e){if(typeof t=="boolean")return t?ne.any():ne.never();let r=eN(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(d=>Ur(d,e)),u=ne.union(s);r=n?ne.intersection(r,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(d=>Ur(d,e)),u=ne.xor(s);r=n?ne.intersection(r,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:ne.any();else{let s=n?r:Ur(t.allOf[0],e),u=n?0:1;for(let d=u;d<t.allOf.length;d++)s=ne.intersection(s,Ur(t.allOf[d],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=ne.nullable(r)),t.readOnly===!0&&(r=ne.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in t&&(i[s]=t[s]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let s of o)s in t&&(i[s]=t[s]);for(let s of Object.keys(t))CR.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function tN(t,e){if(typeof t=="boolean")return t?ne.any():ne.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=zR(r,e?.defaultTarget),i=r.$defs||r.definitions||{},a={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??kr};return Ur(r,a)}var RE={};Ta(RE,{bigint:()=>KR,boolean:()=>jR,date:()=>WR,number:()=>UR,string:()=>VR});function VR(t){return a1(Nd,t)}function UR(t){return f1(Bd,t)}function jR(t){return w1(Td,t)}function KR(t){return _1(Dd,t)}function WR(t){return B1(Dm,t)}jt(Fy());var iN=[1,2,4,8],nN=[1,2,3,4,5,6,7,8],aN=["disable-track","mute-region"],oN=["none","all","previous-only"],Une=ke.object({metronome:ke.object({enabled:ke.boolean(),beatSubDivision:ke.union(iN.map(t=>ke.literal(t))),gain:ke.number().min(Number.NEGATIVE_INFINITY).max(0),monophonic:ke.boolean()}).default({enabled:!1,beatSubDivision:1,gain:-6,monophonic:!0}),playback:ke.object({timestampEnabled:ke.boolean(),pauseOnLoopDisabled:ke.boolean(),truncateNotesAtRegionEnd:ke.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),debug:ke.object({dspLoadMeasurement:ke.boolean()}).default({dspLoadMeasurement:!1}),recording:ke.object({countInBars:ke.union(nN.map(t=>ke.literal(t))),allowTakes:ke.boolean(),automationEnabled:ke.boolean(),olderTakeAction:ke.union(aN.map(t=>ke.literal(t))),olderTakeScope:ke.union(oN.map(t=>ke.literal(t))),inputLatency:ke.number().min(-1)}).default({countInBars:1,allowTakes:!0,automationEnabled:!0,olderTakeAction:"mute-region",olderTakeScope:"previous-only",inputLatency:0})}),rN;(function(t){t.BeatSubDivisionOptions=iN,t.RecordingCountInBars=nN,t.OlderTakeActionOptions=aN,t.OlderTakeScopeOptions=oN})(rN||(rN={}));var ws={[Ft.Instrument]:0,[Ft.Aux]:1,[Ft.Bus]:2,[Ft.Output]:3};var Rw;(function(t){t.create=({boxGraph:e,mandatoryBoxes:{rootBox:r,primaryAudioBusBox:n}},i,a,o)=>{let s=o??t.orderAndGetIndex(r,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${s}`),Xe.create(e,k.generate(),u=>{u.collection.refer(r.audioUnits),u.output.refer(n.input),u.index.setValue(s),u.type.setValue(i),a.ifSome(d=>u.capture.refer(d))})},t.orderAndGetIndex=(e,r)=>{let n=ni.collectIndexedBoxes(e.audioUnits,Xe),i=ws[r],a=0;for(;a<n.length&&!(ws[n[a].type.getValue()]>i);a++);let o=a;for(;a<n.length;)n[a].index.setValue(++a);return o},t.trackTypeToCapture=(e,r)=>{switch(r){case ve.Audio:return b.wrap(aa.create(e,k.generate()));case ve.Notes:return b.wrap(oa.create(e,k.generate()));default:return b.None}}})(Rw||(Rw={}));var sN;(function(t){t.create=(e,r,n,i,a)=>{console.debug(`createAudioBus '${r}', type: ${i}, color: ${a}`);let{boxGraph:o,mandatoryBoxes:{rootBox:s}}=e;re(s.isAttached(),"rootBox not attached");let u=k.generate(),d=$n.create(o,u,x=>{x.collection.refer(s.audioBusses),x.label.setValue(r),x.icon.setValue(Ze.toName(n)),x.color.setValue(a.toString())}),m=Rw.create(e,i,b.None);return Nr.create(o,k.generate(),x=>{x.tracks.refer(m.tracks),x.target.refer(m),x.index.setValue(0),x.type.setValue(ve.Undefined)}),d.output.refer(m.input),d}})(sN||(sN={}));var lN;(function(t){t.forAudioType=e=>{switch(e){case Ft.Output:return wo.blue;case Ft.Aux:return wo.purple;case Ft.Bus:return wo.orange;case Ft.Instrument:return wo.green;default:return wo.dark}},t.forTrackType=e=>{switch(e){case ve.Audio:return 200;case ve.Notes:return 45;case ve.Value:return 156;default:return 0}}})(lN||(lN={}));var uN;(function(t){t.Tape={defaultName:"Tape",defaultIcon:Ze.Tape,briefDescription:"Audio Player",description:"Plays audio regions & clips",manualPage:le.Tape,trackType:ve.Audio,create:(n,i,a,o,s)=>$u.create(n,k.generate(),u=>{u.label.setValue(a),u.icon.setValue(Ze.toName(o)),u.flutter.setValue(.2),u.wow.setValue(.05),u.noise.setValue(.02),u.saturation.setValue(.5),u.host.refer(i)})},t.Nano={defaultName:"Nano",defaultIcon:Ze.NanoWave,briefDescription:"Simple Sampler",description:"Simple sampler",manualPage:le.Nano,trackType:ve.Notes,create:(n,i,a,o,s)=>Su.create(n,k.generate(),u=>{u.label.setValue(a),u.icon.setValue(Ze.toName(o)),K(s)&&u.file.refer(s),u.host.refer(i)})},t.Playfield={defaultName:"Playfield",defaultIcon:Ze.Playfield,briefDescription:"Drum Machine",description:"Drum computer",manualPage:le.Playfield,trackType:ve.Notes,create:(n,i,a,o,s)=>{let u=Pu.create(n,k.generate(),d=>{d.label.setValue(a),d.icon.setValue(Ze.toName(o)),d.host.refer(i)});return K(s)&&s.filter(({note:d,uuid:m,name:x,durationInSeconds:g,exclude:w})=>{let _=e(n,m,x,g);$o.create(n,k.generate(),N=>{N.device.refer(u.samples),N.file.refer(_),N.index.setValue(d),N.exclude.setValue(w)})}),u}},t.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Ze.Piano,briefDescription:"Subtractive Synth",description:"Classic subtractive synthesizer",manualPage:le.Vaporisateur,trackType:ve.Notes,create:(n,i,a,o,s)=>Au.create(n,k.generate(),u=>{u.label.setValue(a),u.icon.setValue(Ze.toName(o)),u.cutoff.setInitValue(8e3),u.resonance.setInitValue(.1),u.attack.setInitValue(.005),u.decay.setInitValue(.1),u.sustain.setInitValue(.5),u.release.setInitValue(.5),u.voicingMode.setInitValue(Ds.Polyphonic),u.lfo.rate.setInitValue(1),u.oscillators.fields()[0].waveform.setInitValue(ta.saw),u.oscillators.fields()[0].volume.setInitValue(-6),u.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),u.oscillators.fields()[1].waveform.setInitValue(ta.square),u.host.refer(i),u.version.setValue(2)})},t.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Ze.Midi,briefDescription:"Send MIDI",description:"MIDI Output",manualPage:le.MIDIOutput,trackType:ve.Notes,create:(n,i,a,o,s)=>Fu.create(n,k.generate(),u=>{u.label.setValue(a),u.icon.setValue(Ze.toName(o)),u.host.refer(i)})},t.Soundfont={defaultName:"Soundfont",defaultIcon:Ze.SoundFont,briefDescription:"Soundfont Player",description:"Soundfont Player",manualPage:le.Soundfont,trackType:ve.Notes,create:(n,i,a,o)=>Eu.create(n,k.generate(),s=>{s.label.setValue(a),s.icon.setValue(Ze.toName(o)),s.host.refer(i)})},t.Apparat={defaultName:"Apparat",defaultIcon:Ze.Code,briefDescription:"Scriptable Instrument",description:"User-scripted instrument",manualPage:le.Apparat,trackType:ve.Notes,create:(n,i,a,o)=>ku.create(n,k.generate(),s=>{s.label.setValue(a),s.icon.setValue(Ze.toName(o)),s.host.refer(i)})},t.Named={Apparat:t.Apparat,MIDIOutput:t.MIDIOutput,Nano:t.Nano,Playfield:t.Playfield,Soundfont:t.Soundfont,Tape:t.Tape,Vaporisateur:t.Vaporisateur};let e=(n,i,a,o)=>n.findBox(i).unwrapOrElse(()=>Li.create(n,i,s=>{s.fileName.setValue(a),s.endInSeconds.setValue(o)})),r=(n,i,a)=>n.findBox(i).unwrapOrElse(()=>na.create(n,i,o=>o.fileName.setValue(a)))})(uN||(uN={}));var co;(function(t){t.empty=n=>{let i=new Oa(b.wrap(ja.create)),a=new Date().toISOString();console.debug(`New Project created on ${a}`),i.beginTransaction();let o=bu.create(i,k.generate(),g=>{g.label.setValue("Groove Shuffle")}),s=_o.create(i,k.generate(),g=>{g.groove.refer(o),g.created.setValue(a)}),u=$n.create(i,k.generate(),g=>{g.collection.refer(s.audioBusses),g.label.setValue("Output"),g.icon.setValue(Ze.toName(Ze.SpeakerHeadphone)),g.color.setValue(wo.blue.toString())}),d=Xe.create(i,k.generate(),g=>{g.type.setValue(Ft.Output),g.collection.refer(s.audioUnits),g.output.refer(s.outputDevice),g.index.setValue(0)});n.createOutputMaximizer&&_u.create(i,k.generate(),g=>{g.label.setValue("Master Maximizer"),g.index.setValue(0),g.host.refer(d.audioEffects),g.lookahead.setValue(!1)});let m=Rs.create(i,k.generate());Pn.create(i,k.generate(),g=>m.tempoTrack.events.refer(g.owners)),s.timeline.refer(m.root),u.output.refer(d.input);let x=[];if(n.createDefaultUser){let g=Ka.create(i,k.generate());g.root.refer(s.users),x.push(g)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBusBox:u,primaryAudioUnitBox:d,timelineBox:m,userInterfaceBoxes:x}}},t.encode=n=>{let i=Ct.create();i.writeInt(1330660686),i.writeInt(2);let a=n.toArrayBuffer();return i.writeInt(a.byteLength),i.writeBytes(new Int8Array(a)),i.toArrayBuffer()},t.decode=n=>{let i=new rt(n);re(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),re(i.readInt()===2,"Deprecated Format");let a=i.readInt(),o=new Int8Array(a);i.readBytes(o);let s=new Oa(b.wrap(ja.create));return s.fromArrayBuffer(o.buffer,!1),{boxGraph:s,mandatoryBoxes:t.findMandatoryBoxes(s)}},t.findMandatoryBoxes=n=>{let i=n.boxes().find(a=>a.accept({visitRootBox:()=>!0}));if(K(i)){let a=Ie(i.outputDevice.pointerHub.incoming().at(0)?.box,Xe),o=Ie(a.input.pointerHub.incoming().at(0)?.box,$n),s=Ie(i.timeline.targetVertex.unwrap("TimelineBox not found").box,Rs),u=i.users.pointerHub.incoming().map(({box:d})=>Ie(d,Ka));return{rootBox:i,primaryAudioBusBox:o,primaryAudioUnitBox:a,timelineBox:s,userInterfaceBoxes:u}}return V("Could not find mandatory boxes")}})(co||(co={}));var It;(function(t){let e=({graph:n},{graph:i})=>n===i,r=(n,i)=>n.index.getValue()-i.index.getValue();t.excludeTimelinePredicate=n=>n.accept({visitTrackBox:()=>!0})===!0,t.shouldExclude=n=>n.ephemeral||n.name===wu.ClassName,t.generateMap=(n,i,a,o)=>{let s=k.newSet(({source:u})=>u);return s.addMany([...n.filter(({output:{targetAddress:u}})=>u.nonEmpty()).map(u=>({source:u.output.targetAddress.unwrap().uuid,target:o})),...n.map(u=>({source:u.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:a})),...n.map(u=>({source:u.address.uuid,target:k.generate()})),...i.map(u=>({source:u.address.uuid,target:u.resource==="preserved"?u.address.uuid:k.generate()}))]),s},t.copyBoxes=(n,i,a,o)=>{let s=k.newSet(d=>d);o.forEach(d=>{d.resource==="preserved"&&i.findBox(d.address.uuid).nonEmpty()&&s.add(d.address.uuid)});let u=d=>{for(let[m,x]of d.outgoingEdges())if(m.mandatory&&!x.isBox()&&s.hasKey(x.uuid))return!0;return!1};M.decodeWith({map:(d,m)=>m.flatMap(x=>n.opt(x.uuid).match({some:({target:g})=>b.wrap(x.moveTo(g)),none:()=>i.findBox(x.uuid).nonEmpty()?b.wrap(x):b.None}))},()=>{a.forEach(d=>{let m=new rt(d.toArrayBuffer()),x=n.get(d.address.uuid,"uuid mapping").target;i.createBox(d.name,x,g=>g.read(m))}),o.forEach(d=>{if(s.hasKey(d.address.uuid)||u(d))return;let m=new rt(d.toArrayBuffer()),x=n.get(d.address.uuid,"uuid mapping").target;i.createBox(d.name,x,g=>g.read(m))})})},t.reorderAudioUnits=(n,i,a,o)=>{let s=i.toSorted(r).map(g=>Ie(a.graph.findBox(n.get(g.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)),u=new Set(s),m=ni.collectIndexedBoxes(a.audioUnits,Xe).filter(g=>!u.has(g)),x;if(K(o)){let g=at(o,0,m.length);x=[...m.slice(0,g),...s,...m.slice(g)]}else{let g=m.toSorted((N,j)=>(ws[N.type.getValue()]??0)-(ws[j.type.getValue()]??0)),w=s.reduce((N,j)=>Math.max(N,ws[j.type.getValue()]??0),0),_=g.findIndex(N=>(ws[N.type.getValue()]??0)>w);_===-1&&(_=g.length),x=[...g.slice(0,_),...s,...g.slice(_)]}x.forEach((g,w)=>g.index.setValue(w))},t.extractRegions=(n,{boxGraph:i,mandatoryBoxes:{primaryAudioBusBox:a,rootBox:o}},s=0)=>{re(se.satisfy(n,e),"Region smust be from the same BoxGraph");let u=new Set(n),d=new Set,m=new lh;n.forEach(W=>{let O=Ie(W.regions.targetVertex.unwrap("regions.target").box,Nr);d.add(O);let te=Ie(O.tracks.targetVertex.unwrap("tracks.target").box,Xe);m.add(te,O)}),console.debug(`Found ${m.keyCount()} audioUnits`),console.debug(`Found ${d.size} tracks`);let x=[...m.keys()],g=W=>t.shouldExclude(W)||kt(W,Nr)&&!d.has(W)||Hn.isRegionBox(W)&&!u.has(W),w=Array.from(x[0].graph.dependenciesOf(x,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:g}).boxes),_=t.generateMap(x,w,o.audioUnits.address.uuid,a.address.uuid);t.copyBoxes(_,i,x,w),t.reorderAudioUnits(_,x,o),m.forEach((W,O)=>[...O].sort(r).forEach((te,ie)=>{let be=i.findBox(_.get(te.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied");Ie(be,Nr).index.setValue(ie)}));let N=n.reduce((W,O)=>Math.min(W,O.position.getValue()),Number.MAX_VALUE),j=s-N;n.forEach(W=>{let O=i.findBox(_.get(W.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied"),{position:te}=Hn.asRegionBox(O);te.setValue(te.getValue()+j)})}})(It||(It={}));var cN;(function(t){t.transfer=(e,{boxGraph:r,mandatoryBoxes:{primaryAudioBusBox:n,rootBox:i}},a={})=>{let o=e.filter(x=>x.type.getValue()!==Ft.Output);if(o.length===0)return[];let s=x=>It.shouldExclude(x)||a?.excludeTimeline===!0&&It.excludeTimelinePredicate(x),u=Array.from(o[0].graph.dependenciesOf(o,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:s}).boxes),d=It.generateMap(o,u,i.audioUnits.address.uuid,n.address.uuid);It.copyBoxes(d,r,o,u),It.reorderAudioUnits(d,o,i,a.insertIndex);let m=o.map(x=>Ie(i.graph.findBox(d.get(x.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe));if(a.deleteSource===!0){let x=Ie(o[0].collection.targetVertex.unwrap("collection.target").box,_o);o.forEach(g=>g.delete()),ni.collectIndexedBoxes(x.audioUnits,Xe).forEach((g,w)=>g.index.setValue(w))}return m}})(cN||(cN={}));var dN;(function(t){t.transfer=(e,r,n,i=!0)=>{let a=r.graph,o=k.newSet(g=>g.address.uuid);o.add(e);for(let g of e.graph.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:w=>w.ephemeral}).boxes)o.add(g);let s=k.newSet(g=>g);o.forEach(g=>{g.resource==="preserved"&&a.findBox(g.address.uuid).nonEmpty()&&s.add(g.address.uuid)});let u=g=>{if(g.resource==="preserved"&&s.hasKey(g.address.uuid))return!0;for(let[,w]of g.outgoingEdges())if(s.hasKey(w.uuid)&&!w.isBox())return!0;return!1},d=o.values().filter(g=>!u(g)),m=k.newSet(g=>g.source);d.forEach(g=>{m.add({source:g.address.uuid,target:g.resource==="preserved"?g.address.uuid:k.generate()})}),s.forEach(g=>m.add({source:g,target:g}));let x=null;return M.decodeWith({map:(g,w)=>{let _=w.flatMap(N=>m.opt(N.uuid).map(j=>N.moveTo(j.target)));return _.nonEmpty()?_:g.pointerType===l.RegionCollection?b.wrap(r.regions.address):g.pointerType===l.ClipCollection?b.wrap(r.clips.address):b.None}},()=>d.forEach(g=>{let w=new rt(g.toArrayBuffer()),_=m.get(g.address.uuid,"uuid mapping").target;a.createBox(g.name,_,N=>{if(N.read(w),Hn.isRegionBox(N)){let j=Hn.asRegionBox(N);j.position.setValue(n),x=j}})})),i&&e.delete(),ze(x,"Failed to create region copy")}})(dN||(dN={}));var Kt;(function(t){t.MAGIC_HEADER_OPEN=1330664005,t.FORMAT_VERSION=1;let e;(function(r){r[r.Midi=0]="Midi",r[r.Audio=1]="Audio"})(e=t.ChainKind||(t.ChainKind={}))})(Kt||(Kt={}));var pN;(function(t){t.decode=(e,r)=>{let n=new rt(e.slice(0,8));if(n.readInt()!==Kt.MAGIC_HEADER_OPEN)return uu.notify({message:"Invalid preset file.",icon:"Warning"}),[];let i=n.readInt();if(i!==Kt.FORMAT_VERSION)return console.warn(`Unsupported preset version ${i} (supports ${Kt.FORMAT_VERSION})`),uu.notify({message:"Unsupported preset version.",icon:"Warning"}),[];let a=new Oa(b.wrap(ja.create));try{a.fromArrayBuffer(e.slice(8),!1)}catch(_){return console.warn(_),uu.notify({message:"Could not import preset.",icon:"Warning"}),[]}let o={};for(let _ of a.boxes())o[_.name]=(o[_.name]??0)+1;console.info("PresetDecoder.decode: source graph boxes",o);let s=a.boxes().filter(_=>kt(_,Xe)).filter(_=>_.type.getValue()!==Ft.Output),u=_=>It.shouldExclude(_),d=Array.from(a.dependenciesOf(s,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:u}).boxes),{mandatoryBoxes:{rootBox:m,primaryAudioBusBox:x}}=r,g=It.generateMap(s,d,m.audioUnits.address.uuid,x.address.uuid);It.copyBoxes(g,r.boxGraph,s,d),It.reorderAudioUnits(g,s,m);let w=s.map(_=>Ie(m.graph.findBox(g.get(_.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)).filter(_=>_.type.getValue()!==Ft.Output);return w.forEach(_=>{let N=_.input.pointerHub.incoming().at(0)?.box;if(!K(N))return;let j=_.tracks.pointerHub.incoming().length;console.info(`PresetDecoder.decode: AudioUnit ${k.toString(_.address.uuid)} has ${j} pre-copied track(s)`),!(j>0)&&_.capture.targetVertex.ifSome(({box:W})=>{W instanceof oa?Nr.create(r.boxGraph,k.generate(),O=>{O.index.setValue(0),O.type.setValue(ve.Notes),O.target.refer(_),O.tracks.refer(_.tracks)}):W instanceof aa&&Nr.create(r.boxGraph,k.generate(),O=>{O.index.setValue(0),O.type.setValue(ve.Audio),O.target.refer(_),O.tracks.refer(_.tracks)})})}),w},t.peekHasTimeline=e=>{if(e.byteLength<8)return!1;let r=new rt(e.slice(0,8));if(r.readInt()!==Kt.MAGIC_HEADER_OPEN||r.readInt()!==Kt.FORMAT_VERSION)return!1;let n=new Oa(b.wrap(ja.create));if(Ht(()=>n.fromArrayBuffer(e.slice(8),!1)).status==="failure")return!1;for(let a of n.boxes())if(kt(a,Nr))return!0;return!1},t.replaceAudioUnit=(e,r,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=co.empty({createDefaultUser:!1,createOutputMaximizer:!1}),a=i.boxGraph,o=r.graph;a.beginTransaction(),t.decode(e,i),a.endTransaction();let s=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:O})=>Ie(O,Xe)).find(O=>O.type.getValue()!==Ft.Output);if(ob(s))return Mr.err("Preset contains no valid audio unit. Please send the file to the developers.");let u=s.capture.targetVertex.mapOr(({box:O})=>O.name,""),d=r.capture.targetVertex.mapOr(({box:O})=>O.name,"");if(u!==d)return Mr.err("Cannot replace incompatible instruments");let m=n?.keepMIDIEffects!==!0,x=n?.keepAudioEffects!==!0,g=n?.keepTimeline!==!0;console.debug("replaceMIDIEffects",m),console.debug("replaceAudioEffects",x),console.debug("replaceTimeline",g),ze(r.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),m?r.midiEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()):(a.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()),a.endTransaction()),x?r.audioEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()):(a.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()),a.endTransaction()),s.tracks.pointerHub.incoming().length>0&&g&&r.tracks.pointerHub.incoming().forEach(({box:O})=>O.delete());let _=O=>!!(O.accept({visitCaptureMidiBox:te=>!0,visitCaptureAudioBox:te=>!0})===!0||!g&&It.excludeTimelinePredicate(O)),N=k.newSet(({source:O})=>O),j=Array.from(a.dependenciesOf(s,{excludeBox:_,alwaysFollowMandatory:!0,stopAtResources:!0}).boxes);N.addMany([{source:s.address.uuid,target:r.address.uuid},...j.map(({address:{uuid:O},name:te})=>({source:O,target:te===Li.ClassName||te===na.ClassName?O:k.generate()}))]);let W=k.newSet(O=>O);return j.forEach(O=>{(O instanceof Li||O instanceof na)&&o.findBox(O.address.uuid).nonEmpty()&&W.add(O.address.uuid)}),M.decodeWith({map:(O,te)=>te.flatMap(ie=>N.opt(ie.uuid).match({some:({target:be})=>b.wrap(ie.moveTo(be)),none:()=>o.findBox(ie.uuid).nonEmpty()?b.wrap(ie):b.None}))},()=>{j.forEach(O=>{if((O instanceof Li||O instanceof na)&&W.opt(O.address.uuid).nonEmpty())return;let te=new rt(O.toArrayBuffer()),ie=O.name,be=N.get(O.address.uuid,"uuid mapping").target;o.createBox(ie,be,Q=>Q.read(te))})}),Mr.Ok},t.insertEffectChain=(e,r,n,i)=>{let a=new rt(e.slice(0,8));if(a.readInt()!==Kt.MAGIC_HEADER_OPEN)return Mr.err("Invalid preset header");let o=a.readInt();if(o!==Kt.FORMAT_VERSION)return Mr.err(`Unsupported preset version ${o} (this build supports ${Kt.FORMAT_VERSION}).`);let s=new Oa(b.wrap(ja.create)),u=Ht(()=>s.fromArrayBuffer(e.slice(8),!1));if(u.status==="failure")return Mr.err(`Failed to decode preset: ${String(u.error)}`);let d=s.boxes().filter(L=>kt(L,Xe)).map(L=>Ie(L,Xe)).find(L=>L.type.getValue()!==Ft.Output);if(ob(d))return Mr.err("Preset contains no audio unit");let m=i===Kt.ChainKind.Audio?d.audioEffects:d.midiEffects,x=ni.collectIndexedBoxes(m);if(x.length===0)return Mr.err("Preset contains no effects of the requested kind");let g=i===Kt.ChainKind.Audio?r.audioEffects:r.midiEffects,w=g.address,_=i===Kt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost,N=r.graph,j=x.length,W=ni.collectIndexedBoxes(g);for(let L=W.length-1;L>=0;L--){let we=W[L],Ve=we.index.getValue();Ve>=n&&we.index.setValue(Ve+j)}let O=L=>It.shouldExclude(L)||It.excludeTimelinePredicate(L)||L instanceof Xe,te=new Set(x),ie=Array.from(s.dependenciesOf(x,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:O}).boxes).filter(L=>!te.has(L)),be=k.newSet(L=>L);ie.forEach(L=>{L.resource==="preserved"&&N.findBox(L.address.uuid).nonEmpty()&&be.add(L.address.uuid)});let Q=k.newSet(({source:L})=>L);return Q.addMany([...x.map(L=>({source:L.address.uuid,target:k.generate()})),...ie.map(L=>({source:L.address.uuid,target:L.resource==="preserved"?L.address.uuid:k.generate()}))]),M.decodeWith({map:(L,we)=>L.pointerType===_?b.wrap(w):we.flatMap(Ve=>Q.opt(Ve.uuid).match({some:({target:ct})=>b.wrap(Ve.moveTo(ct)),none:()=>N.findBox(Ve.uuid).nonEmpty()?b.wrap(Ve):b.None}))},()=>{x.forEach((L,we)=>{let Ve=new rt(L.toArrayBuffer()),ct=Q.get(L.address.uuid,"uuid mapping").target;N.createBox(L.name,ct,Xn=>{Xn.read(Ve),ni.isIndexedBox(Xn)&&Xn.index.setValue(n+we)})}),ie.forEach(L=>{if(be.hasKey(L.address.uuid))return;let we=new rt(L.toArrayBuffer()),Ve=Q.get(L.address.uuid,"uuid mapping").target;N.createBox(L.name,Ve,ct=>ct.read(we))})}),Mr.Ok}})(pN||(pN={}));var fN;(function(t){t.encode=(e,r={})=>{let n=Ct.create();n.writeInt(Kt.MAGIC_HEADER_OPEN),n.writeInt(Kt.FORMAT_VERSION);let i=co.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i,u=[e],d=r.excludeEffect??(()=>!1),m=r.includeTimeline===!0,x=N=>It.shouldExclude(N)||!m&&It.excludeTimelinePredicate(N)||d(N);a.beginTransaction();let g=Array.from(e.graph.dependenciesOf(u,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:x}).boxes),w={};for(let N of g)w[N.name]=(w[N.name]??0)+1;console.info(`PresetEncoder.encode: includeTimeline=${m}, deps=${g.length}`,w);let _=It.generateMap(u,g,o.audioUnits.address.uuid,s.address.uuid);return It.copyBoxes(_,a,u,g),It.reorderAudioUnits(_,u,o),a.endTransaction(),se.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())},t.encodeEffects=(e,r)=>{let n=Ct.create();n.writeInt(Kt.MAGIC_HEADER_OPEN),n.writeInt(Kt.FORMAT_VERSION);let i=co.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i;a.beginTransaction();let u=r===Kt.ChainKind.Audio?aa.create(a,k.generate()):oa.create(a,k.generate()),d=Xe.create(a,k.generate(),m=>{m.collection.refer(o.audioUnits),m.output.refer(s.input),m.index.setValue(0),m.type.setValue(Ft.Instrument),m.capture.refer(u)});if(Mu.create(a,k.generate(),m=>{m.host.refer(d.input)}),e.length>0){let m=e[0].graph,x=W=>It.shouldExclude(W)||It.excludeTimelinePredicate(W)||W instanceof Xe,g=new Set(e),w=Array.from(m.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:x}).boxes).filter(W=>!g.has(W)),_=k.newSet(({source:W})=>W);_.addMany([...e.map(W=>({source:W.address.uuid,target:k.generate()})),...w.map(W=>({source:W.address.uuid,target:W.resource==="preserved"?W.address.uuid:k.generate()}))]);let N=r===Kt.ChainKind.Audio?d.audioEffects:d.midiEffects,j=r===Kt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost;M.decodeWith({map:(W,O)=>W.pointerType===j?b.wrap(N.address):O.flatMap(te=>_.opt(te.uuid).match({some:({target:ie})=>b.wrap(te.moveTo(ie)),none:()=>a.findBox(te.uuid).nonEmpty()?b.wrap(te):b.None}))},()=>{e.forEach((W,O)=>{let te=new rt(W.toArrayBuffer()),ie=_.get(W.address.uuid,"uuid mapping").target;a.createBox(W.name,ie,be=>{be.read(te),ni.isIndexedBox(be)&&be.index.setValue(O)})}),w.forEach(W=>{let O=new rt(W.toArrayBuffer()),te=_.get(W.address.uuid,"uuid mapping").target;a.createBox(W.name,te,ie=>ie.read(O))})})}return a.endTransaction(),se.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())}})(fN||(fN={}));var mN;(function(t){t.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:r})=>{let n=Ie(r,Xe).input.pointerHub.incoming().at(0);if(n===void 0)return"N/A";let i=n.box;return"label"in i&&i.label instanceof B?i.label.getValue():"N/A"})})(mN||(mN={}));var hN=ke.object({name:ke.string(),bpm:ke.number(),duration:ke.number(),sample_rate:ke.number(),origin:ke.enum(["openDAW","recording","import"]),custom:ke.string().optional()});var poe=hN.extend({uuid:k.zType(ke)});var LR,ZR,GR,HR,qR,JR;LR=new WeakMap,ZR=new WeakMap,GR=new WeakMap,HR=new WeakMap,qR=new WeakMap,JR=new WeakMap;var XR,YR,QR,e2,t2,r2;XR=new WeakMap,YR=new WeakMap,QR=new WeakMap,e2=new WeakMap,t2=new WeakMap,r2=new WeakMap;var i2=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},sr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bs,n2,a2,jm,gN,Cw,CE,Km,o2,zE,vN,xN,OE,yN;n2=new WeakMap,a2=new WeakMap,jm=new WeakMap,gN=new WeakMap,Cw=new WeakMap,CE=new WeakMap,Km=new WeakMap,bs=new WeakSet,o2=function(e){let r=sr(this,Km,"f");i2(this,Km,e.isEmpty()?b.None:b.wrap(e.unwrap()),"f"),r.ifSome(n=>sr(this,bs,"m",zE).call(this,n)),sr(this,Km,"f").ifSome(n=>{r.contains(n)||sr(this,bs,"m",zE).call(this,n)})},zE=function(e){let r=sr(this,gN,"f").hasKey(e.address.uuid)&&!sr(this,Km,"f").contains(e),n=sr(this,Cw,"f").hasKey(e.address.uuid);r!==n&&(r?sr(this,Cw,"f").add({user:e,terminable:sr(this,bs,"m",vN).call(this,e)}):sr(this,Cw,"f").removeByKey(e.address.uuid).terminable.terminate())},vN=function(e){let r=k.newSet(i=>i.box.address.uuid),n=e.selection.pointerHub.catchupAndSubscribe({onAdded:i=>{let a=Ie(i.box,ia);a.selectable.targetVertex.ifSome(o=>{let s=o;r.add({box:a,selectable:s})&&sr(this,bs,"m",xN).call(this,s,e)})},onRemoved:i=>{let a=Ie(i.box,ia),o=r.removeByKeyIfExist(a.address.uuid);K(o)&&sr(this,bs,"m",OE).call(this,o.selectable,e)}},l.Selection);return{terminate:()=>{n.terminate(),r.forEach(i=>sr(this,bs,"m",OE).call(this,i.selectable,e)),r.clear()}}},xN=function(e,r){(sr(this,jm,"f").getOrNull(e.address)??sr(this,bs,"m",yN).call(this,e)).owners.add(r),sr(this,CE,"f").proxy.onSelected(e,r)},OE=function(e,r){let n=sr(this,jm,"f").getOrNull(e.address);K(n)&&(n.owners.removeByKey(r.address.uuid),n.owners.size()===0&&sr(this,jm,"f").removeByKey(e.address),sr(this,CE,"f").proxy.onDeselected(e,r))},yN=function(e){let r={selectable:e,owners:k.newSet(n=>n.address.uuid)};return sr(this,jm,"f").add(r),r};var Rd=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s2,l2,VE,UE,jE,u2,c2,d2;l2=new WeakMap,VE=new WeakMap,UE=new WeakMap,jE=new WeakMap,u2=new WeakMap,c2=new WeakMap,s2=new WeakSet,d2=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:r=>{let n=Ie(r.box,ia);re(n.isAttached(),"SelectionBox is not attached");let i=n.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${n.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),a={box:n,selectable:i};Rd(this,jE,"f").proxy.onSelected(i),re(Rd(this,VE,"f").add(a),"Could not add to entityMap"),re(Rd(this,UE,"f").add(a),"Could not add to selectableMap")},onRemoved:r=>{let n=Ie(r.box,ia),i=Rd(this,VE,"f").removeByKey(n.address.uuid);re(i.box===n,"Broken selection");let a=i.selectable;Rd(this,jE,"f").proxy.onDeselected(a),Rd(this,UE,"f").removeByKey(a.address)}},l.Selection)};var wN=ke.object({name:ke.string(),size:ke.number().int(),url:ke.string(),license:ke.string(),origin:ke.enum(["openDAW","import"])});var Toe=wN.extend({uuid:k.zType(ke)});var bN;(function(t){t.cut=(e,r,n)=>{if(e.position>=r||r>=e.complete)return b.None;if(B_.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return e.duration=r-i,b.wrap(e.copyTo({position:r,duration:a-r,loopOffset:Fs(o+(r-i),s),consolidate:n}))}else return V("Not yet implemented")},t.clip=(e,r,n)=>{if(B_.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return r-i<=0?V(`first part duration will be zero or negative(${r-i})`):a-n<=0?V(`second part duration will be zero or negative(${a-n})`):(e.duration=r-i,e.copyTo({position:n,duration:a-n,loopOffset:Fs(o+(n-i),s)}))}else return V("Not yet implemented")}})(bN||(bN={}));var AN=()=>new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),_N=[{url:"/wasm/plugins/device_vaporisateur.wasm",boxType:"VaporisateurDeviceBox"},{url:"/wasm/plugins/device_nano.wasm",boxType:"NanoDeviceBox"},{url:"/wasm/plugins/device_revamp.wasm",boxType:"RevampDeviceBox"},{url:"/wasm/plugins/device_tidal.wasm",boxType:"TidalDeviceBox"},{url:"/wasm/plugins/device_delay.wasm",boxType:"DelayDeviceBox"},{url:"/wasm/plugins/device_gate.wasm",boxType:"GateDeviceBox"},{url:"/wasm/plugins/device_arpeggio.wasm",boxType:"ArpeggioDeviceBox"},{url:"/wasm/plugins/device_zeitgeist.wasm",boxType:"ZeitgeistDeviceBox"},{url:"/wasm/plugins/device_pitch.wasm",boxType:"PitchDeviceBox"},{url:"/wasm/plugins/device_werkstatt.wasm",boxType:"WerkstattDeviceBox"},{url:"/wasm/plugins/device_apparat.wasm",boxType:"ApparatDeviceBox"},{url:"/wasm/plugins/device_spielwerk.wasm",boxType:"SpielwerkDeviceBox"},{url:"/wasm/plugins/device_waveshaper.wasm",boxType:"WaveshaperDeviceBox"},{url:"/wasm/plugins/device_crusher.wasm",boxType:"CrusherDeviceBox"},{url:"/wasm/plugins/device_fold.wasm",boxType:"FoldDeviceBox"},{url:"/wasm/plugins/device_stereo_tool.wasm",boxType:"StereoToolDeviceBox"},{url:"/wasm/plugins/device_velocity.wasm",boxType:"VelocityDeviceBox"},{url:"/wasm/plugins/device_maximizer.wasm",boxType:"MaximizerDeviceBox"},{url:"/wasm/plugins/device_compressor.wasm",boxType:"CompressorDeviceBox"},{url:"/wasm/plugins/device_reverb.wasm",boxType:"ReverbDeviceBox"},{url:"/wasm/plugins/device_dattorro_reverb.wasm",boxType:"DattorroReverbDeviceBox"},{url:"/wasm/plugins/device_soundfont.wasm",boxType:"SoundfontDeviceBox"},{url:"/wasm/plugins/device_vocoder.wasm",boxType:"VocoderDeviceBox"},{url:"/wasm/plugins/device_neural_amp.wasm",boxType:"NeuralAmpDeviceBox"},{url:"/wasm/plugins/device_playfield_sample.wasm",boxType:"PlayfieldSampleBox"}],p2=[{boxType:"PlayfieldDeviceBox",childrenField:10,indexKey:15,excludeKey:42,cellInstrumentField:0,cellMidiField:0,cellAudioField:0,childEnabledKey:22,childMuteKey:40,childSoloKey:41},{boxType:"CompositeDeviceBox",childrenField:10,indexKey:5,excludeKey:0,cellInstrumentField:2,cellMidiField:3,cellAudioField:4,childEnabledKey:0,childMuteKey:0,childSoloKey:0}],FN=async(t="")=>{let e=[`${t}/wasm/engine.wasm`,..._N.map(a=>`${t}${a.url}`)],r=await Promise.all(e.map(a=>fetch(a).then(o=>o.ok?o.arrayBuffer():Promise.reject(new Error(`Could not load wasm module '${a}' (${o.status} ${o.statusText})`))))),[n,...i]=await Promise.all(r.map(a=>WebAssembly.compile(a)));return{engineModule:n,deviceModules:i,deviceBoxTypes:_N.map(a=>a.boxType),composites:p2}};var EN=(t,e)=>{let r=Ct.create();return r.writeInt(t.length),t.forEach(n=>{if(r.writeString(n.type),n.type==="new")k.toDataOutput(r,n.uuid),r.writeString(n.name),r.writeInt(n.buffer.byteLength),r.writeBytes(new Int8Array(n.buffer));else if(n.type==="update-primitive"){let i=Re.reconstruct(n.address);i.write(r);let o=e.findVertex(i).unwrap(()=>`no field at ${i}`).serialization();r.writeString(o.type),o.encode(r,n.value)}else n.type==="update-pointer"?(Re.reconstruct(n.address).write(r),K(n.target)?(r.writeBoolean(!0),Re.reconstruct(n.target).write(r)):r.writeBoolean(!1)):n.type==="delete"&&k.toDataOutput(r,n.uuid)}),r.toArrayBuffer()};var zw=class{#e;#t;#r;#i;#n=new Map;#a=[];constructor(e,r){this.#e=e,this.#t=new Uint32Array(r,0,2),this.#r=new Uint32Array(r,8),this.#i=(this.#r.length>>1)-1}send(e,r,n){let i=this.#n.get(e);if(th(i)){if(i=this.#a.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#n.set(e,i),this.#a.push(e),this.#e.postMessage({registerDevice:e,id:i})}let a=Atomics.load(this.#t,0),o=a+1&this.#i;if(o===Atomics.load(this.#t,1))return!1;let s=r.length,u=r[0]??0,d=r[1]??0,m=r[2]??0,x=s<<30|i<<24|u<<16|d<<8|m,g=n|0,w=a<<1;return this.#r[w]=x,this.#r[w+1]=g,Atomics.store(this.#t,0,o),this.#e.postMessage(null),!0}};var Ow=t=>{let e="",r=0,n=()=>(t[r++]??0)&63;for(;r<t.length;){let i=t[r++]??0,a=i<128?i:(i&224)===192?(i&31)<<6|n():(i&240)===224?(i&15)<<12|n()<<6|n():(i&248)===240?(i&7)<<18|n()<<12|n()<<6|n():65533;e+=a<=1114111?String.fromCodePoint(a):"\uFFFD"}return e};var KE=16,Vw=class{#e=new Map;#t=[new Uint8Array(1),new Uint8Array(2),new Uint8Array(3)];#r=null;connect(e,r){this.#r=new zw(e,r)}drain(e,r){let n=e.midi_out_count();if(n===0)return;let i=e.input_reserve(n*KE),a=e.midi_out_take(i),o=this.#r;if(o===null)return;let s=new Uint8Array(r.buffer,i,a*KE).slice(),u=new DataView(s.buffer);for(let d=0;d<a;d++){let m=d*KE,x=u.getUint32(m,!0),g=Math.min(Math.max(u.getUint8(m+7),1),3),w=u.getFloat64(m+8,!0),_=this.#t[g-1];_[0]=u.getUint8(m+4),g>1&&(_[1]=u.getUint8(m+5)),g>2&&(_[2]=u.getUint8(m+6)),o.send(this.#i(e,r,x),_,w)}}#i(e,r,n){let i=this.#e.get(n);if(K(i))return i;let a=e.input_reserve(256),o=e.midi_out_device_id(n,a,256),s=o===0?"":Ow(new Uint8Array(r.buffer,a,o));return this.#e.set(n,s),s}};var SN=(t,e)=>{let r=t.panic_message_len();return r===0?"":Ow(new Uint8Array(e.buffer,t.panic_message_ptr(),r))};var f2=["host_pull_events","host_pulse_to_offset","host_bind_parameter","host_bind_broadcast","host_broadcast_ptr","host_broadcast_active","host_update_parameters","host_first_update_position","host_next_update_position","host_resolve_sample","host_observe_sample","host_resolve_soundfont","host_observe_soundfont","host_observe_field","host_observe_target_string","host_bind_sidechain","host_resolve_input","host_self_uuid","host_panic","host_base_frequency"],Uw=(t,e)=>{let r=0,n=0,i=e;for(;;){let a=t[i++];if(r|=(a&127)<<n,(a&128)===0)break;n+=7}return[r>>>0,i]},m2=t=>{let e=WebAssembly.Module.customSections(t,"dylink.0");if(e.length===0)return{memorySize:0,tableSize:0};let r=new Uint8Array(e[0]),n=0;for(;n<r.length;){let i=r[n++],[a,o]=Uw(r,n);if(i===1){let[s,u]=Uw(r,o),[,d]=Uw(r,u),[m]=Uw(r,d);return{memorySize:s,tableSize:m}}n=o+a}return{memorySize:0,tableSize:0}},PN=(t,e,r)=>{let n=r.length,i=t.input_reserve(n),a=new Uint8Array(e.buffer,i,n);for(let o=0;o<n;o++)a[o]=r.charCodeAt(o)&255;return n},$N=(t,e,r,n,i,a,o)=>{let{memorySize:s,tableSize:u}=m2(n),d=t.device_alloc(s),m=u>0?r.grow(u):r.length,x=t.device_alloc(262144),g={memory:e,__indirect_function_table:r,__memory_base:new WebAssembly.Global({value:"i32",mutable:!1},d),__table_base:new WebAssembly.Global({value:"i32",mutable:!1},m),__stack_pointer:new WebAssembly.Global({value:"i32",mutable:!0},x+262144)};for(let W of f2){let O=t[W];if(typeof O!="function")throw new Error(`engine is missing the device host export '${W}'`);g[W]=O}Object.assign(g,o);let w=new WebAssembly.Instance(n,{env:g}).exports;w.__wasm_apply_data_relocs?.(),w.__wasm_call_ctors?.();let _=W=>{if(W===void 0)return 0;let O=r.grow(1);return r.set(O,W),O},N=r.grow(1);r.set(N,w.process_events??w.process);let j=t.device_register(N,w.state_size(a),w.kind(),_(w.init),_(w.parameter_changed),_(w.field_changed),_(w.sample_changed),_(w.soundfont_changed),_(w.reset),_(w.terminate),w.midi_effects_field?.()??0,w.audio_effects_field?.()??0,w.observe_param_collection_field?.()??0,w.observe_sample_collection_field?.()??0);t.device_set_box_type(j,PN(t,e,i))},kN=(t,e,r)=>{t.composite_register(PN(t,e,r.boxType),r.childrenField,r.indexKey,r.excludeKey,r.cellInstrumentField,r.cellMidiField,r.cellAudioField,r.childEnabledKey,r.childMuteKey,r.childSoloKey)};var h2=1,jw=class{retained=[];scheduled=[];sourceToOutput=new Map;reset(){this.retained.length=0,this.scheduled.length=0,this.sourceToOutput.clear()}},g2=(t,e,r,n,i,a,o,s,u)=>{let d=e*40;t.setFloat64(d+0,n,!0),t.setUint32(d+8,0,!0),t.setUint32(d+12,r,!0),t.setUint32(d+16,i,!0),t.setUint32(d+20,a,!0),t.setFloat32(d+24,o,!0),t.setFloat32(d+28,s,!0),t.setFloat64(d+32,u,!0)},v2=(t,e)=>t==null?"process yielded undefined":typeof t.pitch!="number"||t.pitch!==t.pitch?`Invalid pitch: ${t.pitch}`:t.pitch<0||t.pitch>127?`Pitch out of range: ${t.pitch} (must be 0-127)`:typeof t.velocity!="number"||t.velocity!==t.velocity?`Invalid velocity: ${t.velocity}`:t.velocity<0||t.velocity>1?`Velocity out of range: ${t.velocity} (must be 0-1)`:typeof t.duration!="number"||t.duration!==t.duration?`Invalid duration: ${t.duration}`:t.duration<=0?`Duration must be positive: ${t.duration}`:typeof t.position!="number"||t.position!==t.position?`Invalid position: ${t.position}`:t.position<e?`Position ${t.position} is in the past (block starts at ${e})`:null,NN=(t,e,r,n,i,a,o,s,u,d,m,x,g)=>{let w=new DataView(r,n,i*40),_=new DataView(r,a,o*40),N=0,j=(Q,L,we,Ve,ct,Xn,He)=>{if(N>=o)throw new Error(`Note flood: exceeded ${o} output notes per range`);g2(_,N++,Q,L,we,Ve,ct,Xn,He)};for(let Q=t.retained.length-1;Q>=0;Q--){let L=t.retained[Q],we=L.position+L.duration;we<u&&(t.retained.splice(Q,1),j(1,we,L.id,L.pitch,0,0,0))}let W=[];for(let Q=0;Q<i;Q++){let L=Q*40,we=w.getUint32(L+12,!0),Ve=w.getUint32(L+16,!0),ct=w.getFloat64(L+0,!0),Xn=w.getUint32(L+20,!0);if(we===0)W.push({gate:!0,id:Ve,position:ct,duration:w.getFloat64(L+32,!0),pitch:Xn,velocity:w.getFloat32(L+24,!0),cent:w.getFloat32(L+28,!0)});else if(we===1){let He=t.sourceToOutput.get(Ve);if(He!==void 0){for(let $t of He){let Zm=t.retained.findIndex(ru=>ru.id===$t);if(Zm>=0){let ru=t.retained.splice(Zm,1)[0];j(1,ct,ru.id,ru.pitch,0,0,0)}}t.sourceToOutput.delete(Ve)}W.push({gate:!1,id:Ve,position:ct,pitch:Xn})}}for(let Q=t.scheduled.length-1;Q>=0;Q--){let L=t.scheduled[Q];L.position>=s&&L.position<u&&(t.scheduled.splice(Q,1),j(0,L.position,MN(t,L),L.pitch,L.velocity,L.cent,L.duration))}let O=-1,te={[Symbol.iterator](){let Q=0;return{next(){if(Q>=W.length)return O=-1,{done:!0,value:void 0};let L=W[Q++];return L.gate&&(O=L.id),{done:!1,value:L}}}}},ie={from:s,to:u,bpm:d,s0:x,s1:g,flags:m},be=0;for(let Q of e.process(ie,te)){if(++be>128)throw new Error("Note flood: exceeded 128 notes per block");let L=v2(Q,s);if(L!==null)throw new Error(L);let we={position:Q.position,duration:Q.duration,pitch:Q.pitch,velocity:Q.velocity,cent:Q.cent??0};if(we.position>=u){if(t.scheduled.length>=128)throw new Error("Scheduler full: exceeded 128 scheduled notes");t.scheduled.push(we)}else{let Ve=MN(t,we);if(O>=0){let ct=t.sourceToOutput.get(O);ct===void 0&&(ct=new Set,t.sourceToOutput.set(O,ct)),ct.add(Ve)}j(0,we.position,Ve,we.pitch,we.velocity,we.cent,we.duration)}}return N},MN=(t,e)=>{let r=h2++;return t.retained.push({id:r,position:e.position,duration:e.duration,pitch:e.pitch,velocity:e.velocity,cent:e.cent}),r};var Kw=128,x2=375,WE=0,BN=1,TN=2,y2={[WE]:"apparatProcessors",[BN]:"werkstattProcessors",[TN]:"spielwerkProcessors"},w2=0,IN=1e3,LE=class{constructor(e,r,n){this.uuid=e;this.kind=r;this.registryName=n}proc=null;currentUpdate=-1;silenced=!1;paramMappings=new Map;rawParams=new Map;sampleLabels=new Map;sampleHandles=new Map;limiter=null;spielwerk=null;missingCalls=0;warnedMissing=!1},b2=t=>{switch(t.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(t.min,t.max);case"exp":return E.exponential(t.min,t.max);case"int":return E.linearInteger(t.min,t.max);case"bool":return E.linearInteger(0,1);default:return E.unipolar()}},_2=(t,e,r)=>{for(let n=0;n<t.length;n++){let i=t[n];for(let a=e;a<r;a++){let o=i[a];if(o!==o)return`NaN detected in output channel ${n} at sample ${a}`;if(o>IN||o<-IN)return`Signal overflow in channel ${n} at sample ${a} (amplitude: ${o.toFixed(1)})`}}return null},Ww=class{#e;#t;#r;#i;#n=new Map;#a=new Map;#o=1;constructor(e,r,n,i=()=>{}){this.#e=e,this.#t=r,this.#r=n,this.#i=i}imports(){return{host_script_create:(e,r,n)=>this.#s(e,r,n),host_script_audio:(e,r,n,i,a,o,s,u,d,m,x,g)=>this.#l(e,r,n,i,a,o,s,u,d,m,x,g),host_script_note_on:(e,r,n,i,a)=>this.#c(e,r,n,i,a),host_script_note_off:(e,r)=>this.#h(e,r),host_script_reset:e=>this.#v(e),host_script_param:(e,r,n,i)=>this.#g(e,r,n,i),host_script_sample:(e,r,n,i)=>this.#p(e,r,n,i),host_script_notes:(e,r,n,i,a,o,s,u,d,m,x)=>this.#y(e,r,n,i,a,o,s,u,d,m,x),host_script_release:e=>this.#m(e)}}#s(e,r,n){let i=k.toString(new Uint8Array(this.#e.buffer,e,16).slice()),a=this.#a.get(i);K(a)&&this.#m(a);let o=this.#o++;return this.#n.set(o,new LE(i,r,y2[r]??"werkstattProcessors")),this.#a.set(i,o),o}#u(e){let r=globalThis.openDAW?.[e.registryName]?.[e.uuid];if(r===void 0&&e.currentUpdate===-1)return!e.warnedMissing&&++e.missingCalls>x2&&(e.warnedMissing=!0,this.#i(e.uuid,`No Processor registered at globalThis.openDAW.${e.registryName}[${e.uuid}] \u2014 device is rendering silence`)),null;if(r!==void 0&&r.update!==e.currentUpdate)try{let n=new r.create;if(e.paramMappings=new Map(r.params.map(i=>[i.index,{label:i.label,mapping:b2(i)}])),e.sampleLabels=new Map(r.samples.map(i=>[i.index,i.label])),e.kind===WE){n.samples={};for(let i of e.sampleLabels.values())n.samples[i]=null;e.limiter??=new wh(this.#r)}e.kind===TN&&(e.spielwerk=new jw),e.proc=n,e.currentUpdate=r.update,e.silenced=!1;for(let[i,a]of e.rawParams)this.#d(e,i,a.kind,a.value);for(let[i,a]of e.sampleHandles)this.#f(e,i,a)}catch(n){this.#x(e,`Failed to instantiate Processor: ${n}`)}return e.silenced?null:e.proc}#l(e,r,n,i,a,o,s,u,d,m,x,g){let w=this.#n.get(e);if(w===void 0)return 1;let _=this.#u(w);if(_===null)return 1;let N=this.#e.buffer,j=new Float32Array(N,i,Kw),W=new Float32Array(N,a,Kw),O={index:u,p0:d,p1:m,s0:o,s1:s,bpm:x,flags:g};try{if(w.kind===BN){let ie={src:[new Float32Array(N,r,Kw),new Float32Array(N,n,Kw)],out:[j,W]};_.process(ie,O)}else{for(let[ie,be]of w.sampleHandles)this.#f(w,ie,be);j.fill(0,o,s),W.fill(0,o,s),_.process([j,W],O)}}catch(ie){return this.#x(w,`Runtime error: ${ie}`),1}let te=_2([j,W],o,s);return te!==null?(j.fill(0,o,s),W.fill(0,o,s),this.#x(w,te),1):(w.kind===WE&&w.limiter!==null&&w.limiter.replace({channels:()=>[j,W]},o,s),0)}#c(e,r,n,i,a){let o=this.#n.get(e);o!==void 0&&this.#u(o)?.noteOn?.(r,n,i,a)}#h(e,r){let n=this.#n.get(e);n!==void 0&&this.#u(n)?.noteOff?.(r)}#v(e){let r=this.#n.get(e);r?.proc?.reset?.(),r?.spielwerk?.reset()}#g(e,r,n,i){let a=this.#n.get(e);a!==void 0&&(a.rawParams.set(r,{kind:n,value:i}),this.#d(a,r,n,i))}#d(e,r,n,i){let a=e.paramMappings.get(r);if(a===void 0)return;let o=n===w2?a.mapping.y(i):i;e.proc?.paramChanged?.(a.label,o)}#p(e,r,n,i){let a=this.#n.get(e);if(a===void 0)return;let o=i!==0?n:-1;a.sampleHandles.set(r,o),this.#f(a,r,o)}#y(e,r,n,i,a,o,s,u,d,m,x){let g=this.#n.get(e);if(g===void 0)return 0;let w=this.#u(g);if(w===null||g.spielwerk===null)return 0;try{return NN(g.spielwerk,w,this.#e.buffer,r,n,i,a,o,s,u,d,m,x)}catch(_){return this.#x(g,`Runtime error: ${_}`),0}}#f(e,r,n){if(e.proc===null)return;let i=e.sampleLabels.get(r);if(i===void 0)return;if(n<0){e.proc.samples[i]=null;return}let a=this.#t.input_reserve(16);if(this.#t.host_resolve_sample(n,a)===0){e.proc.samples[i]=null;return}let o=new DataView(this.#e.buffer,a,16),s=o.getUint32(0,!0),u=o.getUint32(4,!0),d=o.getUint32(8,!0),m=o.getFloat32(12,!0),x=[];for(let g=0;g<d;g++)x.push(new Float32Array(this.#e.buffer,s+g*u*4,u));e.proc.samples[i]={sampleRate:m,numberOfFrames:u,numberOfChannels:d,frames:x}}#x(e,r){e.silenced=!0,this.#i(e.uuid,r)}#m(e){let r=this.#n.get(e);K(r)&&(this.#n.delete(e),this.#a.get(r.uuid)===e&&this.#a.delete(r.uuid))}liveBridgeCount(){return this.#n.size}};var Lw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},tt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Pt,eu,tu,Wm,Lm=class t{constructor(e,r=128){if(Pt.set(this,void 0),eu.set(this,void 0),tu.set(this,void 0),Wm.set(this,void 0),Lw(this,Pt,e,"f"),Lw(this,Wm,r,"f"),Lw(this,eu,e._malloc(r*4),"f"),Lw(this,tu,e._malloc(r*4),"f"),tt(this,eu,"f")===0||tt(this,tu,"f")===0)throw new Error("Failed to allocate audio buffers")}static async create(e,r=128){let n=await e();return new t(n,r)}static fromModule(e,r=128){return new t(e,r)}dispose(){tt(this,Pt,"f")._free(tt(this,eu,"f")),tt(this,Pt,"f")._free(tt(this,tu,"f"))}createInstance(){return tt(this,Pt,"f")._nam_createInstance()}destroyInstance(e){tt(this,Pt,"f")._nam_destroyInstance(e)}getInstanceCount(){return tt(this,Pt,"f")._nam_getInstanceCount()}loadModel(e,r){let n=tt(this,Pt,"f").lengthBytesUTF8(r)+1,i=tt(this,Pt,"f")._malloc(n);if(i===0)return!1;try{return tt(this,Pt,"f").stringToUTF8(r,i,n),tt(this,Pt,"f")._nam_loadModel(e,i)}finally{tt(this,Pt,"f")._free(i)}}unloadModel(e){tt(this,Pt,"f")._nam_unloadModel(e)}hasModel(e){return tt(this,Pt,"f")._nam_hasModel(e)}process(e,r,n){let i=Math.min(r.length,n.length,tt(this,Wm,"f")),a=tt(this,eu,"f")>>2,o=tt(this,tu,"f")>>2;tt(this,Pt,"f").HEAPF32.set(r.subarray(0,i),a),tt(this,Pt,"f")._nam_process(e,tt(this,eu,"f"),tt(this,tu,"f"),i),n.set(tt(this,Pt,"f").HEAPF32.subarray(o,o+i))}processInPlace(e,r){this.process(e,r,r)}setSampleRate(e){tt(this,Pt,"f")._nam_setSampleRate(e)}getSampleRate(){return tt(this,Pt,"f")._nam_getSampleRate()}setMaxBufferSize(e){tt(this,Pt,"f")._nam_setMaxBufferSize(e)}getMaxBufferSize(){return tt(this,Pt,"f")._nam_getMaxBufferSize()}getModelLoudness(e){return tt(this,Pt,"f")._nam_getModelLoudness(e)}hasModelLoudness(e){return tt(this,Pt,"f")._nam_hasModelLoudness(e)}reset(e){tt(this,Pt,"f")._nam_reset(e)}get bufferSize(){return tt(this,Wm,"f")}};Pt=new WeakMap,eu=new WeakMap,tu=new WeakMap,Wm=new WeakMap;var ZE;(function(t){t.parse=e=>JSON.parse(e),t.isArchitecture2=e=>e.architecture==="WaveNet"&&e.config.layers!==void 0&&e.config.layers.some(r=>r.gating_mode!==void 0||r.bottleneck!==void 0)})(ZE||(ZE={}));var A2=(()=>{var t=import.meta.url;return(function(e={}){var r=e,n,i;r.ready=new Promise((c,f)=>{n=c,i=f});var a=Object.assign({},r),o=[],s="./this.program",u=(c,f)=>{throw f},d=typeof window=="object",m=typeof importScripts=="function",x=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",g="";function w(c){return r.locateFile?r.locateFile(c,g):g+c}var _,N,j;(d||m)&&(m?g=self.location.href:typeof document<"u"&&document.currentScript&&(g=document.currentScript.src),t&&(g=t),g.indexOf("blob:")!==0?g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):g="",_=c=>{var f=new XMLHttpRequest;return f.open("GET",c,!1),f.send(null),f.responseText},m&&(j=c=>{var f=new XMLHttpRequest;return f.open("GET",c,!1),f.responseType="arraybuffer",f.send(null),new Uint8Array(f.response)}),N=(c,f,h)=>{var y=new XMLHttpRequest;y.open("GET",c,!0),y.responseType="arraybuffer",y.onload=()=>{if(y.status==200||y.status==0&&y.response){f(y.response);return}h()},y.onerror=h,y.send(null)});var W=r.print||console.log.bind(console),O=r.printErr||console.error.bind(console);Object.assign(r,a),a=null,r.arguments&&(o=r.arguments),r.thisProgram&&(s=r.thisProgram),r.quit&&(u=r.quit);var te;r.wasmBinary&&(te=r.wasmBinary),typeof WebAssembly!="object"&&iu("no native wasm support detected");var ie,be=!1,Q;function L(c,f){c||iu(f)}var we,Ve,ct,Xn,He,$t,Zm,ru;function XE(){var c=ie.buffer;r.HEAP8=we=new Int8Array(c),r.HEAP16=ct=new Int16Array(c),r.HEAPU8=Ve=new Uint8Array(c),r.HEAPU16=Xn=new Uint16Array(c),r.HEAP32=He=new Int32Array(c),r.HEAPU32=$t=new Uint32Array(c),r.HEAPF32=Zm=new Float32Array(c),r.HEAPF64=ru=new Float64Array(c)}var YE=[],QE=[],eS=[],jN=!1;function KN(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)ZN(r.preRun.shift());Xw(YE)}function WN(){jN=!0,!r.noFSInit&&!v.init.initialized&&v.init(),v.ignorePermissions=!1,po.init(),Xw(QE)}function LN(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)HN(r.postRun.shift());Xw(eS)}function ZN(c){YE.unshift(c)}function GN(c){QE.unshift(c)}function HN(c){eS.unshift(c)}var _s=0,qw=null,Od=null;function k2(c){return c}function Jw(c){_s++,r.monitorRunDependencies?.(_s)}function Gm(c){if(_s--,r.monitorRunDependencies?.(_s),_s==0&&(qw!==null&&(clearInterval(qw),qw=null),Od)){var f=Od;Od=null,f()}}function iu(c){r.onAbort?.(c),c="Aborted("+c+")",O(c),be=!0,Q=1,c+=". Build with -sASSERTIONS for more info.";var f=new WebAssembly.RuntimeError(c);throw i(f),f}var qN="data:application/octet-stream;base64,",tS=c=>c.startsWith(qN),As;r.locateFile?(As="nam.wasm",tS(As)||(As=w(As))):As=new URL("nam.wasm",import.meta.url).href;function rS(c){if(c==As&&te)return new Uint8Array(te);if(j)return j(c);throw"both async and sync fetching of the wasm failed"}function JN(c){return!te&&(d||m)&&typeof fetch=="function"?fetch(c,{credentials:"same-origin"}).then(f=>{if(!f.ok)throw"failed to load wasm binary file at '"+c+"'";return f.arrayBuffer()}).catch(()=>rS(c)):Promise.resolve().then(()=>rS(c))}function iS(c,f,h){return JN(c).then(y=>WebAssembly.instantiate(y,f)).then(y=>y).then(h,y=>{O(`failed to asynchronously prepare wasm: ${y}`),iu(y)})}function XN(c,f,h,y){return!c&&typeof WebAssembly.instantiateStreaming=="function"&&!tS(f)&&typeof fetch=="function"?fetch(f,{credentials:"same-origin"}).then(A=>{var T=WebAssembly.instantiateStreaming(A,h);return T.then(y,function(C){return O(`wasm streaming compile failed: ${C}`),O("falling back to ArrayBuffer instantiation"),iS(f,h,y)})}):iS(f,h,y)}function YN(){var c={a:II};function f(y,A){return ft=y.exports,ie=ft.l,XE(),GN(ft.m),Gm("wasm-instantiate"),ft}Jw("wasm-instantiate");function h(y){f(y.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(c,f)}catch(y){O(`Module.instantiateWasm callback failed with error: ${y}`),i(y)}return XN(te,As,c,h).catch(i),{}}var qe,hr,Xw=c=>{for(;c.length>0;)c.shift()(r)},M2=r.noExitRuntime||!0;function QN(c){this.excPtr=c,this.ptr=c-24,this.set_type=function(f){$t[this.ptr+4>>2]=f},this.get_type=function(){return $t[this.ptr+4>>2]},this.set_destructor=function(f){$t[this.ptr+8>>2]=f},this.get_destructor=function(){return $t[this.ptr+8>>2]},this.set_caught=function(f){f=f?1:0,we[this.ptr+12>>0]=f},this.get_caught=function(){return we[this.ptr+12>>0]!=0},this.set_rethrown=function(f){f=f?1:0,we[this.ptr+13>>0]=f},this.get_rethrown=function(){return we[this.ptr+13>>0]!=0},this.init=function(f,h){this.set_adjusted_ptr(0),this.set_type(f),this.set_destructor(h)},this.set_adjusted_ptr=function(f){$t[this.ptr+16>>2]=f},this.get_adjusted_ptr=function(){return $t[this.ptr+16>>2]},this.get_exception_ptr=function(){var f=vS(this.get_type());if(f)return $t[this.excPtr>>2];var h=this.get_adjusted_ptr();return h!==0?h:this.excPtr}}var nS=0,eI=0,tI=(c,f,h)=>{var y=new QN(c);throw y.init(f,h),nS=c,eI++,nS},rI=()=>{iu("")},iI=(c,f,h)=>Ve.copyWithin(c,f,f+h),nI=()=>536870912,aI=c=>{var f=ie.buffer,h=(c-f.byteLength+65535)/65536;try{return ie.grow(h),XE(),1}catch{}},oI=c=>{var f=Ve.length;c>>>=0;var h=nI();if(c>h)return!1;for(var y=(ae,Ne)=>ae+(Ne-ae%Ne)%Ne,A=1;A<=4;A*=2){var T=f*(1+.2/A);T=Math.min(T,c+100663296);var C=Math.min(h,y(Math.max(c,T),65536)),U=aI(C);if(U)return!0}return!1},Yw={},sI=()=>s||"./this.program",Vd=()=>{if(!Vd.strings){var c=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",f={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:c,_:sI()};for(var h in Yw)Yw[h]===void 0?delete f[h]:f[h]=Yw[h];var y=[];for(var h in f)y.push(`${h}=${f[h]}`);Vd.strings=y}return Vd.strings},lI=(c,f)=>{for(var h=0;h<c.length;++h)we[f++>>0]=c.charCodeAt(h);we[f>>0]=0},ut={isAbs:c=>c.charAt(0)==="/",splitPath:c=>{var f=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return f.exec(c).slice(1)},normalizeArray:(c,f)=>{for(var h=0,y=c.length-1;y>=0;y--){var A=c[y];A==="."?c.splice(y,1):A===".."?(c.splice(y,1),h++):h&&(c.splice(y,1),h--)}if(f)for(;h;h--)c.unshift("..");return c},normalize:c=>{var f=ut.isAbs(c),h=c.substr(-1)==="/";return c=ut.normalizeArray(c.split("/").filter(y=>!!y),!f).join("/"),!c&&!f&&(c="."),c&&h&&(c+="/"),(f?"/":"")+c},dirname:c=>{var f=ut.splitPath(c),h=f[0],y=f[1];return!h&&!y?".":(y&&(y=y.substr(0,y.length-1)),h+y)},basename:c=>{if(c==="/")return"/";c=ut.normalize(c),c=c.replace(/\/$/,"");var f=c.lastIndexOf("/");return f===-1?c:c.substr(f+1)},join:function(){var c=Array.prototype.slice.call(arguments);return ut.normalize(c.join("/"))},join2:(c,f)=>ut.normalize(c+"/"+f)},uI=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return c=>crypto.getRandomValues(c);iu("initRandomDevice")},aS=c=>(aS=uI())(c),Ba={resolve:function(){for(var c="",f=!1,h=arguments.length-1;h>=-1&&!f;h--){var y=h>=0?arguments[h]:v.cwd();if(typeof y!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!y)return"";c=y+"/"+c,f=ut.isAbs(y)}return c=ut.normalizeArray(c.split("/").filter(A=>!!A),!f).join("/"),(f?"/":"")+c||"."},relative:(c,f)=>{c=Ba.resolve(c).substr(1),f=Ba.resolve(f).substr(1);function h(Ne){for(var Le=0;Le<Ne.length&&Ne[Le]==="";Le++);for(var nt=Ne.length-1;nt>=0&&Ne[nt]==="";nt--);return Le>nt?[]:Ne.slice(Le,nt-Le+1)}for(var y=h(c.split("/")),A=h(f.split("/")),T=Math.min(y.length,A.length),C=T,U=0;U<T;U++)if(y[U]!==A[U]){C=U;break}for(var ae=[],U=C;U<y.length;U++)ae.push("..");return ae=ae.concat(A.slice(C)),ae.join("/")}},oS=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,nu=(c,f,h)=>{for(var y=f+h,A=f;c[A]&&!(A>=y);)++A;if(A-f>16&&c.buffer&&oS)return oS.decode(c.subarray(f,A));for(var T="";f<A;){var C=c[f++];if(!(C&128)){T+=String.fromCharCode(C);continue}var U=c[f++]&63;if((C&224)==192){T+=String.fromCharCode((C&31)<<6|U);continue}var ae=c[f++]&63;if((C&240)==224?C=(C&15)<<12|U<<6|ae:C=(C&7)<<18|U<<12|ae<<6|c[f++]&63,C<65536)T+=String.fromCharCode(C);else{var Ne=C-65536;T+=String.fromCharCode(55296|Ne>>10,56320|Ne&1023)}}return T},Qw=[],Hm=c=>{for(var f=0,h=0;h<c.length;++h){var y=c.charCodeAt(h);y<=127?f++:y<=2047?f+=2:y>=55296&&y<=57343?(f+=4,++h):f+=3}return f},eb=(c,f,h,y)=>{if(!(y>0))return 0;for(var A=h,T=h+y-1,C=0;C<c.length;++C){var U=c.charCodeAt(C);if(U>=55296&&U<=57343){var ae=c.charCodeAt(++C);U=65536+((U&1023)<<10)|ae&1023}if(U<=127){if(h>=T)break;f[h++]=U}else if(U<=2047){if(h+1>=T)break;f[h++]=192|U>>6,f[h++]=128|U&63}else if(U<=65535){if(h+2>=T)break;f[h++]=224|U>>12,f[h++]=128|U>>6&63,f[h++]=128|U&63}else{if(h+3>=T)break;f[h++]=240|U>>18,f[h++]=128|U>>12&63,f[h++]=128|U>>6&63,f[h++]=128|U&63}}return f[h]=0,h-A};function qm(c,f,h){var y=h>0?h:Hm(c)+1,A=new Array(y),T=eb(c,A,0,A.length);return f&&(A.length=T),A}var cI=()=>{if(!Qw.length){var c=null;if(typeof window<"u"&&typeof window.prompt=="function"?(c=window.prompt("Input: "),c!==null&&(c+=`
|
|
82
|
+
`)):typeof readline=="function"&&(c=readline(),c!==null&&(c+=`
|
|
83
|
+
`)),!c)return null;Qw=qm(c,!0)}return Qw.shift()},po={ttys:[],init(){},shutdown(){},register(c,f){po.ttys[c]={input:[],output:[],ops:f},v.registerDevice(c,po.stream_ops)},stream_ops:{open(c){var f=po.ttys[c.node.rdev];if(!f)throw new v.ErrnoError(43);c.tty=f,c.seekable=!1},close(c){c.tty.ops.fsync(c.tty)},fsync(c){c.tty.ops.fsync(c.tty)},read(c,f,h,y,A){if(!c.tty||!c.tty.ops.get_char)throw new v.ErrnoError(60);for(var T=0,C=0;C<y;C++){var U;try{U=c.tty.ops.get_char(c.tty)}catch{throw new v.ErrnoError(29)}if(U===void 0&&T===0)throw new v.ErrnoError(6);if(U==null)break;T++,f[h+C]=U}return T&&(c.node.timestamp=Date.now()),T},write(c,f,h,y,A){if(!c.tty||!c.tty.ops.put_char)throw new v.ErrnoError(60);try{for(var T=0;T<y;T++)c.tty.ops.put_char(c.tty,f[h+T])}catch{throw new v.ErrnoError(29)}return y&&(c.node.timestamp=Date.now()),T}},default_tty_ops:{get_char(c){return cI()},put_char(c,f){f===null||f===10?(W(nu(c.output,0)),c.output=[]):f!=0&&c.output.push(f)},fsync(c){c.output&&c.output.length>0&&(W(nu(c.output,0)),c.output=[])},ioctl_tcgets(c){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(c,f,h){return 0},ioctl_tiocgwinsz(c){return[24,80]}},default_tty1_ops:{put_char(c,f){f===null||f===10?(O(nu(c.output,0)),c.output=[]):f!=0&&c.output.push(f)},fsync(c){c.output&&c.output.length>0&&(O(nu(c.output,0)),c.output=[])}}},sS=c=>{iu()},De={ops_table:null,mount(c){return De.createNode(null,"/",16895,0)},createNode(c,f,h,y){if(v.isBlkdev(h)||v.isFIFO(h))throw new v.ErrnoError(63);De.ops_table||={dir:{node:{getattr:De.node_ops.getattr,setattr:De.node_ops.setattr,lookup:De.node_ops.lookup,mknod:De.node_ops.mknod,rename:De.node_ops.rename,unlink:De.node_ops.unlink,rmdir:De.node_ops.rmdir,readdir:De.node_ops.readdir,symlink:De.node_ops.symlink},stream:{llseek:De.stream_ops.llseek}},file:{node:{getattr:De.node_ops.getattr,setattr:De.node_ops.setattr},stream:{llseek:De.stream_ops.llseek,read:De.stream_ops.read,write:De.stream_ops.write,allocate:De.stream_ops.allocate,mmap:De.stream_ops.mmap,msync:De.stream_ops.msync}},link:{node:{getattr:De.node_ops.getattr,setattr:De.node_ops.setattr,readlink:De.node_ops.readlink},stream:{}},chrdev:{node:{getattr:De.node_ops.getattr,setattr:De.node_ops.setattr},stream:v.chrdev_stream_ops}};var A=v.createNode(c,f,h,y);return v.isDir(A.mode)?(A.node_ops=De.ops_table.dir.node,A.stream_ops=De.ops_table.dir.stream,A.contents={}):v.isFile(A.mode)?(A.node_ops=De.ops_table.file.node,A.stream_ops=De.ops_table.file.stream,A.usedBytes=0,A.contents=null):v.isLink(A.mode)?(A.node_ops=De.ops_table.link.node,A.stream_ops=De.ops_table.link.stream):v.isChrdev(A.mode)&&(A.node_ops=De.ops_table.chrdev.node,A.stream_ops=De.ops_table.chrdev.stream),A.timestamp=Date.now(),c&&(c.contents[f]=A,c.timestamp=A.timestamp),A},getFileDataAsTypedArray(c){return c.contents?c.contents.subarray?c.contents.subarray(0,c.usedBytes):new Uint8Array(c.contents):new Uint8Array(0)},expandFileStorage(c,f){var h=c.contents?c.contents.length:0;if(!(h>=f)){var y=1024*1024;f=Math.max(f,h*(h<y?2:1.125)>>>0),h!=0&&(f=Math.max(f,256));var A=c.contents;c.contents=new Uint8Array(f),c.usedBytes>0&&c.contents.set(A.subarray(0,c.usedBytes),0)}},resizeFileStorage(c,f){if(c.usedBytes!=f)if(f==0)c.contents=null,c.usedBytes=0;else{var h=c.contents;c.contents=new Uint8Array(f),h&&c.contents.set(h.subarray(0,Math.min(f,c.usedBytes))),c.usedBytes=f}},node_ops:{getattr(c){var f={};return f.dev=v.isChrdev(c.mode)?c.id:1,f.ino=c.id,f.mode=c.mode,f.nlink=1,f.uid=0,f.gid=0,f.rdev=c.rdev,v.isDir(c.mode)?f.size=4096:v.isFile(c.mode)?f.size=c.usedBytes:v.isLink(c.mode)?f.size=c.link.length:f.size=0,f.atime=new Date(c.timestamp),f.mtime=new Date(c.timestamp),f.ctime=new Date(c.timestamp),f.blksize=4096,f.blocks=Math.ceil(f.size/f.blksize),f},setattr(c,f){f.mode!==void 0&&(c.mode=f.mode),f.timestamp!==void 0&&(c.timestamp=f.timestamp),f.size!==void 0&&De.resizeFileStorage(c,f.size)},lookup(c,f){throw v.genericErrors[44]},mknod(c,f,h,y){return De.createNode(c,f,h,y)},rename(c,f,h){if(v.isDir(c.mode)){var y;try{y=v.lookupNode(f,h)}catch{}if(y)for(var A in y.contents)throw new v.ErrnoError(55)}delete c.parent.contents[c.name],c.parent.timestamp=Date.now(),c.name=h,f.contents[h]=c,f.timestamp=c.parent.timestamp,c.parent=f},unlink(c,f){delete c.contents[f],c.timestamp=Date.now()},rmdir(c,f){var h=v.lookupNode(c,f);for(var y in h.contents)throw new v.ErrnoError(55);delete c.contents[f],c.timestamp=Date.now()},readdir(c){var f=[".",".."];for(var h of Object.keys(c.contents))f.push(h);return f},symlink(c,f,h){var y=De.createNode(c,f,41471,0);return y.link=h,y},readlink(c){if(!v.isLink(c.mode))throw new v.ErrnoError(28);return c.link}},stream_ops:{read(c,f,h,y,A){var T=c.node.contents;if(A>=c.node.usedBytes)return 0;var C=Math.min(c.node.usedBytes-A,y);if(C>8&&T.subarray)f.set(T.subarray(A,A+C),h);else for(var U=0;U<C;U++)f[h+U]=T[A+U];return C},write(c,f,h,y,A,T){if(f.buffer===we.buffer&&(T=!1),!y)return 0;var C=c.node;if(C.timestamp=Date.now(),f.subarray&&(!C.contents||C.contents.subarray)){if(T)return C.contents=f.subarray(h,h+y),C.usedBytes=y,y;if(C.usedBytes===0&&A===0)return C.contents=f.slice(h,h+y),C.usedBytes=y,y;if(A+y<=C.usedBytes)return C.contents.set(f.subarray(h,h+y),A),y}if(De.expandFileStorage(C,A+y),C.contents.subarray&&f.subarray)C.contents.set(f.subarray(h,h+y),A);else for(var U=0;U<y;U++)C.contents[A+U]=f[h+U];return C.usedBytes=Math.max(C.usedBytes,A+y),y},llseek(c,f,h){var y=f;if(h===1?y+=c.position:h===2&&v.isFile(c.node.mode)&&(y+=c.node.usedBytes),y<0)throw new v.ErrnoError(28);return y},allocate(c,f,h){De.expandFileStorage(c.node,f+h),c.node.usedBytes=Math.max(c.node.usedBytes,f+h)},mmap(c,f,h,y,A){if(!v.isFile(c.node.mode))throw new v.ErrnoError(43);var T,C,U=c.node.contents;if(!(A&2)&&U.buffer===we.buffer)C=!1,T=U.byteOffset;else{if((h>0||h+f<U.length)&&(U.subarray?U=U.subarray(h,h+f):U=Array.prototype.slice.call(U,h,h+f)),C=!0,T=sS(f),!T)throw new v.ErrnoError(48);we.set(U,T)}return{ptr:T,allocated:C}},msync(c,f,h,y,A){return De.stream_ops.write(c,f,0,y,h,!1),0}}},dI=(c,f,h,y)=>{var A=y?"":`al ${c}`;N(c,T=>{L(T,`Loading data file "${c}" failed (no arrayBuffer).`),f(new Uint8Array(T)),A&&Gm(A)},T=>{if(h)h();else throw`Loading data file "${c}" failed.`}),A&&Jw(A)},pI=(c,f,h,y,A,T)=>{v.createDataFile(c,f,h,y,A,T)},fI=r.preloadPlugins||[],mI=(c,f,h,y)=>{typeof Browser<"u"&&Browser.init();var A=!1;return fI.forEach(T=>{A||T.canHandle(f)&&(T.handle(c,f,h,y),A=!0)}),A},hI=(c,f,h,y,A,T,C,U,ae,Ne)=>{var Le=f?Ba.resolve(ut.join2(c,f)):c,nt=`cp ${Le}`;function Se(_e){function Ae(Bt){Ne?.(),U||pI(c,f,Bt,y,A,ae),T?.(),Gm(nt)}mI(_e,Le,Ae,()=>{C?.(),Gm(nt)})||Ae(_e)}Jw(nt),typeof h=="string"?dI(h,_e=>Se(_e),C):Se(h)},gI=c=>{var f={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},h=f[c];if(typeof h>"u")throw new Error(`Unknown file open mode: ${c}`);return h},tb=(c,f)=>{var h=0;return c&&(h|=365),f&&(h|=146),h},v={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(c,f={}){if(c=Ba.resolve(c),!c)return{path:"",node:null};var h={follow_mount:!0,recurse_count:0};if(f=Object.assign(h,f),f.recurse_count>8)throw new v.ErrnoError(32);for(var y=c.split("/").filter(nt=>!!nt),A=v.root,T="/",C=0;C<y.length;C++){var U=C===y.length-1;if(U&&f.parent)break;if(A=v.lookupNode(A,y[C]),T=ut.join2(T,y[C]),v.isMountpoint(A)&&(!U||U&&f.follow_mount)&&(A=A.mounted.root),!U||f.follow)for(var ae=0;v.isLink(A.mode);){var Ne=v.readlink(T);T=Ba.resolve(ut.dirname(T),Ne);var Le=v.lookupPath(T,{recurse_count:f.recurse_count+1});if(A=Le.node,ae++>40)throw new v.ErrnoError(32)}}return{path:T,node:A}},getPath(c){for(var f;;){if(v.isRoot(c)){var h=c.mount.mountpoint;return f?h[h.length-1]!=="/"?`${h}/${f}`:h+f:h}f=f?`${c.name}/${f}`:c.name,c=c.parent}},hashName(c,f){for(var h=0,y=0;y<f.length;y++)h=(h<<5)-h+f.charCodeAt(y)|0;return(c+h>>>0)%v.nameTable.length},hashAddNode(c){var f=v.hashName(c.parent.id,c.name);c.name_next=v.nameTable[f],v.nameTable[f]=c},hashRemoveNode(c){var f=v.hashName(c.parent.id,c.name);if(v.nameTable[f]===c)v.nameTable[f]=c.name_next;else for(var h=v.nameTable[f];h;){if(h.name_next===c){h.name_next=c.name_next;break}h=h.name_next}},lookupNode(c,f){var h=v.mayLookup(c);if(h)throw new v.ErrnoError(h,c);for(var y=v.hashName(c.id,f),A=v.nameTable[y];A;A=A.name_next){var T=A.name;if(A.parent.id===c.id&&T===f)return A}return v.lookup(c,f)},createNode(c,f,h,y){var A=new v.FSNode(c,f,h,y);return v.hashAddNode(A),A},destroyNode(c){v.hashRemoveNode(c)},isRoot(c){return c===c.parent},isMountpoint(c){return!!c.mounted},isFile(c){return(c&61440)===32768},isDir(c){return(c&61440)===16384},isLink(c){return(c&61440)===40960},isChrdev(c){return(c&61440)===8192},isBlkdev(c){return(c&61440)===24576},isFIFO(c){return(c&61440)===4096},isSocket(c){return(c&49152)===49152},flagsToPermissionString(c){var f=["r","w","rw"][c&3];return c&512&&(f+="w"),f},nodePermissions(c,f){return v.ignorePermissions?0:f.includes("r")&&!(c.mode&292)||f.includes("w")&&!(c.mode&146)||f.includes("x")&&!(c.mode&73)?2:0},mayLookup(c){var f=v.nodePermissions(c,"x");return f||(c.node_ops.lookup?0:2)},mayCreate(c,f){try{var h=v.lookupNode(c,f);return 20}catch{}return v.nodePermissions(c,"wx")},mayDelete(c,f,h){var y;try{y=v.lookupNode(c,f)}catch(T){return T.errno}var A=v.nodePermissions(c,"wx");if(A)return A;if(h){if(!v.isDir(y.mode))return 54;if(v.isRoot(y)||v.getPath(y)===v.cwd())return 10}else if(v.isDir(y.mode))return 31;return 0},mayOpen(c,f){return c?v.isLink(c.mode)?32:v.isDir(c.mode)&&(v.flagsToPermissionString(f)!=="r"||f&512)?31:v.nodePermissions(c,v.flagsToPermissionString(f)):44},MAX_OPEN_FDS:4096,nextfd(){for(var c=0;c<=v.MAX_OPEN_FDS;c++)if(!v.streams[c])return c;throw new v.ErrnoError(33)},getStreamChecked(c){var f=v.getStream(c);if(!f)throw new v.ErrnoError(8);return f},getStream:c=>v.streams[c],createStream(c,f=-1){return v.FSStream||(v.FSStream=function(){this.shared={}},v.FSStream.prototype={},Object.defineProperties(v.FSStream.prototype,{object:{get(){return this.node},set(h){this.node=h}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(h){this.shared.flags=h}},position:{get(){return this.shared.position},set(h){this.shared.position=h}}})),c=Object.assign(new v.FSStream,c),f==-1&&(f=v.nextfd()),c.fd=f,v.streams[f]=c,c},closeStream(c){v.streams[c]=null},chrdev_stream_ops:{open(c){var f=v.getDevice(c.node.rdev);c.stream_ops=f.stream_ops,c.stream_ops.open?.(c)},llseek(){throw new v.ErrnoError(70)}},major:c=>c>>8,minor:c=>c&255,makedev:(c,f)=>c<<8|f,registerDevice(c,f){v.devices[c]={stream_ops:f}},getDevice:c=>v.devices[c],getMounts(c){for(var f=[],h=[c];h.length;){var y=h.pop();f.push(y),h.push.apply(h,y.mounts)}return f},syncfs(c,f){typeof c=="function"&&(f=c,c=!1),v.syncFSRequests++,v.syncFSRequests>1&&O(`warning: ${v.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var h=v.getMounts(v.root.mount),y=0;function A(C){return v.syncFSRequests--,f(C)}function T(C){if(C)return T.errored?void 0:(T.errored=!0,A(C));++y>=h.length&&A(null)}h.forEach(C=>{if(!C.type.syncfs)return T(null);C.type.syncfs(C,c,T)})},mount(c,f,h){var y=h==="/",A=!h,T;if(y&&v.root)throw new v.ErrnoError(10);if(!y&&!A){var C=v.lookupPath(h,{follow_mount:!1});if(h=C.path,T=C.node,v.isMountpoint(T))throw new v.ErrnoError(10);if(!v.isDir(T.mode))throw new v.ErrnoError(54)}var U={type:c,opts:f,mountpoint:h,mounts:[]},ae=c.mount(U);return ae.mount=U,U.root=ae,y?v.root=ae:T&&(T.mounted=U,T.mount&&T.mount.mounts.push(U)),ae},unmount(c){var f=v.lookupPath(c,{follow_mount:!1});if(!v.isMountpoint(f.node))throw new v.ErrnoError(28);var h=f.node,y=h.mounted,A=v.getMounts(y);Object.keys(v.nameTable).forEach(C=>{for(var U=v.nameTable[C];U;){var ae=U.name_next;A.includes(U.mount)&&v.destroyNode(U),U=ae}}),h.mounted=null;var T=h.mount.mounts.indexOf(y);h.mount.mounts.splice(T,1)},lookup(c,f){return c.node_ops.lookup(c,f)},mknod(c,f,h){var y=v.lookupPath(c,{parent:!0}),A=y.node,T=ut.basename(c);if(!T||T==="."||T==="..")throw new v.ErrnoError(28);var C=v.mayCreate(A,T);if(C)throw new v.ErrnoError(C);if(!A.node_ops.mknod)throw new v.ErrnoError(63);return A.node_ops.mknod(A,T,f,h)},create(c,f){return f=f!==void 0?f:438,f&=4095,f|=32768,v.mknod(c,f,0)},mkdir(c,f){return f=f!==void 0?f:511,f&=1023,f|=16384,v.mknod(c,f,0)},mkdirTree(c,f){for(var h=c.split("/"),y="",A=0;A<h.length;++A)if(h[A]){y+="/"+h[A];try{v.mkdir(y,f)}catch(T){if(T.errno!=20)throw T}}},mkdev(c,f,h){return typeof h>"u"&&(h=f,f=438),f|=8192,v.mknod(c,f,h)},symlink(c,f){if(!Ba.resolve(c))throw new v.ErrnoError(44);var h=v.lookupPath(f,{parent:!0}),y=h.node;if(!y)throw new v.ErrnoError(44);var A=ut.basename(f),T=v.mayCreate(y,A);if(T)throw new v.ErrnoError(T);if(!y.node_ops.symlink)throw new v.ErrnoError(63);return y.node_ops.symlink(y,A,c)},rename(c,f){var h=ut.dirname(c),y=ut.dirname(f),A=ut.basename(c),T=ut.basename(f),C,U,ae;if(C=v.lookupPath(c,{parent:!0}),U=C.node,C=v.lookupPath(f,{parent:!0}),ae=C.node,!U||!ae)throw new v.ErrnoError(44);if(U.mount!==ae.mount)throw new v.ErrnoError(75);var Ne=v.lookupNode(U,A),Le=Ba.relative(c,y);if(Le.charAt(0)!==".")throw new v.ErrnoError(28);if(Le=Ba.relative(f,h),Le.charAt(0)!==".")throw new v.ErrnoError(55);var nt;try{nt=v.lookupNode(ae,T)}catch{}if(Ne!==nt){var Se=v.isDir(Ne.mode),_e=v.mayDelete(U,A,Se);if(_e)throw new v.ErrnoError(_e);if(_e=nt?v.mayDelete(ae,T,Se):v.mayCreate(ae,T),_e)throw new v.ErrnoError(_e);if(!U.node_ops.rename)throw new v.ErrnoError(63);if(v.isMountpoint(Ne)||nt&&v.isMountpoint(nt))throw new v.ErrnoError(10);if(ae!==U&&(_e=v.nodePermissions(U,"w"),_e))throw new v.ErrnoError(_e);v.hashRemoveNode(Ne);try{U.node_ops.rename(Ne,ae,T)}catch(Ae){throw Ae}finally{v.hashAddNode(Ne)}}},rmdir(c){var f=v.lookupPath(c,{parent:!0}),h=f.node,y=ut.basename(c),A=v.lookupNode(h,y),T=v.mayDelete(h,y,!0);if(T)throw new v.ErrnoError(T);if(!h.node_ops.rmdir)throw new v.ErrnoError(63);if(v.isMountpoint(A))throw new v.ErrnoError(10);h.node_ops.rmdir(h,y),v.destroyNode(A)},readdir(c){var f=v.lookupPath(c,{follow:!0}),h=f.node;if(!h.node_ops.readdir)throw new v.ErrnoError(54);return h.node_ops.readdir(h)},unlink(c){var f=v.lookupPath(c,{parent:!0}),h=f.node;if(!h)throw new v.ErrnoError(44);var y=ut.basename(c),A=v.lookupNode(h,y),T=v.mayDelete(h,y,!1);if(T)throw new v.ErrnoError(T);if(!h.node_ops.unlink)throw new v.ErrnoError(63);if(v.isMountpoint(A))throw new v.ErrnoError(10);h.node_ops.unlink(h,y),v.destroyNode(A)},readlink(c){var f=v.lookupPath(c),h=f.node;if(!h)throw new v.ErrnoError(44);if(!h.node_ops.readlink)throw new v.ErrnoError(28);return Ba.resolve(v.getPath(h.parent),h.node_ops.readlink(h))},stat(c,f){var h=v.lookupPath(c,{follow:!f}),y=h.node;if(!y)throw new v.ErrnoError(44);if(!y.node_ops.getattr)throw new v.ErrnoError(63);return y.node_ops.getattr(y)},lstat(c){return v.stat(c,!0)},chmod(c,f,h){var y;if(typeof c=="string"){var A=v.lookupPath(c,{follow:!h});y=A.node}else y=c;if(!y.node_ops.setattr)throw new v.ErrnoError(63);y.node_ops.setattr(y,{mode:f&4095|y.mode&-4096,timestamp:Date.now()})},lchmod(c,f){v.chmod(c,f,!0)},fchmod(c,f){var h=v.getStreamChecked(c);v.chmod(h.node,f)},chown(c,f,h,y){var A;if(typeof c=="string"){var T=v.lookupPath(c,{follow:!y});A=T.node}else A=c;if(!A.node_ops.setattr)throw new v.ErrnoError(63);A.node_ops.setattr(A,{timestamp:Date.now()})},lchown(c,f,h){v.chown(c,f,h,!0)},fchown(c,f,h){var y=v.getStreamChecked(c);v.chown(y.node,f,h)},truncate(c,f){if(f<0)throw new v.ErrnoError(28);var h;if(typeof c=="string"){var y=v.lookupPath(c,{follow:!0});h=y.node}else h=c;if(!h.node_ops.setattr)throw new v.ErrnoError(63);if(v.isDir(h.mode))throw new v.ErrnoError(31);if(!v.isFile(h.mode))throw new v.ErrnoError(28);var A=v.nodePermissions(h,"w");if(A)throw new v.ErrnoError(A);h.node_ops.setattr(h,{size:f,timestamp:Date.now()})},ftruncate(c,f){var h=v.getStreamChecked(c);if((h.flags&2097155)===0)throw new v.ErrnoError(28);v.truncate(h.node,f)},utime(c,f,h){var y=v.lookupPath(c,{follow:!0}),A=y.node;A.node_ops.setattr(A,{timestamp:Math.max(f,h)})},open(c,f,h){if(c==="")throw new v.ErrnoError(44);f=typeof f=="string"?gI(f):f,h=typeof h>"u"?438:h,f&64?h=h&4095|32768:h=0;var y;if(typeof c=="object")y=c;else{c=ut.normalize(c);try{var A=v.lookupPath(c,{follow:!(f&131072)});y=A.node}catch{}}var T=!1;if(f&64)if(y){if(f&128)throw new v.ErrnoError(20)}else y=v.mknod(c,h,0),T=!0;if(!y)throw new v.ErrnoError(44);if(v.isChrdev(y.mode)&&(f&=-513),f&65536&&!v.isDir(y.mode))throw new v.ErrnoError(54);if(!T){var C=v.mayOpen(y,f);if(C)throw new v.ErrnoError(C)}f&512&&!T&&v.truncate(y,0),f&=-131713;var U=v.createStream({node:y,path:v.getPath(y),flags:f,seekable:!0,position:0,stream_ops:y.stream_ops,ungotten:[],error:!1});return U.stream_ops.open&&U.stream_ops.open(U),r.logReadFiles&&!(f&1)&&(v.readFiles||(v.readFiles={}),c in v.readFiles||(v.readFiles[c]=1)),U},close(c){if(v.isClosed(c))throw new v.ErrnoError(8);c.getdents&&(c.getdents=null);try{c.stream_ops.close&&c.stream_ops.close(c)}catch(f){throw f}finally{v.closeStream(c.fd)}c.fd=null},isClosed(c){return c.fd===null},llseek(c,f,h){if(v.isClosed(c))throw new v.ErrnoError(8);if(!c.seekable||!c.stream_ops.llseek)throw new v.ErrnoError(70);if(h!=0&&h!=1&&h!=2)throw new v.ErrnoError(28);return c.position=c.stream_ops.llseek(c,f,h),c.ungotten=[],c.position},read(c,f,h,y,A){if(y<0||A<0)throw new v.ErrnoError(28);if(v.isClosed(c))throw new v.ErrnoError(8);if((c.flags&2097155)===1)throw new v.ErrnoError(8);if(v.isDir(c.node.mode))throw new v.ErrnoError(31);if(!c.stream_ops.read)throw new v.ErrnoError(28);var T=typeof A<"u";if(!T)A=c.position;else if(!c.seekable)throw new v.ErrnoError(70);var C=c.stream_ops.read(c,f,h,y,A);return T||(c.position+=C),C},write(c,f,h,y,A,T){if(y<0||A<0)throw new v.ErrnoError(28);if(v.isClosed(c))throw new v.ErrnoError(8);if((c.flags&2097155)===0)throw new v.ErrnoError(8);if(v.isDir(c.node.mode))throw new v.ErrnoError(31);if(!c.stream_ops.write)throw new v.ErrnoError(28);c.seekable&&c.flags&1024&&v.llseek(c,0,2);var C=typeof A<"u";if(!C)A=c.position;else if(!c.seekable)throw new v.ErrnoError(70);var U=c.stream_ops.write(c,f,h,y,A,T);return C||(c.position+=U),U},allocate(c,f,h){if(v.isClosed(c))throw new v.ErrnoError(8);if(f<0||h<=0)throw new v.ErrnoError(28);if((c.flags&2097155)===0)throw new v.ErrnoError(8);if(!v.isFile(c.node.mode)&&!v.isDir(c.node.mode))throw new v.ErrnoError(43);if(!c.stream_ops.allocate)throw new v.ErrnoError(138);c.stream_ops.allocate(c,f,h)},mmap(c,f,h,y,A){if((y&2)!==0&&(A&2)===0&&(c.flags&2097155)!==2)throw new v.ErrnoError(2);if((c.flags&2097155)===1)throw new v.ErrnoError(2);if(!c.stream_ops.mmap)throw new v.ErrnoError(43);return c.stream_ops.mmap(c,f,h,y,A)},msync(c,f,h,y,A){return c.stream_ops.msync?c.stream_ops.msync(c,f,h,y,A):0},munmap:c=>0,ioctl(c,f,h){if(!c.stream_ops.ioctl)throw new v.ErrnoError(59);return c.stream_ops.ioctl(c,f,h)},readFile(c,f={}){if(f.flags=f.flags||0,f.encoding=f.encoding||"binary",f.encoding!=="utf8"&&f.encoding!=="binary")throw new Error(`Invalid encoding type "${f.encoding}"`);var h,y=v.open(c,f.flags),A=v.stat(c),T=A.size,C=new Uint8Array(T);return v.read(y,C,0,T,0),f.encoding==="utf8"?h=nu(C,0):f.encoding==="binary"&&(h=C),v.close(y),h},writeFile(c,f,h={}){h.flags=h.flags||577;var y=v.open(c,h.flags,h.mode);if(typeof f=="string"){var A=new Uint8Array(Hm(f)+1),T=eb(f,A,0,A.length);v.write(y,A,0,T,void 0,h.canOwn)}else if(ArrayBuffer.isView(f))v.write(y,f,0,f.byteLength,void 0,h.canOwn);else throw new Error("Unsupported data type");v.close(y)},cwd:()=>v.currentPath,chdir(c){var f=v.lookupPath(c,{follow:!0});if(f.node===null)throw new v.ErrnoError(44);if(!v.isDir(f.node.mode))throw new v.ErrnoError(54);var h=v.nodePermissions(f.node,"x");if(h)throw new v.ErrnoError(h);v.currentPath=f.path},createDefaultDirectories(){v.mkdir("/tmp"),v.mkdir("/home"),v.mkdir("/home/web_user")},createDefaultDevices(){v.mkdir("/dev"),v.registerDevice(v.makedev(1,3),{read:()=>0,write:(y,A,T,C,U)=>C}),v.mkdev("/dev/null",v.makedev(1,3)),po.register(v.makedev(5,0),po.default_tty_ops),po.register(v.makedev(6,0),po.default_tty1_ops),v.mkdev("/dev/tty",v.makedev(5,0)),v.mkdev("/dev/tty1",v.makedev(6,0));var c=new Uint8Array(1024),f=0,h=()=>(f===0&&(f=aS(c).byteLength),c[--f]);v.createDevice("/dev","random",h),v.createDevice("/dev","urandom",h),v.mkdir("/dev/shm"),v.mkdir("/dev/shm/tmp")},createSpecialDirectories(){v.mkdir("/proc");var c=v.mkdir("/proc/self");v.mkdir("/proc/self/fd"),v.mount({mount(){var f=v.createNode(c,"fd",16895,73);return f.node_ops={lookup(h,y){var A=+y,T=v.getStreamChecked(A),C={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>T.path}};return C.parent=C,C}},f}},{},"/proc/self/fd")},createStandardStreams(){r.stdin?v.createDevice("/dev","stdin",r.stdin):v.symlink("/dev/tty","/dev/stdin"),r.stdout?v.createDevice("/dev","stdout",null,r.stdout):v.symlink("/dev/tty","/dev/stdout"),r.stderr?v.createDevice("/dev","stderr",null,r.stderr):v.symlink("/dev/tty1","/dev/stderr");var c=v.open("/dev/stdin",0),f=v.open("/dev/stdout",1),h=v.open("/dev/stderr",1)},ensureErrnoError(){v.ErrnoError||(v.ErrnoError=function(f,h){this.name="ErrnoError",this.node=h,this.setErrno=function(y){this.errno=y},this.setErrno(f),this.message="FS error"},v.ErrnoError.prototype=new Error,v.ErrnoError.prototype.constructor=v.ErrnoError,[44].forEach(c=>{v.genericErrors[c]=new v.ErrnoError(c),v.genericErrors[c].stack="<generic error, no stack>"}))},staticInit(){v.ensureErrnoError(),v.nameTable=new Array(4096),v.mount(De,{},"/"),v.createDefaultDirectories(),v.createDefaultDevices(),v.createSpecialDirectories(),v.filesystems={MEMFS:De}},init(c,f,h){v.init.initialized=!0,v.ensureErrnoError(),r.stdin=c||r.stdin,r.stdout=f||r.stdout,r.stderr=h||r.stderr,v.createStandardStreams()},quit(){v.init.initialized=!1;for(var c=0;c<v.streams.length;c++){var f=v.streams[c];f&&v.close(f)}},findObject(c,f){var h=v.analyzePath(c,f);return h.exists?h.object:null},analyzePath(c,f){try{var h=v.lookupPath(c,{follow:!f});c=h.path}catch{}var y={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var h=v.lookupPath(c,{parent:!0});y.parentExists=!0,y.parentPath=h.path,y.parentObject=h.node,y.name=ut.basename(c),h=v.lookupPath(c,{follow:!f}),y.exists=!0,y.path=h.path,y.object=h.node,y.name=h.node.name,y.isRoot=h.path==="/"}catch(A){y.error=A.errno}return y},createPath(c,f,h,y){c=typeof c=="string"?c:v.getPath(c);for(var A=f.split("/").reverse();A.length;){var T=A.pop();if(T){var C=ut.join2(c,T);try{v.mkdir(C)}catch{}c=C}}return C},createFile(c,f,h,y,A){var T=ut.join2(typeof c=="string"?c:v.getPath(c),f),C=tb(y,A);return v.create(T,C)},createDataFile(c,f,h,y,A,T){var C=f;c&&(c=typeof c=="string"?c:v.getPath(c),C=f?ut.join2(c,f):c);var U=tb(y,A),ae=v.create(C,U);if(h){if(typeof h=="string"){for(var Ne=new Array(h.length),Le=0,nt=h.length;Le<nt;++Le)Ne[Le]=h.charCodeAt(Le);h=Ne}v.chmod(ae,U|146);var Se=v.open(ae,577);v.write(Se,h,0,h.length,0,T),v.close(Se),v.chmod(ae,U)}},createDevice(c,f,h,y){var A=ut.join2(typeof c=="string"?c:v.getPath(c),f),T=tb(!!h,!!y);v.createDevice.major||(v.createDevice.major=64);var C=v.makedev(v.createDevice.major++,0);return v.registerDevice(C,{open(U){U.seekable=!1},close(U){y?.buffer?.length&&y(10)},read(U,ae,Ne,Le,nt){for(var Se=0,_e=0;_e<Le;_e++){var Ae;try{Ae=h()}catch{throw new v.ErrnoError(29)}if(Ae===void 0&&Se===0)throw new v.ErrnoError(6);if(Ae==null)break;Se++,ae[Ne+_e]=Ae}return Se&&(U.node.timestamp=Date.now()),Se},write(U,ae,Ne,Le,nt){for(var Se=0;Se<Le;Se++)try{y(ae[Ne+Se])}catch{throw new v.ErrnoError(29)}return Le&&(U.node.timestamp=Date.now()),Se}}),v.mkdev(A,T,C)},forceLoadFile(c){if(c.isDevice||c.isFolder||c.link||c.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(_)try{c.contents=qm(_(c.url),!0),c.usedBytes=c.contents.length}catch{throw new v.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(c,f,h,y,A){function T(){this.lengthKnown=!1,this.chunks=[]}if(T.prototype.get=function(_e){if(!(_e>this.length-1||_e<0)){var Ae=_e%this.chunkSize,Bt=_e/this.chunkSize|0;return this.getter(Bt)[Ae]}},T.prototype.setDataGetter=function(_e){this.getter=_e},T.prototype.cacheLength=function(){var _e=new XMLHttpRequest;if(_e.open("HEAD",h,!1),_e.send(null),!(_e.status>=200&&_e.status<300||_e.status===304))throw new Error("Couldn't load "+h+". Status: "+_e.status);var Ae=Number(_e.getResponseHeader("Content-length")),Bt,Ki=(Bt=_e.getResponseHeader("Accept-Ranges"))&&Bt==="bytes",jr=(Bt=_e.getResponseHeader("Content-Encoding"))&&Bt==="gzip",J=1024*1024;Ki||(J=Ae);var he=(At,An)=>{if(At>An)throw new Error("invalid range ("+At+", "+An+") or no bytes requested!");if(An>Ae-1)throw new Error("only "+Ae+" bytes available! programmer error!");var lr=new XMLHttpRequest;if(lr.open("GET",h,!1),Ae!==J&&lr.setRequestHeader("Range","bytes="+At+"-"+An),lr.responseType="arraybuffer",lr.overrideMimeType&&lr.overrideMimeType("text/plain; charset=x-user-defined"),lr.send(null),!(lr.status>=200&&lr.status<300||lr.status===304))throw new Error("Couldn't load "+h+". Status: "+lr.status);return lr.response!==void 0?new Uint8Array(lr.response||[]):qm(lr.responseText||"",!0)},gr=this;gr.setDataGetter(At=>{var An=At*J,lr=(At+1)*J-1;if(lr=Math.min(lr,Ae-1),typeof gr.chunks[At]>"u"&&(gr.chunks[At]=he(An,lr)),typeof gr.chunks[At]>"u")throw new Error("doXHR failed!");return gr.chunks[At]}),(jr||!Ae)&&(J=Ae=1,Ae=this.getter(0).length,J=Ae,W("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=Ae,this._chunkSize=J,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var C=new T;Object.defineProperties(C,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var U={isDevice:!1,contents:C}}else var U={isDevice:!1,url:h};var ae=v.createFile(c,f,U,y,A);U.contents?ae.contents=U.contents:U.url&&(ae.contents=null,ae.url=U.url),Object.defineProperties(ae,{usedBytes:{get:function(){return this.contents.length}}});var Ne={},Le=Object.keys(ae.stream_ops);Le.forEach(Se=>{var _e=ae.stream_ops[Se];Ne[Se]=function(){return v.forceLoadFile(ae),_e.apply(null,arguments)}});function nt(Se,_e,Ae,Bt,Ki){var jr=Se.node.contents;if(Ki>=jr.length)return 0;var J=Math.min(jr.length-Ki,Bt);if(jr.slice)for(var he=0;he<J;he++)_e[Ae+he]=jr[Ki+he];else for(var he=0;he<J;he++)_e[Ae+he]=jr.get(Ki+he);return J}return Ne.read=(Se,_e,Ae,Bt,Ki)=>(v.forceLoadFile(ae),nt(Se,_e,Ae,Bt,Ki)),Ne.mmap=(Se,_e,Ae,Bt,Ki)=>{v.forceLoadFile(ae);var jr=sS(_e);if(!jr)throw new v.ErrnoError(48);return nt(Se,we,jr,_e,Ae),{ptr:jr,allocated:!0}},ae.stream_ops=Ne,ae}},Jm=(c,f)=>c?nu(Ve,c,f):"",fo={DEFAULT_POLLMASK:5,calculateAt(c,f,h){if(ut.isAbs(f))return f;var y;if(c===-100)y=v.cwd();else{var A=fo.getStreamFromFD(c);y=A.path}if(f.length==0){if(!h)throw new v.ErrnoError(44);return y}return ut.join2(y,f)},doStat(c,f,h){try{var y=c(f)}catch(U){if(U&&U.node&&ut.normalize(f)!==ut.normalize(v.getPath(U.node)))return-54;throw U}He[h>>2]=y.dev,He[h+4>>2]=y.mode,$t[h+8>>2]=y.nlink,He[h+12>>2]=y.uid,He[h+16>>2]=y.gid,He[h+20>>2]=y.rdev,hr=[y.size>>>0,(qe=y.size,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+24>>2]=hr[0],He[h+28>>2]=hr[1],He[h+32>>2]=4096,He[h+36>>2]=y.blocks;var A=y.atime.getTime(),T=y.mtime.getTime(),C=y.ctime.getTime();return hr=[Math.floor(A/1e3)>>>0,(qe=Math.floor(A/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+40>>2]=hr[0],He[h+44>>2]=hr[1],$t[h+48>>2]=A%1e3*1e3,hr=[Math.floor(T/1e3)>>>0,(qe=Math.floor(T/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+56>>2]=hr[0],He[h+60>>2]=hr[1],$t[h+64>>2]=T%1e3*1e3,hr=[Math.floor(C/1e3)>>>0,(qe=Math.floor(C/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+72>>2]=hr[0],He[h+76>>2]=hr[1],$t[h+80>>2]=C%1e3*1e3,hr=[y.ino>>>0,(qe=y.ino,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+88>>2]=hr[0],He[h+92>>2]=hr[1],0},doMsync(c,f,h,y,A){if(!v.isFile(f.node.mode))throw new v.ErrnoError(43);if(y&2)return 0;var T=Ve.slice(c,c+h);v.msync(f,T,A,h,y)},varargs:void 0,get(){var c=He[+fo.varargs>>2];return fo.varargs+=4,c},getp(){return fo.get()},getStr(c){var f=Jm(c);return f},getStreamFromFD(c){var f=v.getStreamChecked(c);return f}},vI=(c,f)=>{var h=0;return Vd().forEach((y,A)=>{var T=f+h;$t[c+A*4>>2]=T,lI(y,T),h+=y.length+1}),0},xI=(c,f)=>{var h=Vd();$t[c>>2]=h.length;var y=0;return h.forEach(A=>y+=A.length+1),$t[f>>2]=y,0};function yI(c){try{var f=fo.getStreamFromFD(c);return v.close(f),0}catch(h){if(typeof v>"u"||h.name!=="ErrnoError")throw h;return h.errno}}var wI=(c,f,h,y)=>{for(var A=0,T=0;T<h;T++){var C=$t[f>>2],U=$t[f+4>>2];f+=8;var ae=v.read(c,we,C,U,y);if(ae<0)return-1;if(A+=ae,ae<U)break;typeof y<"u"&&(y+=ae)}return A};function bI(c,f,h,y){try{var A=fo.getStreamFromFD(c),T=wI(A,f,h);return $t[y>>2]=T,0}catch(C){if(typeof v>"u"||C.name!=="ErrnoError")throw C;return C.errno}}var _I=(c,f)=>f+2097152>>>0<4194305-!!c?(c>>>0)+f*4294967296:NaN;function AI(c,f,h,y,A){var T=_I(f,h);try{if(isNaN(T))return 61;var C=fo.getStreamFromFD(c);return v.llseek(C,T,y),hr=[C.position>>>0,(qe=C.position,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[A>>2]=hr[0],He[A+4>>2]=hr[1],C.getdents&&T===0&&y===0&&(C.getdents=null),0}catch(U){if(typeof v>"u"||U.name!=="ErrnoError")throw U;return U.errno}}var FI=(c,f,h,y)=>{for(var A=0,T=0;T<h;T++){var C=$t[f>>2],U=$t[f+4>>2];f+=8;var ae=v.write(c,we,C,U,y);if(ae<0)return-1;A+=ae,typeof y<"u"&&(y+=ae)}return A};function EI(c,f,h,y){try{var A=fo.getStreamFromFD(c),T=FI(A,f,h);return $t[y>>2]=T,0}catch(C){if(typeof v>"u"||C.name!=="ErrnoError")throw C;return C.errno}}var Xm=c=>c%4===0&&(c%100!==0||c%400===0),SI=(c,f)=>{for(var h=0,y=0;y<=f;h+=c[y++]);return h},lS=[31,29,31,30,31,30,31,31,30,31,30,31],uS=[31,28,31,30,31,30,31,31,30,31,30,31],PI=(c,f)=>{for(var h=new Date(c.getTime());f>0;){var y=Xm(h.getFullYear()),A=h.getMonth(),T=(y?lS:uS)[A];if(f>T-h.getDate())f-=T-h.getDate()+1,h.setDate(1),A<11?h.setMonth(A+1):(h.setMonth(0),h.setFullYear(h.getFullYear()+1));else return h.setDate(h.getDate()+f),h}return h},cS=(c,f)=>{we.set(c,f)},$I=(c,f,h,y)=>{var A=$t[y+40>>2],T={tm_sec:He[y>>2],tm_min:He[y+4>>2],tm_hour:He[y+8>>2],tm_mday:He[y+12>>2],tm_mon:He[y+16>>2],tm_year:He[y+20>>2],tm_wday:He[y+24>>2],tm_yday:He[y+28>>2],tm_isdst:He[y+32>>2],tm_gmtoff:He[y+36>>2],tm_zone:A?Jm(A):""},C=Jm(h),U={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var ae in U)C=C.replace(new RegExp(ae,"g"),U[ae]);var Ne=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Le=["January","February","March","April","May","June","July","August","September","October","November","December"];function nt(J,he,gr){for(var At=typeof J=="number"?J.toString():J||"";At.length<he;)At=gr[0]+At;return At}function Se(J,he){return nt(J,he,"0")}function _e(J,he){function gr(An){return An<0?-1:An>0?1:0}var At;return(At=gr(J.getFullYear()-he.getFullYear()))===0&&(At=gr(J.getMonth()-he.getMonth()))===0&&(At=gr(J.getDate()-he.getDate())),At}function Ae(J){switch(J.getDay()){case 0:return new Date(J.getFullYear()-1,11,29);case 1:return J;case 2:return new Date(J.getFullYear(),0,3);case 3:return new Date(J.getFullYear(),0,2);case 4:return new Date(J.getFullYear(),0,1);case 5:return new Date(J.getFullYear()-1,11,31);case 6:return new Date(J.getFullYear()-1,11,30)}}function Bt(J){var he=PI(new Date(J.tm_year+1900,0,1),J.tm_yday),gr=new Date(he.getFullYear(),0,4),At=new Date(he.getFullYear()+1,0,4),An=Ae(gr),lr=Ae(At);return _e(An,he)<=0?_e(lr,he)<=0?he.getFullYear()+1:he.getFullYear():he.getFullYear()-1}var Ki={"%a":J=>Ne[J.tm_wday].substring(0,3),"%A":J=>Ne[J.tm_wday],"%b":J=>Le[J.tm_mon].substring(0,3),"%B":J=>Le[J.tm_mon],"%C":J=>{var he=J.tm_year+1900;return Se(he/100|0,2)},"%d":J=>Se(J.tm_mday,2),"%e":J=>nt(J.tm_mday,2," "),"%g":J=>Bt(J).toString().substring(2),"%G":J=>Bt(J),"%H":J=>Se(J.tm_hour,2),"%I":J=>{var he=J.tm_hour;return he==0?he=12:he>12&&(he-=12),Se(he,2)},"%j":J=>Se(J.tm_mday+SI(Xm(J.tm_year+1900)?lS:uS,J.tm_mon-1),3),"%m":J=>Se(J.tm_mon+1,2),"%M":J=>Se(J.tm_min,2),"%n":()=>`
|
|
84
|
+
`,"%p":J=>J.tm_hour>=0&&J.tm_hour<12?"AM":"PM","%S":J=>Se(J.tm_sec,2),"%t":()=>" ","%u":J=>J.tm_wday||7,"%U":J=>{var he=J.tm_yday+7-J.tm_wday;return Se(Math.floor(he/7),2)},"%V":J=>{var he=Math.floor((J.tm_yday+7-(J.tm_wday+6)%7)/7);if((J.tm_wday+371-J.tm_yday-2)%7<=2&&he++,he){if(he==53){var At=(J.tm_wday+371-J.tm_yday)%7;At!=4&&(At!=3||!Xm(J.tm_year))&&(he=1)}}else{he=52;var gr=(J.tm_wday+7-J.tm_yday-1)%7;(gr==4||gr==5&&Xm(J.tm_year%400-1))&&he++}return Se(he,2)},"%w":J=>J.tm_wday,"%W":J=>{var he=J.tm_yday+7-(J.tm_wday+6)%7;return Se(Math.floor(he/7),2)},"%y":J=>(J.tm_year+1900).toString().substring(2),"%Y":J=>J.tm_year+1900,"%z":J=>{var he=J.tm_gmtoff,gr=he>=0;return he=Math.abs(he)/60,he=he/60*100+he%60,(gr?"+":"-")+("0000"+he).slice(-4)},"%Z":J=>J.tm_zone,"%%":()=>"%"};C=C.replace(/%%/g,"\0\0");for(var ae in Ki)C.includes(ae)&&(C=C.replace(new RegExp(ae,"g"),Ki[ae](T)));C=C.replace(/\0\0/g,"%");var jr=qm(C,!1);return jr.length>f?0:(cS(jr,c),jr.length-1)},kI=(c,f,h,y,A)=>$I(c,f,h,y),dS=c=>{var f=r["_"+c];return f},pS=(c,f,h)=>eb(c,Ve,f,h),MI=c=>{var f=Hm(c)+1,h=rb(f);return pS(c,h,f),h},fS=(c,f,h,y,A)=>{var T={string:Ae=>{var Bt=0;return Ae!=null&&Ae!==0&&(Bt=MI(Ae)),Bt},array:Ae=>{var Bt=rb(Ae.length);return cS(Ae,Bt),Bt}};function C(Ae){return f==="string"?Jm(Ae):f==="boolean"?!!Ae:Ae}var U=dS(c),ae=[],Ne=0;if(y)for(var Le=0;Le<y.length;Le++){var nt=T[h[Le]];nt?(Ne===0&&(Ne=hS()),ae[Le]=nt(y[Le])):ae[Le]=y[Le]}var Se=U.apply(null,ae);function _e(Ae){return Ne!==0&&gS(Ne),C(Ae)}return Se=_e(Se),Se},NI=(c,f,h,y)=>{var A=!h||h.every(C=>C==="number"||C==="boolean"),T=f!=="string";return T&&A&&!y?dS(c):function(){return fS(c,f,h,arguments,y)}},mS=function(c,f,h,y){c||(c=this),this.parent=c,this.mount=c.mount,this.mounted=null,this.id=v.nextInode++,this.name=f,this.mode=h,this.node_ops={},this.stream_ops={},this.rdev=y},Ym=365,Qm=146;Object.defineProperties(mS.prototype,{read:{get:function(){return(this.mode&Ym)===Ym},set:function(c){c?this.mode|=Ym:this.mode&=~Ym}},write:{get:function(){return(this.mode&Qm)===Qm},set:function(c){c?this.mode|=Qm:this.mode&=~Qm}},isFolder:{get:function(){return v.isDir(this.mode)}},isDevice:{get:function(){return v.isChrdev(this.mode)}}}),v.FSNode=mS,v.createPreloadedFile=hI,v.staticInit();var II={a:tI,b:rI,k:iI,i:oI,e:vI,f:xI,g:yI,h:bI,j:AI,c:EI,d:kI},ft=YN(),BI=()=>(BI=ft.m)(),TI=r._nam_createInstance=()=>(TI=r._nam_createInstance=ft.n)(),DI=r._nam_destroyInstance=c=>(DI=r._nam_destroyInstance=ft.o)(c),RI=r._nam_getInstanceCount=()=>(RI=r._nam_getInstanceCount=ft.p)(),CI=r._nam_loadModel=(c,f)=>(CI=r._nam_loadModel=ft.q)(c,f),zI=r._nam_unloadModel=c=>(zI=r._nam_unloadModel=ft.r)(c),OI=r._nam_hasModel=c=>(OI=r._nam_hasModel=ft.s)(c),VI=r._nam_process=(c,f,h,y)=>(VI=r._nam_process=ft.t)(c,f,h,y),UI=r._nam_setSampleRate=c=>(UI=r._nam_setSampleRate=ft.u)(c),jI=r._nam_getSampleRate=()=>(jI=r._nam_getSampleRate=ft.v)(),KI=r._nam_setMaxBufferSize=c=>(KI=r._nam_setMaxBufferSize=ft.w)(c),WI=r._nam_getMaxBufferSize=()=>(WI=r._nam_getMaxBufferSize=ft.x)(),LI=r._nam_getModelLoudness=c=>(LI=r._nam_getModelLoudness=ft.y)(c),ZI=r._nam_hasModelLoudness=c=>(ZI=r._nam_hasModelLoudness=ft.z)(c),GI=r._nam_reset=c=>(GI=r._nam_reset=ft.A)(c),HI=r._free=c=>(HI=r._free=ft.B)(c),qI=r._malloc=c=>(qI=r._malloc=ft.C)(c),JI=()=>(JI=ft.__errno_location)(),hS=()=>(hS=ft.E)(),gS=c=>(gS=ft.F)(c),rb=c=>(rb=ft.G)(c),XI=c=>(XI=ft.__cxa_increment_exception_refcount)(c),vS=c=>(vS=ft.H)(c);r.ccall=fS,r.cwrap=NI,r.stringToUTF8=pS,r.lengthBytesUTF8=Hm;var eh;Od=function c(){eh||xS(),eh||(Od=c)};function xS(){if(_s>0||(KN(),_s>0))return;function c(){eh||(eh=!0,r.calledRun=!0,!be&&(WN(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),LN()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),c()},1)):c()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return xS(),e.ready})})(),GE=A2;var HE=class{constructor(e){this.uuid=e}instances=[-1,-1];json=null;loaded=!1;mono=!0},F2=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},Zw=class{#e;#t;#r;#i=new Map;#n=new Map;#a=1;#o=null;#s=null;#u=!1;#l=!1;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}async settle(){for(;this.#u;)await new Promise(e=>setTimeout(e,1))}imports(){return{host_nam_create:e=>this.#c(e),host_nam_load:(e,r,n)=>this.#h(e,r,n),host_nam_set_mono:(e,r)=>this.#v(e,r!==0),host_nam_process:(e,r,n,i,a,o,s)=>this.#g(e,r,n,i,a,o,s),host_nam_reset:e=>this.#d(e),host_nam_release:e=>this.#p(e)}}#c(e){let r=k.toString(new Uint8Array(this.#e.buffer,e,16).slice()),n=this.#n.get(r);if(K(n))return n;let i=this.#a++;return this.#i.set(i,new HE(r)),this.#n.set(r,i),i}#h(e,r,n){let i=this.#i.get(e);if(!K(i))return;if(n===0){i.json=null,this.#x(i);return}let a=new Uint8Array(this.#e.buffer,r,n).slice();K(i.json)&&F2(i.json,a)||(i.json=a,K(this.#s)?this.#f(i):this.#y())}#v(e,r){let n=this.#i.get(e);if(!K(n))return;n.mono=r;let i=this.#s;K(i)&&(r?n.instances[1]>=0&&(i.unloadModel(n.instances[1]),i.destroyInstance(n.instances[1]),n.instances[1]=-1):n.instances[1]<0&&(n.instances[1]=i.createInstance(),K(n.json)&&n.loaded&&(n.loaded=this.#m(n.instances[1],n.json)&&n.loaded)))}#g(e,r,n,i,a,o,s){let u=this.#i.get(e),d=this.#s;if(!K(u)||!K(d)||!u.loaded||u.instances[0]<0)return 0;let m=this.#e.buffer;if(d.process(u.instances[0],new Float32Array(m,r,o),new Float32Array(m,i,o)),s>1){if(u.instances[1]<0)return 0;d.process(u.instances[1],new Float32Array(m,n,o),new Float32Array(m,a,o))}return 1}#d(e){let r=this.#i.get(e),n=this.#s;if(!(!K(r)||!K(n)))for(let i of r.instances)i>=0&&n.reset(i)}#p(e){let r=this.#i.get(e);if(!K(r))return;let n=this.#s;if(K(n))for(let i of r.instances)i>=0&&(n.unloadModel(i),n.destroyInstance(i));this.#i.delete(e),this.#n.get(r.uuid)===e&&this.#n.delete(r.uuid)}#y(){this.#u||this.#l||K(this.#s)||(this.#u=!0,this.#t().then(e=>GE({wasmBinary:e,locateFile:()=>""})).then(e=>{this.#o=e;let r=Lm.fromModule(e);r.setSampleRate(this.#r),this.#s=r,this.#u=!1;for(let n of this.#i.values())K(n.json)&&this.#f(n)}).catch(e=>{this.#u=!1,this.#l=!0,console.error("Failed to load NAM WASM:",e)}))}#f(e){let r=this.#s;!K(r)||!K(e.json)||(e.instances[0]<0&&(e.instances[0]=r.createInstance()),!e.mono&&e.instances[1]<0&&(e.instances[1]=r.createInstance()),e.loaded=this.#m(e.instances[0],e.json),e.instances[1]>=0&&(e.loaded=this.#m(e.instances[1],e.json)&&e.loaded))}#x(e){e.loaded=!1;let r=this.#s;if(K(r))for(let n of e.instances)n>=0&&r.unloadModel(n)}#m(e,r){let n=this.#o;if(!K(n))return!1;let i=n._malloc(r.length+1);n.HEAPU8.set(r,i),n.HEAPU8[i+r.length]=0;let a=n._nam_loadModel(e,i);return n._free(i),a||console.error("NAM loadModel failed"),!!a}};var _n={Pan:17,AttackVolEnv:34,DecayVolEnv:36,SustainVolEnv:37,ReleaseVolEnv:38,KeyRange:43,VelRange:44,CoarseTune:51,FineTune:52,SampleId:53,SampleModes:54,OverridingRootKey:58},E2=1330857522,S2=32,DN=24,RN=40,CN=8,P2=({samples:t,presets:e})=>{let r=e.reduce((g,w)=>g+w.length,0),n=S2,i=n+t.length*DN,a=i+r*RN,o=a+e.length*CN,s=t.reduce((g,w)=>g+w.pcm.length,0),u=new ArrayBuffer(o+s*4),d=new DataView(u);d.setUint32(0,E2,!0),d.setUint32(4,1,!0),d.setUint32(8,t.length,!0),d.setUint32(12,r,!0),d.setUint32(16,e.length,!0),d.setUint32(20,n,!0),d.setUint32(24,i,!0),d.setUint32(28,a,!0);let m=o;t.forEach((g,w)=>{let _=n+w*DN;d.setUint32(_,m,!0),d.setUint32(_+4,g.pcm.length,!0),d.setFloat32(_+8,g.sampleRate,!0),d.setUint32(_+12,g.loopStart,!0),d.setUint32(_+16,g.loopEnd,!0),new Float32Array(u,m,g.pcm.length).set(g.pcm),m+=g.pcm.length*4});let x=0;return e.forEach((g,w)=>{let _=a+w*CN;d.setUint32(_,x,!0),d.setUint32(_+4,g.length,!0);for(let N of g){let j=i+x*RN;d.setUint8(j,N.keyLo),d.setUint8(j+1,N.keyHi),d.setUint8(j+2,N.velLo),d.setUint8(j+3,N.velHi),d.setUint32(j+4,N.sampleIndex,!0),d.setUint32(j+8,N.rootKey,!0),d.setUint32(j+12,N.loopMode,!0),d.setFloat32(j+16,N.pan,!0),d.setFloat32(j+20,N.attack,!0),d.setFloat32(j+24,N.decay,!0),d.setFloat32(j+28,N.sustain,!0),d.setFloat32(j+32,N.release,!0),x++}}),u},Hw=(t,e)=>t.generators[e]?.value,Cd=(t,e,r)=>Hw(e,r)??Hw(t,r),qE=t=>t!==void 0?Math.pow(2,t/1200):.005,Gw=(t,e)=>t.generators[e]?.range??{lo:0,hi:127},zN=t=>{let e=[],r=new Map,n=a=>{let o=r.get(a);if(o!==void 0)return o;let s=new Float32Array(a.data.length);for(let d=0;d<s.length;d++)s[d]=a.data[d]/32768;let u=e.length;return e.push({pcm:s,sampleRate:a.header.sampleRate,loopStart:a.header.startLoop,loopEnd:a.header.endLoop}),r.set(a,u),u},i=t.presets.map(a=>{let o=[];for(let s of a.zones){let u=Gw(s,_n.KeyRange),d=Gw(s,_n.VelRange);for(let m of s.instrument.zones){let x=Gw(m,_n.KeyRange),g=Gw(m,_n.VelRange),w=Math.max(u.lo,x.lo),_=Math.min(u.hi,x.hi),N=Math.max(d.lo,g.lo),j=Math.min(d.hi,g.hi);if(w>_||N>j)continue;let W=m.sample??t.samples[Hw(m,_n.SampleId)??0];if(W===void 0)continue;let O=n(W),te=Hw(m,_n.OverridingRootKey)??W.header.originalPitch??60,ie=Cd(s,m,_n.SampleModes)??0,be=Cd(s,m,_n.SustainVolEnv);o.push({keyLo:w,keyHi:_,velLo:N,velHi:j,sampleIndex:O,rootKey:te,loopMode:ie===1||ie===3?1:0,pan:(Cd(s,m,_n.Pan)??0)/1e3,attack:qE(Cd(s,m,_n.AttackVolEnv)),decay:qE(Cd(s,m,_n.DecayVolEnv)),sustain:1-(be??0)/1e3,release:qE(Cd(s,m,_n.ReleaseVolEnv))})}}return o});return P2({samples:e,presets:i})};var $2=512,JE=(t,e,r)=>{let n=Ht(()=>SN(t,e));return n.status==="failure"||n.value.length===0?r:new Error(`wasm panic: ${n.value}`,{cause:r})},ON=(t,e,r,n)=>{let i=new WebAssembly.Table({initial:$2,element:"anyfunc"}),a=K(globalThis.performance)?()=>performance.now()*1e3:()=>Date.now()*1e3,o=new WebAssembly.Instance(t.engineModule,{env:{memory:e,__indirect_function_table:i,host_perf_now:a}}).exports;o.init(r);let s=new Ww(e,o,r,(m,x)=>n.deviceMessage(m,x)),u=new Zw(e,()=>n.fetchNamWasm(),r),d={...s.imports(),...u.imports()};return t.deviceModules.forEach((m,x)=>$N(o,e,i,m,t.deviceBoxTypes[x],r,d)),t.composites.forEach(m=>kN(o,e,m)),o},VN=(t,e,r,n,i,a)=>{let o=s=>{let u=s.catch(a);n.add(u),u.finally(()=>n.delete(u))};for(;;){let s=t.input_reserve(16),u=t.sample_take_request(s);if(u<0)break;let d=new Uint8Array(e.buffer,s,16).slice();o(r.fetchAudio(d).then(m=>{let{numberOfFrames:x,numberOfChannels:g,sampleRate:w,frames:_}=m,N=x*Float32Array.BYTES_PER_ELEMENT,j=t.sample_allocate(u,g*N);if(j!==0){for(let W=0;W<g;W++)new Float32Array(e.buffer,j+W*N,x).set(_[W]);t.sample_set_ready(u,x,g,w)}},m=>{t.sample_allocate(u,4),t.sample_set_ready(u,1,1,i),r.log(`sample load failed: ${m}`)}))}for(;;){let s=t.input_reserve(16),u=t.soundfont_take_request(s);if(u<0)break;let d=new Uint8Array(e.buffer,s,16).slice();o(r.fetchSoundfont(d).then(m=>{let x=new Uint8Array(zN(m)),g=t.soundfont_allocate(u,x.byteLength);g!==0&&(new Uint8Array(e.buffer,g,x.byteLength).set(x),t.soundfont_set_ready(u))},m=>r.log(`soundfont load failed: ${m}`)))}};var zd=b.None,UN=(t,e,r,n,i,a,o)=>{let s=Ht(()=>t.render());if(s.status==="failure")throw JE(t,e,s.error);i.drain(t,e);let u=e.buffer;if(n>0){let m=new Float32Array(u,t.stem_output_ptr(),n*2*_i);for(let x=0;x<r.length&&x<n*2;x++)r[x].set(m.subarray(x*_i,(x+1)*_i));return}let d=t.output_ptr();r[0].set(new Float32Array(u,d,_i)),r.length>1&&r[1].set(new Float32Array(u,d+_i*Float32Array.BYTES_PER_ELEMENT,_i)),a.process(r[0],r[1]??r[0],0,_i),o.flush()};ho.executor(wb.for(self).channel("offline-engine"),{async initialize(t,e){globalThis.sampleRate=e.sampleRate;let r=e.variant,n=await FN(r.wasmUrl),i=AN(),a=wb.for(t),o=ho.sender(a.channel("engine-to-client"),Q=>new class{log(L){Q.dispatchAndForget(this.log,L)}error(L){Q.dispatchAndForget(this.error,L)}deviceMessage(L,we){Q.dispatchAndForget(this.deviceMessage,L,we)}fetchAudio(L){return Q.dispatchAndReturn(this.fetchAudio,L)}fetchSoundfont(L){return Q.dispatchAndReturn(this.fetchSoundfont,L)}fetchNamWasm(){return Q.dispatchAndReturn(this.fetchNamWasm)}notifyClipSequenceChanges(L){Q.dispatchAndForget(this.notifyClipSequenceChanges,L)}switchMarkerState(L){Q.dispatchAndForget(this.switchMarkerState,L)}ready(){Q.dispatchAndForget(this.ready)}}),s=ON(n,i,e.sampleRate,o);s.set_metronome_enabled(0);let{boxGraph:u}=co.decode(e.project),d=u.boxes().map(Q=>({type:"new",name:Q.name,uuid:Q.address.uuid,buffer:Q.toArrayBuffer()})),m=new Uint8Array(EN(d,u)),x=s.input_reserve(m.length);if(new Uint8Array(i.buffer,x,m.length).set(m),s.apply_updates(m.length)!==0)throw new Error("apply_updates rejected the project snapshot");let g=e.exportConfiguration?.stems,w=K(g)?Object.keys(g):[];if(w.length>0){let Q=s.input_reserve(w.length*20),L=new DataView(i.buffer,Q,w.length*20);w.forEach((we,Ve)=>{let ct=g[we];new Uint8Array(i.buffer,Q+Ve*20,16).set(k.parse(we)),L.setUint32(Ve*20+16,(ct.includeAudioEffects?1:0)|(ct.includeSends?2:0)|(ct.useInstrumentOutput?4:0)|(ct.skipChannelStrip??!1?8:0),!0)}),s.set_stem_export(w.length)}if(s.bind()!==0)throw new Error("the project snapshot carries no TimelineBox");let _=new Vw,N=Eh.create(a,"engine-live-data"),j=new mh,W=new Float32Array(j.numBins()),O=new Float32Array(j.numBins()),te=[N.broadcastFloats(om.SPECTRUM,W,Q=>{Q&&(W.set(j.bins()),j.decay=!0)}),N.broadcastFloats(om.WAVEFORM,O,Q=>{Q&&O.set(j.waveform())})],ie=new Set;VN(s,i,o,ie,e.sampleRate,Q=>o.error(JE(s,i,Q)));let be=ph.writer(KP(),e.syncStreamBuffer,Q=>{let L=new DataView(i.buffer,s.engine_state_ptr(),s.engine_state_len());Q.position=L.getFloat32(0),Q.bpm=L.getFloat32(4),Q.playbackTimestamp=0,Q.countInBeatsRemaining=0,Q.isPlaying=L.getUint8(16)===1,Q.isCountingIn=!1,Q.isRecording=!1});ho.executor(a.channel("engine-commands"),{play:()=>s.play(),stop:Q=>{s.pause(),Q&&s.stop()},setPosition:Q=>s.set_position(Q),prepareRecordingState:Q=>{},stopRecording:()=>{},queryLoadingComplete:()=>Promise.all(ie).then(()=>!0),panic:()=>{},loadClickSound:(Q,L)=>{},setFrozenAudio:(Q,L)=>{},updateMonitoringMap:Q=>{},noteSignal:Q=>{},ignoreNoteRegion:Q=>{},scheduleClipPlay:Q=>{},scheduleClipStop:Q=>{},setupMIDI:(Q,L)=>_.connect(Q,L),terminate:()=>{}}),t.start(),zd=b.wrap({engine:s,memory:i,stateSender:be,pending:ie,midi:_,broadcaster:N,analyser:j,broadcasts:te,sampleRate:e.sampleRate,numberOfChannels:w.length>0?w.length*2:2,stems:w.length,totalFrames:0,running:!1}),o.ready()},async addModule(t){new Function(t)()},async step(t){let{engine:e,memory:r,stateSender:n,pending:i}=zd.unwrap("state.step");await Promise.all(i);let{numberOfChannels:a,stems:o,midi:s,analyser:u,broadcaster:d}=zd.unwrap("state.step"),m=se.create(()=>new Float32Array(t),a),x=se.create(()=>new Float32Array(_i),a),g=0;for(;g<t;){UN(e,r,x,o,s,u,d);let w=Math.min(t-g,_i);for(let _=0;_<a;_++)m[_].set(x[_].subarray(0,w),g);g+=w,n.tryWrite()}return m},async render(t){let e=zd.unwrap("state.render"),{silenceThresholdDb:r,silenceDurationSeconds:n,maxDurationSeconds:i}=t,a=$S(r??-72),o=Math.ceil((n??10)*e.sampleRate),s=K(i)?Math.ceil(i*e.sampleRate):1/0,{numberOfChannels:u,stems:d}=zd.unwrap("state.render"),m=se.create(()=>[],u),x=0,g=!1,w=0;for(e.running=!0,await Ss.timeSpan(Es.seconds(0));e.running&&e.totalFrames<s;){let N=se.create(()=>new Float32Array(_i),u);UN(e.engine,e.memory,N,d,e.midi,e.analyser,e.broadcaster);let j=0;for(let O of N)for(let te of O){let ie=Math.abs(te);ie>j&&(j=ie)}let W=j<=a;if(j>a&&(g=!0),W&&g){if(x+=_i,x>=o)break}else x=0;for(let O=0;O<u;O++)m[O].push(N[O].slice());e.totalFrames+=_i,e.stateSender.tryWrite(),e.totalFrames-w>=e.sampleRate&&(w=e.totalFrames,await new Promise(O=>setTimeout(O,0)))}let _=e.totalFrames-x+Math.min(e.sampleRate/4,x);return se.create(N=>{let j=new Float32Array(_),W=0;for(let O of m[N]){if(W>=_)break;let te=Math.min(O.length,_-W);j.set(O.subarray(0,te),W),W+=te}return j},u)},stop(){zd.unwrap("state.stop").running=!1}});
|
|
85
|
+
/*! Bundled license information:
|
|
86
|
+
|
|
87
|
+
@opendaw/nam-wasm/dist/index.js:
|
|
88
|
+
(**
|
|
89
|
+
* @opendaw/nam-wasm
|
|
90
|
+
*
|
|
91
|
+
* Neural Amp Modeler WASM with multi-instance support.
|
|
92
|
+
* Designed for integration with Web Audio AudioWorklets.
|
|
93
|
+
*
|
|
94
|
+
* @license MIT
|
|
95
|
+
*)
|
|
96
|
+
*/
|
|
97
|
+
//# sourceMappingURL=wasm-offline-worker.js.map
|