@wovin/connect-nftstorage 0.0.9-RC2 → 0.0.9-RC3

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.
@@ -0,0 +1,78 @@
1
+ import{b as Ri,d as fs,e as ls,f as Bi,g as xt}from"./chunk-SOBCOB7T.min.js";var bc=Ri((TI,gc)=>{"use strict";gc.exports=ws;var mc=128,ty=127,ry=~ty,ny=Math.pow(2,31);function ws(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw ws.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=ny;)t[r++]=e&255|mc,e/=128;for(;e&ry;)t[r++]=e&255|mc,e>>>=7;return t[r]=e|0,ws.bytes=r-n+1,t}});var wc=Ri((OI,_c)=>{"use strict";_c.exports=Ts;var iy=128,vc=127;function Ts(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a||i>49)throw Ts.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&vc)<<i:(o&vc)*Math.pow(2,i),i+=7}while(o>=iy);return Ts.bytes=s-n,r}});var Oc=Ri((AI,Tc)=>{"use strict";var oy=Math.pow(2,7),sy=Math.pow(2,14),ay=Math.pow(2,21),uy=Math.pow(2,28),cy=Math.pow(2,35),fy=Math.pow(2,42),ly=Math.pow(2,49),dy=Math.pow(2,56),py=Math.pow(2,63);Tc.exports=function(e){return e<oy?1:e<sy?2:e<ay?3:e<uy?4:e<cy?5:e<fy?6:e<ly?7:e<dy?8:e<py?9:10}});var Wi=Ri((II,Ac)=>{"use strict";Ac.exports={encode:bc(),decode:wc(),encodingLength:Oc()}});var Ap=["string","number","bigint","symbol"],Ip=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function du(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Ap.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Ep(e))return"Buffer";let r=Sp(e);return r||"Object"}function Ep(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Sp(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Ip.includes(t))return t}var L=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};L.uint=new L(0,"uint",!0);L.negint=new L(1,"negint",!0);L.bytes=new L(2,"bytes",!0);L.string=new L(3,"string",!0);L.array=new L(4,"array",!1);L.map=new L(5,"map",!1);L.tag=new L(6,"tag",!1);L.float=new L(7,"float",!0);L.false=new L(7,"false",!0);L.true=new L(7,"true",!0);L.null=new L(7,"null",!0);L.undefined=new L(7,"undefined",!0);L.break=new L(7,"break",!0);var ce=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var sn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",xp=new TextDecoder,Np=new TextEncoder;function ki(e){return sn&&globalThis.Buffer.isBuffer(e)}function mu(e){return e instanceof Uint8Array?ki(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var gu=sn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):yu(e,t,r):(e,t,r)=>r-t>64?xp.decode(e.subarray(t,r)):yu(e,t,r),bu=sn?e=>e.length>64?globalThis.Buffer.from(e):pu(e):e=>e.length>64?Np.encode(e):pu(e);var an=sn?(e,t,r)=>ki(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),vu=sn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),mu(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},_u=sn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function wu(e,t){if(ki(e)&&ki(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function pu(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function yu(e,t,r){let n=[];for(;t<r;){let i=e[t],s=null,o=i>239?4:i>223?3:i>191?2:1;if(t+o<=r){let a,f,c,y;switch(o){case 1:i<128&&(s=i);break;case 2:a=e[t+1],(a&192)===128&&(y=(i&31)<<6|a&63,y>127&&(s=y));break;case 3:a=e[t+1],f=e[t+2],(a&192)===128&&(f&192)===128&&(y=(i&15)<<12|(a&63)<<6|f&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:a=e[t+1],f=e[t+2],c=e[t+3],(a&192)===128&&(f&192)===128&&(c&192)===128&&(y=(i&15)<<18|(a&63)<<12|(f&63)<<6|c&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=o}return $p(n)}var hu=4096;function $p(e){let t=e.length;if(t<=hu)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=hu));return r}var Cp=256,Mi=class{constructor(t=Cp){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let i=r.length-(this.maxCursor-this.cursor)-1;r.set(t,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=_u(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=an(n,0,this.cursor)}else r=vu(this.chunks,this.cursor);return t&&this.reset(),r}};var ve="CBOR decode error:",ds="CBOR encode error:",Dn=[];Dn[23]=1;Dn[24]=2;Dn[25]=3;Dn[26]=5;Dn[27]=9;function Xt(e,t,r){if(e.length-t<r)throw new Error(`${ve} not enough data for type`)}var Ke=[24,256,65536,4294967296,BigInt("18446744073709551616")];function it(e,t,r){Xt(e,t,1);let n=e[t];if(r.strict===!0&&n<Ke[0])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function ot(e,t,r){Xt(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Ke[1])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function st(e,t,r){Xt(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Ke[2])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function at(e,t,r){Xt(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&s<Ke[3])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${ve} integers outside of the safe integer range are not supported`)}function Tu(e,t,r,n){return new ce(L.uint,it(e,t+1,n),2)}function Ou(e,t,r,n){return new ce(L.uint,ot(e,t+1,n),3)}function Au(e,t,r,n){return new ce(L.uint,st(e,t+1,n),5)}function Iu(e,t,r,n){return new ce(L.uint,at(e,t+1,n),9)}function ht(e,t){return ze(e,0,t.value)}function ze(e,t,r){if(r<Ke[0]){let n=Number(r);e.push([t|n])}else if(r<Ke[1]){let n=Number(r);e.push([t|24,n])}else if(r<Ke[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Ke[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Ke[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),o=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${ve} encountered BigInt larger than allowable range`)}}ht.encodedSize=function(t){return ze.encodedSize(t.value)};ze.encodedSize=function(t){return t<Ke[0]?1:t<Ke[1]?2:t<Ke[2]?3:t<Ke[3]?5:9};ht.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Eu(e,t,r,n){return new ce(L.negint,-1-it(e,t+1,n),2)}function Su(e,t,r,n){return new ce(L.negint,-1-ot(e,t+1,n),3)}function xu(e,t,r,n){return new ce(L.negint,-1-st(e,t+1,n),5)}var ps=BigInt(-1),Nu=BigInt(1);function $u(e,t,r,n){let i=at(e,t+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new ce(L.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${ve} integers outside of the safe integer range are not supported`);return new ce(L.negint,ps-BigInt(i),9)}function Di(e,t){let r=t.value,n=typeof r=="bigint"?r*ps-Nu:r*-1-1;ze(e,t.type.majorEncoded,n)}Di.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*ps-Nu:r*-1-1;return n<Ke[0]?1:n<Ke[1]?2:n<Ke[2]?3:n<Ke[3]?5:9};Di.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function jn(e,t,r,n){Xt(e,t,r+n);let i=an(e,t+r,t+r+n);return new ce(L.bytes,i,r+n)}function Cu(e,t,r,n){return jn(e,t,1,r)}function Pu(e,t,r,n){return jn(e,t,2,it(e,t+1,n))}function Uu(e,t,r,n){return jn(e,t,3,ot(e,t+1,n))}function Ru(e,t,r,n){return jn(e,t,5,st(e,t+1,n))}function Bu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer bytes lengths not supported`);return jn(e,t,9,i)}function ji(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===L.string?bu(e.value):e.value),e.encodedBytes}function un(e,t){let r=ji(t);ze(e,t.type.majorEncoded,r.length),e.push(r)}un.encodedSize=function(t){let r=ji(t);return ze.encodedSize(r.length)+r.length};un.compareTokens=function(t,r){return Up(ji(t),ji(r))};function Up(e,t){return e.length<t.length?-1:e.length>t.length?1:wu(e,t)}function Ln(e,t,r,n,i){let s=r+n;Xt(e,t,s);let o=new ce(L.string,gu(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=an(e,t+r,t+s)),o}function ku(e,t,r,n){return Ln(e,t,1,r,n)}function Mu(e,t,r,n){return Ln(e,t,2,it(e,t+1,n),n)}function Du(e,t,r,n){return Ln(e,t,3,ot(e,t+1,n),n)}function ju(e,t,r,n){return Ln(e,t,5,st(e,t+1,n),n)}function Lu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer string lengths not supported`);return Ln(e,t,9,i,n)}var Fu=un;function cn(e,t,r,n){return new ce(L.array,n,r)}function Vu(e,t,r,n){return cn(e,t,1,r)}function Ku(e,t,r,n){return cn(e,t,2,it(e,t+1,n))}function zu(e,t,r,n){return cn(e,t,3,ot(e,t+1,n))}function qu(e,t,r,n){return cn(e,t,5,st(e,t+1,n))}function Gu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer array lengths not supported`);return cn(e,t,9,i)}function Hu(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return cn(e,t,1,1/0)}function Li(e,t){ze(e,L.array.majorEncoded,t.value)}Li.compareTokens=ht.compareTokens;Li.encodedSize=function(t){return ze.encodedSize(t.value)};function fn(e,t,r,n){return new ce(L.map,n,r)}function Wu(e,t,r,n){return fn(e,t,1,r)}function Ju(e,t,r,n){return fn(e,t,2,it(e,t+1,n))}function Xu(e,t,r,n){return fn(e,t,3,ot(e,t+1,n))}function Yu(e,t,r,n){return fn(e,t,5,st(e,t+1,n))}function Qu(e,t,r,n){let i=at(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer map lengths not supported`);return fn(e,t,9,i)}function Zu(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return fn(e,t,1,1/0)}function Fi(e,t){ze(e,L.map.majorEncoded,t.value)}Fi.compareTokens=ht.compareTokens;Fi.encodedSize=function(t){return ze.encodedSize(t.value)};function ec(e,t,r,n){return new ce(L.tag,r,1)}function tc(e,t,r,n){return new ce(L.tag,it(e,t+1,n),2)}function rc(e,t,r,n){return new ce(L.tag,ot(e,t+1,n),3)}function nc(e,t,r,n){return new ce(L.tag,st(e,t+1,n),5)}function ic(e,t,r,n){return new ce(L.tag,at(e,t+1,n),9)}function Vi(e,t){ze(e,L.tag.majorEncoded,t.value)}Vi.compareTokens=ht.compareTokens;Vi.encodedSize=function(t){return ze.encodedSize(t.value)};var jp=20,Lp=21,Fp=22,Vp=23;function oc(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${ve} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new ce(L.null,null,1):new ce(L.undefined,void 0,1)}function sc(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return new ce(L.break,void 0,1)}function ys(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${ve} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${ve} Infinity values are not supported`)}return new ce(L.float,e,t)}function ac(e,t,r,n){return ys(hs(e,t+1),3,n)}function uc(e,t,r,n){return ys(ms(e,t+1),5,n)}function cc(e,t,r,n){return ys(pc(e,t+1),9,n)}function Ki(e,t,r){let n=t.value;if(n===!1)e.push([L.float.majorEncoded|jp]);else if(n===!0)e.push([L.float.majorEncoded|Lp]);else if(n===null)e.push([L.float.majorEncoded|Fp]);else if(n===void 0)e.push([L.float.majorEncoded|Vp]);else{let i,s=!1;(!r||r.float64!==!0)&&(lc(n),i=hs(Nt,1),n===i||Number.isNaN(n)?(Nt[0]=249,e.push(Nt.slice(0,3)),s=!0):(dc(n),i=ms(Nt,1),n===i&&(Nt[0]=250,e.push(Nt.slice(0,5)),s=!0))),s||(Kp(n),i=pc(Nt,1),Nt[0]=251,e.push(Nt.slice(0,9)))}}Ki.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){lc(n);let i=hs(Nt,1);if(n===i||Number.isNaN(n))return 3;if(dc(n),i=ms(Nt,1),n===i)return 5}return 9};var fc=new ArrayBuffer(9),mt=new DataView(fc,1),Nt=new Uint8Array(fc,0);function lc(e){if(e===1/0)mt.setUint16(0,31744,!1);else if(e===-1/0)mt.setUint16(0,64512,!1);else if(Number.isNaN(e))mt.setUint16(0,32256,!1);else{mt.setFloat32(0,e);let t=mt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)mt.setUint16(0,31744,!1);else if(r===0)mt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?mt.setUint16(0,0):i<-14?mt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):mt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function hs(e,t){if(e.length-t<2)throw new Error(`${ve} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function dc(e){mt.setFloat32(0,e,!1)}function ms(e,t){if(e.length-t<4)throw new Error(`${ve} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Kp(e){mt.setFloat64(0,e,!1)}function pc(e,t){if(e.length-t<8)throw new Error(`${ve} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}Ki.compareTokens=ht.compareTokens;function Oe(e,t,r){throw new Error(`${ve} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function zi(e){return()=>{throw new Error(`${ve} ${e}`)}}var ae=[];for(let e=0;e<=23;e++)ae[e]=Oe;ae[24]=Tu;ae[25]=Ou;ae[26]=Au;ae[27]=Iu;ae[28]=Oe;ae[29]=Oe;ae[30]=Oe;ae[31]=Oe;for(let e=32;e<=55;e++)ae[e]=Oe;ae[56]=Eu;ae[57]=Su;ae[58]=xu;ae[59]=$u;ae[60]=Oe;ae[61]=Oe;ae[62]=Oe;ae[63]=Oe;for(let e=64;e<=87;e++)ae[e]=Cu;ae[88]=Pu;ae[89]=Uu;ae[90]=Ru;ae[91]=Bu;ae[92]=Oe;ae[93]=Oe;ae[94]=Oe;ae[95]=zi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ae[e]=ku;ae[120]=Mu;ae[121]=Du;ae[122]=ju;ae[123]=Lu;ae[124]=Oe;ae[125]=Oe;ae[126]=Oe;ae[127]=zi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ae[e]=Vu;ae[152]=Ku;ae[153]=zu;ae[154]=qu;ae[155]=Gu;ae[156]=Oe;ae[157]=Oe;ae[158]=Oe;ae[159]=Hu;for(let e=160;e<=183;e++)ae[e]=Wu;ae[184]=Ju;ae[185]=Xu;ae[186]=Yu;ae[187]=Qu;ae[188]=Oe;ae[189]=Oe;ae[190]=Oe;ae[191]=Zu;for(let e=192;e<=215;e++)ae[e]=ec;ae[216]=tc;ae[217]=rc;ae[218]=nc;ae[219]=ic;ae[220]=Oe;ae[221]=Oe;ae[222]=Oe;ae[223]=Oe;for(let e=224;e<=243;e++)ae[e]=zi("simple values are not supported");ae[244]=Oe;ae[245]=Oe;ae[246]=Oe;ae[247]=oc;ae[248]=zi("simple values are not supported");ae[249]=ac;ae[250]=uc;ae[251]=cc;ae[252]=Oe;ae[253]=Oe;ae[254]=Oe;ae[255]=sc;var $t=[];for(let e=0;e<24;e++)$t[e]=new ce(L.uint,e,1);for(let e=-1;e>=-24;e--)$t[31-e]=new ce(L.negint,e,1);$t[64]=new ce(L.bytes,new Uint8Array(0),1);$t[96]=new ce(L.string,"",1);$t[128]=new ce(L.array,0,1);$t[160]=new ce(L.map,0,1);$t[244]=new ce(L.false,!1,1);$t[245]=new ce(L.true,!0,1);$t[246]=new ce(L.null,null,1);function gs(){let e=[];return e[L.uint.major]=ht,e[L.negint.major]=Di,e[L.bytes.major]=un,e[L.string.major]=Fu,e[L.array.major]=Li,e[L.map.major]=Fi,e[L.tag.major]=Vi,e[L.float.major]=Ki,e}var lI=gs(),dI=new Mi,Gi=class e{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${ds} object contains circular references`);return new e(r,t)}},or={null:new ce(L.null,null),undefined:new ce(L.undefined,void 0),true:new ce(L.true,!0),false:new ce(L.false,!1),emptyArray:new ce(L.array,0),emptyMap:new ce(L.map,0)},sr={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ce(L.float,e):e>=0?new ce(L.uint,e):new ce(L.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new ce(L.uint,e):new ce(L.negint,e)},Uint8Array(e,t,r,n){return new ce(L.bytes,e)},string(e,t,r,n){return new ce(L.string,e)},boolean(e,t,r,n){return e?or.true:or.false},null(e,t,r,n){return or.null},undefined(e,t,r,n){return or.undefined},ArrayBuffer(e,t,r,n){return new ce(L.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new ce(L.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[or.emptyArray,new ce(L.break)]:or.emptyArray;n=Gi.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=qi(o,r,n);return r.addBreakTokens?[new ce(L.array,e.length),i,new ce(L.break)]:[new ce(L.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length;if(!o)return r.addBreakTokens===!0?[or.emptyMap,new ce(L.break)]:or.emptyMap;n=Gi.createCheck(n,e);let a=[],f=0;for(let c of s)a[f++]=[qi(c,r,n),qi(i?e.get(c):e[c],r,n)];return Gp(a,r),r.addBreakTokens?[new ce(L.map,o),a,new ce(L.break)]:[new ce(L.map,o),a]}};sr.Map=sr.Object;sr.Buffer=sr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))sr[`${e}Array`]=sr.DataView;function qi(e,t={},r){let n=du(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||sr[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=sr[n];if(!s)throw new Error(`${ds} unsupported type: ${n}`);return s(e,n,t,r)}function Gp(e,t){t.mapSorter&&e.sort(t.mapSorter)}var Hp={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},bs=class{constructor(t,r={}){this._pos=0,this.data=t,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let t=this.data[this._pos],r=$t[t];if(r===void 0){let n=ae[t];if(!n)throw new Error(`${ve} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let i=t&31;r=n(this.data,this._pos,i,this.options)}return this._pos+=r.encodedLength,r}},Fn=Symbol.for("DONE"),Hi=Symbol.for("BREAK");function Wp(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=Vn(t,r);if(s===Hi){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed array`)}if(s===Fn)throw new Error(`${ve} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function Jp(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let o=0;o<e.value;o++){let a=Vn(t,r);if(a===Hi){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed map`)}if(a===Fn)throw new Error(`${ve} found map but not enough entries (got ${o} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${ve} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(a)||!n&&a in i))throw new Error(`${ve} found repeat map key "${a}"`);let f=Vn(t,r);if(f===Fn)throw new Error(`${ve} found map but not enough entries (got ${o} [no value], expected ${e.value})`);n?s.set(a,f):i[a]=f}return n?s:i}function Vn(e,t){if(e.done())return Fn;let r=e.next();if(r.type===L.break)return Hi;if(r.type.terminal)return r.value;if(r.type===L.array)return Wp(r,e,t);if(r.type===L.map)return Jp(r,e,t);if(r.type===L.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Vn(e,t);return t.tags[r.value](n)}throw new Error(`${ve} tag not supported (${r.value})`)}throw new Error("unsupported")}function yc(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ve} data to decode must be a Uint8Array`);t=Object.assign({},Hp,t);let r=t.tokenizer||new bs(e,t),n=Vn(r,t);if(n===Fn)throw new Error(`${ve} did not find any content to decode`);if(n===Hi)throw new Error(`${ve} got unexpected break`);return[n,e.subarray(r.pos())]}function vs(e,t){let[r,n]=yc(e,t);if(n.length>0)throw new Error(`${ve} too many terminals, data makes no sense`);return r}var Qp=42;function Zp(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return xt.decode(e.subarray(1))}var hc={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};hc.tags[Qp]=Zp;var _s=e=>vs(e,hc);var ar=fs(Wi(),1),Kn={SHA2_256:18,LENGTH:32,DAG_PB:112},Os=40;function ln(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=ar.default.decode(e);return t.seek(ar.default.decode.bytes),r}function As(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}function Is(e){ar.default.decode(e);let t=ar.default.decode.bytes,r=ar.default.decode(e.subarray(ar.default.decode.bytes)),n=ar.default.decode.bytes;return t+n+r}var ur={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},zn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=zn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=zn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:ur.Int,CarV1HeaderOrV2Pragma:e=>{if(ur.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=zn["CarV1HeaderOrV2Pragma > roots (anon)"](e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=zn.Int(e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},qn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=qn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=qn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:ur.Int,CarV1HeaderOrV2Pragma:e=>{if(ur.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=qn["CarV1HeaderOrV2Pragma > roots (anon)"](o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=qn.Int(o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},Es={toTyped:zn.CarV1HeaderOrV2Pragma,toRepresentation:qn.CarV1HeaderOrV2Pragma};var kI=gs();var gy=fs(Wi(),1);var FI=[new ce(L.map,2),new ce(L.string,"version"),new ce(L.uint,1),new ce(L.string,"roots")],VI=new ce(L.tag,42);async function Ss(e,t){let r=ln(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=_s(n);if(Es.toTyped(i)===void 0)throw new Error("Invalid CAR header format");if(i.version!==1&&i.version!==2||t!==void 0&&i.version!==t)throw new Error(`Invalid CAR version: ${i.version}${t!==void 0?` (expected ${t})`:""}`);if(i.version===1){if(!Array.isArray(i.roots))throw new Error("Invalid CAR header format");return i}if(i.roots!==void 0)throw new Error("Invalid CAR header format");let s=As(await e.exactly(Os,!0));e.seek(s.dataOffset-e.pos);let o=await Ss(e,1);return Object.assign(o,s)}async function vy(e){let t=await e.exactly(2,!1);if(t[0]===Kn.SHA2_256&&t[1]===Kn.LENGTH){let o=await e.exactly(34,!0),a=Bi(o);return xt.create(0,Kn.DAG_PB,a)}let r=ln(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=ln(await e.upTo(8),e),i=await e.exactly(Is(await e.upTo(8)),!0),s=Bi(i);return xt.create(r,n,s)}async function Ic(e){let t=e.pos,r=ln(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await vy(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function _y(e){let{cid:t,blockLength:r}=await Ic(e);return{bytes:await e.exactly(r,!0),cid:t}}async function wy(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await Ic(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function cr(e){let t=(async()=>{let r=await Ss(e);if(r.version===2){let n=e.pos-r.dataOffset;e=Oy(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await _y(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await wy(e)}}}function Cr(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let i=e.subarray(t,t+r);return n&&(t+=r),i},seek(r){t+=r},get pos(){return t}}}function Ty(e){let t=0,r=0,n=0,i=new Uint8Array(0),s=async o=>{r=i.length-n;let a=[i.subarray(n)];for(;r<o;){let c=await e();if(c==null)break;r<0?c.length>r&&a.push(c.subarray(-r)):a.push(c),r+=c.length}i=new Uint8Array(a.reduce((c,y)=>c+y.length,0));let f=0;for(let c of a)i.set(c,f),f+=c.length;n=0};return{async upTo(o){return i.length-n<o&&await s(o),i.subarray(n,n+Math.min(i.length-n,o))},async exactly(o,a=!1){if(i.length-n<o&&await s(o),i.length-n<o)throw new Error("Unexpected end of data");let f=i.subarray(n,n+o);return a&&(t+=o,n+=o),f},seek(o){t+=o,n+=o},get pos(){return t}}}function fr(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return Ty(r)}function Oy(e,t){let r=0;return{async upTo(n){let i=await e.upTo(n);return i.length+r>t&&(i=i.subarray(0,t-r)),i},async exactly(n,i=!1){let s=await e.exactly(n,i);if(s.length+r>t)throw new Error("Unexpected end of data");return i&&(r+=n),s},seek(n){r+=n,e.seek(n)},get pos(){return e.pos}}}var Gn=class{constructor(t,r,n){this._version=t,this._roots=r,this._iterator=n}get version(){return this._version}async getRoots(){return this._roots}[Symbol.asyncIterator](){return this._iterator}static async fromBytes(t){if(!(t instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return Ec(Cr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Ec(fr(t))}};async function Ec(e){let t=cr(e),{version:r,roots:n}=await t.header();return new Gn(r,n,t.blocksIndex())}var Pr=class{constructor(t,r){this._header=t,this._blocks=r,this._keys=r.map(n=>n.cid.toString())}get version(){return this._header.version}async getRoots(){return this._header.roots}async has(t){return this._keys.indexOf(t.toString())>-1}async get(t){let r=this._keys.indexOf(t.toString());return r>-1?this._blocks[r]:void 0}async*blocks(){for(let t of this._blocks)yield t}async*cids(){for(let t of this._blocks)yield t.cid}static async fromBytes(t){if(!(t instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return Sc(Cr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Sc(fr(t))}};async function Sc(e){let t=cr(e),r=await t.header(),n=[];for await(let i of t.blocks())n.push(i);return new Pr(r,n)}var Ji=class{constructor(t,r,n){this._version=t,this._roots=r,this._iterable=n,this._decoded=!1}get version(){return this._version}async getRoots(){return this._roots}},xs=class e extends Ji{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");return this._decoded=!0,this._iterable[Symbol.asyncIterator]()}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await xc(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Nc(t);return new e(r,n,i)}},Ns=class e extends Ji{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");this._decoded=!0;let t=this._iterable[Symbol.asyncIterator]();return{async next(){let r=await t.next();return r.done?r:{done:!1,value:r.value.cid}}}}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await xc(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Nc(t);return new e(r,n,i)}};async function xc(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return $c(Cr(e))}async function Nc(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return $c(fr(e))}async function $c(e){let t=cr(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var Ay=fs(Wi(),1);var Cc=class{constructor(t){this._iterator=t}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}};var Iy=Object.create,$s=Object.defineProperty,Ey=Object.getOwnPropertyDescriptor,Pc=Object.getOwnPropertyNames,Sy=Object.getPrototypeOf,xy=Object.prototype.hasOwnProperty,Le=(e,t)=>function(){return t||(0,e[Pc(e)[0]])((t={exports:{}}).exports,t),t.exports},Cs=(e,t)=>{for(var r in t)$s(e,r,{get:t[r],enumerable:!0})},Ny=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pc(t))!xy.call(e,i)&&i!==r&&$s(e,i,{get:()=>t[i],enumerable:!(n=Ey(t,i))||n.enumerable});return e},jt=(e,t,r)=>(r=e!=null?Iy(Sy(e)):{},Ny(t||!e||!e.__esModule?$s(r,"default",{value:e,enumerable:!0}):r,e));var $y={};Cs($y,{code:()=>cf,decode:()=>lo,encode:()=>Zs,format:()=>Vc,name:()=>Bm,parse:()=>Mm,stringify:()=>Vc});var Cy=["string","number","bigint","symbol"],Py=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Uy(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Cy.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Ry(e))return"Buffer";let r=By(e);return r||"Object"}function Ry(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function By(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Py.includes(t))return t}var C=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};C.uint=new C(0,"uint",!0);C.negint=new C(1,"negint",!0);C.bytes=new C(2,"bytes",!0);C.string=new C(3,"string",!0);C.array=new C(4,"array",!1);C.map=new C(5,"map",!1);C.tag=new C(6,"tag",!1);C.float=new C(7,"float",!0);C.false=new C(7,"false",!0);C.true=new C(7,"true",!0);C.null=new C(7,"null",!0);C.undefined=new C(7,"undefined",!0);C.break=new C(7,"break",!0);var Z=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},dn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",ky=new TextDecoder,My=new TextEncoder;function Qi(e){return dn&&globalThis.Buffer.isBuffer(e)}function js(e){return e instanceof Uint8Array?Qi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Dy=dn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Rc(e,t,r):(e,t,r)=>r-t>64?ky.decode(e.subarray(t,r)):Rc(e,t,r),zc=dn?e=>e.length>64?globalThis.Buffer.from(e):Uc(e):e=>e.length>64?My.encode(e):Uc(e);var Ls=dn?(e,t,r)=>Qi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),jy=dn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),js(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},Ly=dn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function Fy(e,t){if(Qi(e)&&Qi(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Uc(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function Rc(e,t,r){let n=[];for(;t<r;){let i=e[t],s=null,o=i>239?4:i>223?3:i>191?2:1;if(t+o<=r){let a,f,c,y;switch(o){case 1:i<128&&(s=i);break;case 2:a=e[t+1],(a&192)===128&&(y=(i&31)<<6|a&63,y>127&&(s=y));break;case 3:a=e[t+1],f=e[t+2],(a&192)===128&&(f&192)===128&&(y=(i&15)<<12|(a&63)<<6|f&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:a=e[t+1],f=e[t+2],c=e[t+3],(a&192)===128&&(f&192)===128&&(c&192)===128&&(y=(i&15)<<18|(a&63)<<12|(f&63)<<6|c&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=o}return qc(n)}var Bc=4096;function qc(e){let t=e.length;if(t<=Bc)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Bc));return r}var Vy=256,Gc=class{constructor(e=Vy){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let n=t.length-(this.maxCursor-this.cursor)-1;t.set(e,n)}else{if(t){let n=t.length-(this.maxCursor-this.cursor)-1;n<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,n),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=Ly(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=Ls(r,0,this.cursor)}else t=jy(this.chunks,this.cursor);return e&&this.reset(),t}},he="CBOR decode error:",Ur="CBOR encode error:",Qn=[];Qn[23]=1;Qn[24]=2;Qn[25]=3;Qn[26]=5;Qn[27]=9;function pn(e,t,r){if(e.length-t<r)throw new Error(`${he} not enough data for type`)}var qe=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Rr(e,t,r){pn(e,t,1);let n=e[t];if(r.strict===!0&&n<qe[0])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function Br(e,t,r){pn(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<qe[1])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function kr(e,t,r){pn(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<qe[2])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function Mr(e,t,r){pn(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&s<qe[3])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${he} integers outside of the safe integer range are not supported`)}function Ky(e,t,r,n){return new Z(C.uint,Rr(e,t+1,n),2)}function zy(e,t,r,n){return new Z(C.uint,Br(e,t+1,n),3)}function qy(e,t,r,n){return new Z(C.uint,kr(e,t+1,n),5)}function Gy(e,t,r,n){return new Z(C.uint,Mr(e,t+1,n),9)}function Dr(e,t){return bt(e,0,t.value)}function bt(e,t,r){if(r<qe[0]){let n=Number(r);e.push([t|n])}else if(r<qe[1]){let n=Number(r);e.push([t|24,n])}else if(r<qe[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<qe[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<qe[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),o=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${he} encountered BigInt larger than allowable range`)}}Dr.encodedSize=function(t){return bt.encodedSize(t.value)};bt.encodedSize=function(t){return t<qe[0]?1:t<qe[1]?2:t<qe[2]?3:t<qe[3]?5:9};Dr.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Hy(e,t,r,n){return new Z(C.negint,-1-Rr(e,t+1,n),2)}function Wy(e,t,r,n){return new Z(C.negint,-1-Br(e,t+1,n),3)}function Jy(e,t,r,n){return new Z(C.negint,-1-kr(e,t+1,n),5)}var Fs=BigInt(-1),Hc=BigInt(1);function Xy(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new Z(C.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${he} integers outside of the safe integer range are not supported`);return new Z(C.negint,Fs-BigInt(i),9)}function Vs(e,t){let r=t.value,n=typeof r=="bigint"?r*Fs-Hc:r*-1-1;bt(e,t.type.majorEncoded,n)}Vs.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Fs-Hc:r*-1-1;return n<qe[0]?1:n<qe[1]?2:n<qe[2]?3:n<qe[3]?5:9};Vs.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Zn(e,t,r,n){pn(e,t,r+n);let i=Ls(e,t+r,t+r+n);return new Z(C.bytes,i,r+n)}function Yy(e,t,r,n){return Zn(e,t,1,r)}function Qy(e,t,r,n){return Zn(e,t,2,Rr(e,t+1,n))}function Zy(e,t,r,n){return Zn(e,t,3,Br(e,t+1,n))}function eh(e,t,r,n){return Zn(e,t,5,kr(e,t+1,n))}function th(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer bytes lengths not supported`);return Zn(e,t,9,i)}function Zi(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===C.string?zc(e.value):e.value),e.encodedBytes}function so(e,t){let r=Zi(t);bt(e,t.type.majorEncoded,r.length),e.push(r)}so.encodedSize=function(t){let r=Zi(t);return bt.encodedSize(r.length)+r.length};so.compareTokens=function(t,r){return rh(Zi(t),Zi(r))};function rh(e,t){return e.length<t.length?-1:e.length>t.length?1:Fy(e,t)}function ei(e,t,r,n,i){let s=r+n;pn(e,t,s);let o=new Z(C.string,Dy(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=Ls(e,t+r,t+s)),o}function nh(e,t,r,n){return ei(e,t,1,r,n)}function ih(e,t,r,n){return ei(e,t,2,Rr(e,t+1,n),n)}function oh(e,t,r,n){return ei(e,t,3,Br(e,t+1,n),n)}function sh(e,t,r,n){return ei(e,t,5,kr(e,t+1,n),n)}function ah(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer string lengths not supported`);return ei(e,t,9,i,n)}var uh=so;function yn(e,t,r,n){return new Z(C.array,n,r)}function ch(e,t,r,n){return yn(e,t,1,r)}function fh(e,t,r,n){return yn(e,t,2,Rr(e,t+1,n))}function lh(e,t,r,n){return yn(e,t,3,Br(e,t+1,n))}function dh(e,t,r,n){return yn(e,t,5,kr(e,t+1,n))}function ph(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer array lengths not supported`);return yn(e,t,9,i)}function yh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return yn(e,t,1,1/0)}function Ks(e,t){bt(e,C.array.majorEncoded,t.value)}Ks.compareTokens=Dr.compareTokens;Ks.encodedSize=function(t){return bt.encodedSize(t.value)};function hn(e,t,r,n){return new Z(C.map,n,r)}function hh(e,t,r,n){return hn(e,t,1,r)}function mh(e,t,r,n){return hn(e,t,2,Rr(e,t+1,n))}function gh(e,t,r,n){return hn(e,t,3,Br(e,t+1,n))}function bh(e,t,r,n){return hn(e,t,5,kr(e,t+1,n))}function vh(e,t,r,n){let i=Mr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer map lengths not supported`);return hn(e,t,9,i)}function _h(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return hn(e,t,1,1/0)}function zs(e,t){bt(e,C.map.majorEncoded,t.value)}zs.compareTokens=Dr.compareTokens;zs.encodedSize=function(t){return bt.encodedSize(t.value)};function wh(e,t,r,n){return new Z(C.tag,r,1)}function Th(e,t,r,n){return new Z(C.tag,Rr(e,t+1,n),2)}function Oh(e,t,r,n){return new Z(C.tag,Br(e,t+1,n),3)}function Ah(e,t,r,n){return new Z(C.tag,kr(e,t+1,n),5)}function Ih(e,t,r,n){return new Z(C.tag,Mr(e,t+1,n),9)}function qs(e,t){bt(e,C.tag.majorEncoded,t.value)}qs.compareTokens=Dr.compareTokens;qs.encodedSize=function(t){return bt.encodedSize(t.value)};var Eh=20,Sh=21,xh=22,Nh=23;function $h(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${he} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new Z(C.null,null,1):new Z(C.undefined,void 0,1)}function Ch(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return new Z(C.break,void 0,1)}function Gs(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${he} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${he} Infinity values are not supported`)}return new Z(C.float,e,t)}function Ph(e,t,r,n){return Gs(Ws(e,t+1),3,n)}function Uh(e,t,r,n){return Gs(Js(e,t+1),5,n)}function Rh(e,t,r,n){return Gs(Yc(e,t+1),9,n)}function Hs(e,t,r){let n=t.value;if(n===!1)e.push([C.float.majorEncoded|Eh]);else if(n===!0)e.push([C.float.majorEncoded|Sh]);else if(n===null)e.push([C.float.majorEncoded|xh]);else if(n===void 0)e.push([C.float.majorEncoded|Nh]);else{let i,s=!1;(!r||r.float64!==!0)&&(Jc(n),i=Ws(Pt,1),n===i||Number.isNaN(n)?(Pt[0]=249,e.push(Pt.slice(0,3)),s=!0):(Xc(n),i=Js(Pt,1),n===i&&(Pt[0]=250,e.push(Pt.slice(0,5)),s=!0))),s||(Bh(n),i=Yc(Pt,1),Pt[0]=251,e.push(Pt.slice(0,9)))}}Hs.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Jc(n);let i=Ws(Pt,1);if(n===i||Number.isNaN(n))return 3;if(Xc(n),i=Js(Pt,1),n===i)return 5}return 9};var Wc=new ArrayBuffer(9),gt=new DataView(Wc,1),Pt=new Uint8Array(Wc,0);function Jc(e){if(e===1/0)gt.setUint16(0,31744,!1);else if(e===-1/0)gt.setUint16(0,64512,!1);else if(Number.isNaN(e))gt.setUint16(0,32256,!1);else{gt.setFloat32(0,e);let t=gt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)gt.setUint16(0,31744,!1);else if(r===0)gt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?gt.setUint16(0,0):i<-14?gt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):gt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Ws(e,t){if(e.length-t<2)throw new Error(`${he} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function Xc(e){gt.setFloat32(0,e,!1)}function Js(e,t){if(e.length-t<4)throw new Error(`${he} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Bh(e){gt.setFloat64(0,e,!1)}function Yc(e,t){if(e.length-t<8)throw new Error(`${he} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}Hs.compareTokens=Dr.compareTokens;function Ae(e,t,r){throw new Error(`${he} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function ao(e){return()=>{throw new Error(`${he} ${e}`)}}var ue=[];for(let e=0;e<=23;e++)ue[e]=Ae;ue[24]=Ky;ue[25]=zy;ue[26]=qy;ue[27]=Gy;ue[28]=Ae;ue[29]=Ae;ue[30]=Ae;ue[31]=Ae;for(let e=32;e<=55;e++)ue[e]=Ae;ue[56]=Hy;ue[57]=Wy;ue[58]=Jy;ue[59]=Xy;ue[60]=Ae;ue[61]=Ae;ue[62]=Ae;ue[63]=Ae;for(let e=64;e<=87;e++)ue[e]=Yy;ue[88]=Qy;ue[89]=Zy;ue[90]=eh;ue[91]=th;ue[92]=Ae;ue[93]=Ae;ue[94]=Ae;ue[95]=ao("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ue[e]=nh;ue[120]=ih;ue[121]=oh;ue[122]=sh;ue[123]=ah;ue[124]=Ae;ue[125]=Ae;ue[126]=Ae;ue[127]=ao("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ue[e]=ch;ue[152]=fh;ue[153]=lh;ue[154]=dh;ue[155]=ph;ue[156]=Ae;ue[157]=Ae;ue[158]=Ae;ue[159]=yh;for(let e=160;e<=183;e++)ue[e]=hh;ue[184]=mh;ue[185]=gh;ue[186]=bh;ue[187]=vh;ue[188]=Ae;ue[189]=Ae;ue[190]=Ae;ue[191]=_h;for(let e=192;e<=215;e++)ue[e]=wh;ue[216]=Th;ue[217]=Oh;ue[218]=Ah;ue[219]=Ih;ue[220]=Ae;ue[221]=Ae;ue[222]=Ae;ue[223]=Ae;for(let e=224;e<=243;e++)ue[e]=ao("simple values are not supported");ue[244]=Ae;ue[245]=Ae;ue[246]=Ae;ue[247]=$h;ue[248]=ao("simple values are not supported");ue[249]=Ph;ue[250]=Uh;ue[251]=Rh;ue[252]=Ae;ue[253]=Ae;ue[254]=Ae;ue[255]=Ch;var Ft=[];for(let e=0;e<24;e++)Ft[e]=new Z(C.uint,e,1);for(let e=-1;e>=-24;e--)Ft[31-e]=new Z(C.negint,e,1);Ft[64]=new Z(C.bytes,new Uint8Array(0),1);Ft[96]=new Z(C.string,"",1);Ft[128]=new Z(C.array,0,1);Ft[160]=new Z(C.map,0,1);Ft[244]=new Z(C.false,!1,1);Ft[245]=new Z(C.true,!0,1);Ft[246]=new Z(C.null,null,1);function Xs(){let e=[];return e[C.uint.major]=Dr,e[C.negint.major]=Vs,e[C.bytes.major]=so,e[C.string.major]=uh,e[C.array.major]=Ks,e[C.map.major]=zs,e[C.tag.major]=qs,e[C.float.major]=Hs,e}var SE=Xs(),Ps=new Gc,kc=class Qc{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Ur} object contains circular references`);return new Qc(r,t)}},lr={null:new Z(C.null,null),undefined:new Z(C.undefined,void 0),true:new Z(C.true,!0),false:new Z(C.false,!1),emptyArray:new Z(C.array,0),emptyMap:new Z(C.map,0)},hr={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Z(C.float,e):e>=0?new Z(C.uint,e):new Z(C.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new Z(C.uint,e):new Z(C.negint,e)},Uint8Array(e,t,r,n){return new Z(C.bytes,e)},string(e,t,r,n){return new Z(C.string,e)},boolean(e,t,r,n){return e?lr.true:lr.false},null(e,t,r,n){return lr.null},undefined(e,t,r,n){return lr.undefined},ArrayBuffer(e,t,r,n){return new Z(C.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new Z(C.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[lr.emptyArray,new Z(C.break)]:lr.emptyArray;n=kc.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=Xi(o,r,n);return r.addBreakTokens?[new Z(C.array,e.length),i,new Z(C.break)]:[new Z(C.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length;if(!o)return r.addBreakTokens===!0?[lr.emptyMap,new Z(C.break)]:lr.emptyMap;n=kc.createCheck(n,e);let a=[],f=0;for(let c of s)a[f++]=[Xi(c,r,n),Xi(i?e.get(c):e[c],r,n)];return kh(a,r),r.addBreakTokens?[new Z(C.map,o),a,new Z(C.break)]:[new Z(C.map,o),a]}};hr.Map=hr.Object;hr.Buffer=hr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))hr[`${e}Array`]=hr.DataView;function Xi(e,t={},r){let n=Uy(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||hr[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=hr[n];if(!s)throw new Error(`${Ur} unsupported type: ${n}`);return s(e,n,t,r)}function kh(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Zc(e,t,r,n){if(Array.isArray(t))for(let i of t)Zc(e,i,r,n);else r[t.type.major](e,t,n)}function Mh(e,t,r){let n=Xi(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let s=t[n.type.major];if(s.encodedSize){let o=s.encodedSize(n,r),a=new Gc(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return js(a.chunks[0])}}return Ps.reset(),Zc(Ps,n,t,r),Ps.toBytes(!0)}var Dh={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},jh=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Ft[e];if(t===void 0){let r=ue[e];if(!r)throw new Error(`${he} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let n=e&31;t=r(this.data,this._pos,n,this.options)}return this._pos+=t.encodedLength,t}},Jn=Symbol.for("DONE"),uo=Symbol.for("BREAK");function Lh(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=Xn(t,r);if(s===uo){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed array`)}if(s===Jn)throw new Error(`${he} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function Fh(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let o=0;o<e.value;o++){let a=Xn(t,r);if(a===uo){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed map`)}if(a===Jn)throw new Error(`${he} found map but not enough entries (got ${o} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${he} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(a)||!n&&a in i))throw new Error(`${he} found repeat map key "${a}"`);let f=Xn(t,r);if(f===Jn)throw new Error(`${he} found map but not enough entries (got ${o} [no value], expected ${e.value})`);n?s.set(a,f):i[a]=f}return n?s:i}function Xn(e,t){if(e.done())return Jn;let r=e.next();if(r.type===C.break)return uo;if(r.type.terminal)return r.value;if(r.type===C.array)return Lh(r,e,t);if(r.type===C.map)return Fh(r,e,t);if(r.type===C.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Xn(e,t);return t.tags[r.value](n)}throw new Error(`${he} tag not supported (${r.value})`)}throw new Error("unsupported")}function Vh(e,t){if(!(e instanceof Uint8Array))throw new Error(`${he} data to decode must be a Uint8Array`);t=Object.assign({},Dh,t);let r=t.tokenizer||new jh(e,t),n=Xn(r,t);if(n===Jn)throw new Error(`${he} did not find any content to decode`);if(n===uo)throw new Error(`${he} got unexpected break`);return[n,e.subarray(r.pos())]}function Ys(e,t){let[r,n]=Vh(e,t);if(n.length>0)throw new Error(`${he} too many terminals, data makes no sense`);return r}var Kh=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===C.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===C.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[C.uint.major](e,t){this.prefix(e);let r=String(t.value),n=[];for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);e.push(n)}[C.negint.major](e,t){this[C.uint.major](e,t)}[C.bytes.major](e,t){throw new Error(`${Ur} unsupported type: Uint8Array`)}[C.string.major](e,t){this.prefix(e);let r=zc(JSON.stringify(t.value));e.push(r.length>32?js(r):r)}[C.array.major](e,t){this.prefix(e),this.inRecursive.push({type:C.array,elements:0}),e.push([91])}[C.map.major](e,t){this.prefix(e),this.inRecursive.push({type:C.map,elements:0}),e.push([123])}[C.tag.major](e,t){}[C.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===C.array)e.push([93]);else if(s.type===C.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${Ur} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let r=String(t.value),n=[],i=!1;for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s),!i&&(n[s]===46||n[s]===101||n[s]===69)&&(i=!0);i||(n.push(46),n.push(48)),e.push(n)}};function zh(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Ur} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==C.string||n.type!==C.string)throw new Error(`${Ur} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Ur} unexpected duplicate map keys, this is not supported`)}var qh={addBreakTokens:!0,mapSorter:zh};function Gh(e,t){return t=Object.assign({},qh,t),Mh(e,new Kh,t)}var ef=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${he} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${he} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!1,n=o=>{for(;!this.done();){let a=this.ch();if(o.includes(a))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,r=!0;else return new Z(C.uint,0,this._pos-e);if(n([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${he} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${he} unexpected token at position ${this._pos}`);r=!0,this._pos++,n([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,n([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(i);return r?new Z(C.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new Z(s>=0?C.uint:C.negint,s,this._pos-e):new Z(s>=0?C.uint:C.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${he} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,s=0;i<this.data.length&&s<65536;i++,s++){let o=this.data[i];if(o===92||o<32||o>=128)break;if(o===34){let a=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new Z(C.string,a,s)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${he} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let s=0;s<4;s++){let o=this.ch();if(o>=48&&o<=57)o-=48;else if(o>=97&&o<=102)o=o-97+10;else if(o>=65&&o<=70)o=o-65+10;else throw new Error(`${he} unexpected unicode escape character at position ${this._pos}`);i=i*16+o,this._pos++}return i},n=()=>{let i=this.ch(),s=null,o=i>239?4:i>223?3:i>191?2:1;if(this._pos+o>this.data.length)throw new Error(`${he} unexpected unicode sequence at position ${this._pos}`);let a,f,c,y;switch(o){case 1:i<128&&(s=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(y=(i&31)<<6|a&63,y>127&&(s=y));break;case 3:a=this.data[this._pos+1],f=this.data[this._pos+2],(a&192)===128&&(f&192)===128&&(y=(i&15)<<12|(a&63)<<6|f&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:a=this.data[this._pos+1],f=this.data[this._pos+2],c=this.data[this._pos+3],(a&192)===128&&(f&192)===128&&(c&192)===128&&(y=(i&15)<<18|(a&63)<<12|(f&63)<<6|c&63,y>65535&&y<1114112&&(s=y))}s===null?(s=65533,o=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=o};for(;!this.done();){let i=this.ch(),s;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${he} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(r());break;default:throw new Error(`${he} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new Z(C.string,qc(t),this._pos-e);default:if(i<32)throw new Error(`${he} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):n()}}throw new Error(`${he} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new Z(C.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new Z(C.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new Z(C.null,null,4);case 102:return this.expect([102,97,108,115,101]),new Z(C.false,!1,5);case 116:return this.expect([116,114,117,101]),new Z(C.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${he} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new Z(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new Z(C.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new Z(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new Z(C.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${he} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function Hh(e,t){return t=Object.assign({tokenizer:new ef(e,t)},t),Ys(e,t)}var xE=new Uint8Array(0),Wh=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},Qs=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};function Jh(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=e.length,f=e.charAt(0),c=Math.log(a)/Math.log(256),y=Math.log(256)/Math.log(a);function g(j){if(j instanceof Uint8Array||(ArrayBuffer.isView(j)?j=new Uint8Array(j.buffer,j.byteOffset,j.byteLength):Array.isArray(j)&&(j=Uint8Array.from(j))),!(j instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(j.length===0)return"";for(var te=0,W=0,B=0,z=j.length;B!==z&&j[B]===0;)B++,te++;for(var Y=(z-B)*y+1>>>0,ie=new Uint8Array(Y);B!==z;){for(var F=j[B],se=0,K=Y-1;(F!==0||se<W)&&K!==-1;K--,se++)F+=256*ie[K]>>>0,ie[K]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");W=se,B++}for(var ye=Y-W;ye!==Y&&ie[ye]===0;)ye++;for(var D=f.repeat(te);ye<Y;++ye)D+=e.charAt(ie[ye]);return D}function k(j){if(typeof j!="string")throw new TypeError("Expected String");if(j.length===0)return new Uint8Array;var te=0;if(j[te]!==" "){for(var W=0,B=0;j[te]===f;)W++,te++;for(var z=(j.length-te)*c+1>>>0,Y=new Uint8Array(z);j[te];){var ie=r[j.charCodeAt(te)];if(ie===255)return;for(var F=0,se=z-1;(ie!==0||F<B)&&se!==-1;se--,F++)ie+=a*Y[se]>>>0,Y[se]=ie%256>>>0,ie=ie/256>>>0;if(ie!==0)throw new Error("Non-zero carry");B=F,te++}if(j[te]!==" "){for(var K=z-B;K!==z&&Y[K]===0;)K++;for(var ye=new Uint8Array(W+(z-K)),D=W;K!==z;)ye[D++]=Y[K++];return ye}}}function U(j){var te=k(j);if(te)return te;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:k,decode:U}}var Xh=Jh,Yh=Xh,Qh=Yh,Zh=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},em=class{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return tf(this,e)}},tm=class{constructor(e){this.decoders=e}or(e){return tf(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},tf=(e,t)=>new tm({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),rm=class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Zh(e,t,r),this.decoder=new em(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},rf=({name:e,prefix:t,encode:r,decode:n})=>new rm(e,t,r,n),co=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=Qh(r,t);return rf({prefix:e,name:t,encode:n,decode:s=>Qs(i(s))})},nm=(e,t,r,n)=>{let i={};for(let y=0;y<t.length;++y)i[t[y]]=y;let s=e.length;for(;e[s-1]==="=";)--s;let o=new Uint8Array(s*r/8|0),a=0,f=0,c=0;for(let y=0;y<s;++y){let g=i[e[y]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|g,a+=r,a>=8&&(a-=8,o[c++]=255&f>>a)}if(a>=r||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return o},im=(e,t,r)=>{let n=t[t.length-1]==="=",i=(1<<r)-1,s="",o=0,a=0;for(let f=0;f<e.length;++f)for(a=a<<8|e[f],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},ut=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>rf({prefix:t,name:e,encode(i){return im(i,n,r)},decode(i){return nm(i,n,r,e)}}),Yi=ut({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),NE=ut({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),$E=ut({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),CE=ut({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),PE=ut({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),UE=ut({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),RE=ut({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),BE=ut({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kE=ut({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),yr=co({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ME=co({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),nf={};Cs(nf,{Digest:()=>fo,create:()=>no,decode:()=>ti,equals:()=>sf});var om=of,Mc=128,sm=127,am=~sm,um=Math.pow(2,31);function of(e,t,r){t=t||[],r=r||0;for(var n=r;e>=um;)t[r++]=e&255|Mc,e/=128;for(;e&am;)t[r++]=e&255|Mc,e>>>=7;return t[r]=e|0,of.bytes=r-n+1,t}var cm=Bs,fm=128,Dc=127;function Bs(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Bs.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&Dc)<<i:(o&Dc)*Math.pow(2,i),i+=7}while(o>=fm);return Bs.bytes=s-n,r}var lm=Math.pow(2,7),dm=Math.pow(2,14),pm=Math.pow(2,21),ym=Math.pow(2,28),hm=Math.pow(2,35),mm=Math.pow(2,42),gm=Math.pow(2,49),bm=Math.pow(2,56),vm=Math.pow(2,63),_m=function(e){return e<lm?1:e<dm?2:e<pm?3:e<ym?4:e<hm?5:e<mm?6:e<gm?7:e<bm?8:e<vm?9:10},wm={encode:om,decode:cm,encodingLength:_m},Tm=wm,eo=Tm,ks=(e,t=0)=>[eo.decode(e,t),eo.decode.bytes],to=(e,t,r=0)=>(eo.encode(e,t,r),t),ro=e=>eo.encodingLength(e),no=(e,t)=>{let r=t.byteLength,n=ro(e),i=n+ro(r),s=new Uint8Array(i+r);return to(e,s,0),to(r,s,n),s.set(t,i),new fo(e,r,t,s)},ti=e=>{let t=Qs(e),[r,n]=ks(t),[i,s]=ks(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new fo(r,i,o,t)},sf=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Wh(e.bytes,r.bytes)}},fo=class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},jc=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return Am(r,Ms(e),t||yr.encoder);default:return Im(r,Ms(e),t||Yi.encoder)}},Lc=new WeakMap,Ms=e=>{let t=Lc.get(e);if(t==null){let r=new Map;return Lc.set(e,r),r}return t},Ut=class Je{constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==Hn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Em)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Je.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=no(t,r);return Je.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return Je.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&&sf(t.multihash,n.multihash)}toString(t){return jc(this,t)}toJSON(){return{"/":jc(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof Je)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new Je(n,i,s,o||Fc(n,i,s.bytes))}else if(r[Sm]===!0){let{version:n,multihash:i,code:s}=r,o=ti(i);return Je.create(n,s,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==Hn)throw new Error(`Version 0 CID must use dag-pb (code: ${Hn}) block encoding`);return new Je(t,r,n,n.bytes)}case 1:{let i=Fc(t,r,n.bytes);return new Je(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Je.create(0,Hn,t)}static createV1(t,r){return Je.create(1,t,r)}static decode(t){let[r,n]=Je.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Je.inspectBytes(t),n=r.size-r.multihashSize,i=Qs(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new fo(r.multihashCode,r.digestSize,s,i);return[r.version===0?Je.createV0(o):Je.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,k]=ks(t.subarray(r));return r+=k,g},i=n(),s=Hn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),f=n(),c=r+f,y=c-o;return{version:i,codec:s,multihashCode:a,digestSize:f,multihashSize:y,size:c}}static parse(t,r){let[n,i]=Om(t,r),s=Je.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ms(s).set(n,t),s}},Om=(e,t)=>{switch(e[0]){case"Q":{let r=t||yr;return[yr.prefix,r.decode(`${yr.prefix}${e}`)]}case yr.prefix:{let r=t||yr;return[yr.prefix,r.decode(e)]}case Yi.prefix:{let r=t||Yi;return[Yi.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},Am=(e,t,r)=>{let{prefix:n}=r;if(n!==yr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return i},Im=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(i==null){let s=r.encode(e);return t.set(n,s),s}else return i},Hn=112,Em=18,Fc=(e,t,r)=>{let n=ro(e),i=n+ro(t),s=new Uint8Array(i+r.byteLength);return to(e,s,0),to(t,s,n),s.set(r,i),s},Sm=Symbol.for("@ipld/js-cid/CID"),af=({name:e,code:t,encode:r})=>new xm(e,t,r),xm=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?no(this.code,t):t.then(r=>no(this.code,r))}else throw Error("Unknown type, must be binary type")}},uf=ut({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),DE=ut({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),jE=ut({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),LE=ut({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function Nm(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Ut.asCID(e);if(!t)return null;let r=t.toString();return[new Z(C.map,1/0,1),new Z(C.string,"/",1),new Z(C.string,r,r.length),new Z(C.break,void 0,1)]}function io(e){let t=uf.encode(e).slice(1);return[new Z(C.map,1/0,1),new Z(C.string,"/",1),new Z(C.map,1/0,1),new Z(C.string,"bytes",5),new Z(C.string,t,t.length),new Z(C.break,void 0,1),new Z(C.break,void 0,1)]}function Ct(e){return io(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function $m(e){return io(new Uint8Array(e))}function Cm(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function Pm(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Um={typeEncoders:{Object:Nm,Buffer:io,Uint8Array:io,Int8Array:Ct,Uint16Array:Ct,Int16Array:Ct,Uint32Array:Ct,Int32Array:Ct,Float32Array:Ct,Float64Array:Ct,Uint8ClampedArray:Ct,BigInt64Array:Ct,BigUint64Array:Ct,DataView:Ct,ArrayBuffer:$m,undefined:Cm,number:Pm}},Rm=class extends ef{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===C.map){let t=this._next();if(t.type===C.string&&t.value==="/"){let r=this._next();if(r.type===C.string){if(this._next().type!==C.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new Z(C.tag,42,0)}if(r.type===C.map){let n=this._next();if(n.type===C.string&&n.value==="bytes"){let i=this._next();if(i.type===C.string){for(let o=0;o<2;o++)if(this._next().type!==C.break)throw new Error("Invalid encoded Bytes form");let s=uf.decode(`m${i.value}`);return new Z(C.bytes,s,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},Ds={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Ds.tags[42]=Ut.parse;var Bm="dag-json",cf=297,Zs=e=>Gh(e,Um),lo=e=>{let t=Object.assign(Ds,{tokenizer:new Rm(e,Ds)});return Hh(e,t)},Vc=e=>km.decode(Zs(e)),km=new TextDecoder,Mm=e=>lo(Dm.encode(e)),Dm=new TextEncoder;function jm(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Kc(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Lm(e,t){jm(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var Fm=e=>e instanceof Uint8Array,Us=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Lt=(e,t)=>e<<32-t|e>>>t,Vm=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Vm)throw new Error("Non little-endian hardware is not supported");function Km(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ff(e){if(typeof e=="string"&&(e=Km(e)),!Fm(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var zm=class{clone(){return this._cloneInto()}},FE={}.toString;function qm(e){let t=n=>e().update(ff(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Gm(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),f=n?4:0,c=n?0:4;e.setUint32(t+f,o,n),e.setUint32(t+c,a,n)}var Hm=class extends zm{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Us(this.buffer)}update(e){Kc(this);let{view:t,buffer:r,blockLen:n}=this;e=ff(e);let i=e.length;for(let s=0;s<i;){let o=Math.min(n-this.pos,i-s);if(o===n){let a=Us(e);for(;n<=i-s;s+=n)this.process(a,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Kc(this),Lm(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>n-s&&(this.process(r,0),s=0);for(let y=s;y<n;y++)t[y]=0;Gm(r,n-8,BigInt(this.length*8),i),this.process(r,0);let o=Us(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=a/4,c=this.get();if(f>c.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y<f;y++)o.setUint32(4*y,c[y],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}},Wm=(e,t,r)=>e&t^~e&r,Jm=(e,t,r)=>e&t^e&r^t&r,Xm=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),dr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),pr=new Uint32Array(64),Ym=class extends Hm{constructor(){super(64,32,8,!1),this.A=dr[0]|0,this.B=dr[1]|0,this.C=dr[2]|0,this.D=dr[3]|0,this.E=dr[4]|0,this.F=dr[5]|0,this.G=dr[6]|0,this.H=dr[7]|0}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=s|0,this.G=o|0,this.H=a|0}process(e,t){for(let y=0;y<16;y++,t+=4)pr[y]=e.getUint32(t,!1);for(let y=16;y<64;y++){let g=pr[y-15],k=pr[y-2],U=Lt(g,7)^Lt(g,18)^g>>>3,j=Lt(k,17)^Lt(k,19)^k>>>10;pr[y]=j+pr[y-7]+U+pr[y-16]|0}let{A:r,B:n,C:i,D:s,E:o,F:a,G:f,H:c}=this;for(let y=0;y<64;y++){let g=Lt(o,6)^Lt(o,11)^Lt(o,25),k=c+g+Wm(o,a,f)+Xm[y]+pr[y]|0,j=(Lt(r,2)^Lt(r,13)^Lt(r,22))+Jm(r,n,i)|0;c=f,f=a,a=o,o=s+k|0,s=i,i=n,n=r,r=k+j|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,f=f+this.G|0,c=c+this.H|0,this.set(r,n,i,s,o,a,f,c)}roundClean(){pr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Qm=qm(()=>new Ym),Zm=Object.create,ea=Object.defineProperty,eg=Object.getOwnPropertyDescriptor,lf=Object.getOwnPropertyNames,tg=Object.getPrototypeOf,rg=Object.prototype.hasOwnProperty,ng=(e,t,r)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,df=(e,t)=>function(){return t||(0,e[lf(e)[0]])((t={exports:{}}).exports,t),t.exports},ig=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lf(t))!rg.call(e,i)&&i!==r&&ea(e,i,{get:()=>t[i],enumerable:!(n=eg(t,i))||n.enumerable});return e},pf=(e,t,r)=>(r=e!=null?Zm(tg(e)):{},ig(t||!e||!e.__esModule?ea(r,"default",{value:e,enumerable:!0}):r,e)),mr=(e,t,r)=>(ng(e,typeof t!="symbol"?t+"":t,r),r),og=df({"../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",s=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),o=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=r,e.isWebWorker=i,e.isNode=n,e.isJsDom=s,e.isDeno=o}}),sg=df({"../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){"use strict";t.exports=function(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var i=typeof n.cycles=="boolean"?n.cycles:!1,s=n.cmp&&function(a){return function(f){return function(c,y){var g={key:c,value:f[c]},k={key:y,value:f[y]};return a(g,k)}}}(n.cmp),o=[];return function a(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var c,y;if(Array.isArray(f)){for(y="[",c=0;c<f.length;c++)c&&(y+=","),y+=a(f[c])||"null";return y+"]"}if(f===null)return"null";if(o.indexOf(f)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=o.push(f)-1,k=Object.keys(f).sort(s&&s(f));for(y="",c=0;c<k.length;c++){var U=k[c],j=a(f[U]);j&&(y&&(y+=","),y+=JSON.stringify(U)+":"+j)}return o.splice(g,1),"{"+y+"}"}}(r)}}}),Yn=pf(og(),1),ag=pf(sg(),1),yf=!1,hf=!1;Yn.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(yf=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(hf=process?.env?.LOGGER_PERF_PREFIX==="true"));var ug=Object.freeze({prefix:void 0,time:yf,delta:hf,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),Rs=[],mf=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,r,n){Object.assign(this,{sinceFirst:e,sinceLast:t,time:r,delta:n})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),r=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?t:null,this.delta?r:null].join(",")}]`}},gf=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Wn=!1,et=class{static setup(e=et.INFO,t={}){t=Object.assign({},ug,t),e>10&&console.debug("setup logger",{config:t});let r=this.wrapLog(console.debug,{...t,dim:t.dimDebugOnServer}),n=(...f)=>{window?.FORCE_DISABLE_LOGLEVEL&&r(...f)};n.isDisabled=!0,n.isEnabled=!1;let i=this.wrapLog(console.groupCollapsed,t),s=(f,c)=>{function y(...k){let U=k[k.length-1];return U===n?U():(i(...k.slice(0,-1)),(async()=>{try{let te=U();return te instanceof Promise?await te:te}finally{console.groupEnd()}})())}let g=Object.assign(c.bind({}),{isEnabled:f,isDisabled:!f,group:y,force:c});return f?g:Object.assign(n.bind({}),{isEnabled:f,isDisabled:!f,group:y,force:g})},o=s(e>=et.ERROR,this.wrapLog(console.error,t));return{ERROR:(...f)=>(o(...f),new Error((0,ag.default)(f))),WARN:s(e>=et.WARN,this.wrapLog(console.warn,t)),LOG:s(e>=et.INFO,this.wrapLog(console.log,t)),DEBUG:s(e>=et.DEBUG,this.wrapLog(console.log,{...t,dim:t.dimDebugOnServer})),VERBOSE:s(e>=et.VERBOSE,this.wrapLog(console.debug,{...t,dim:t.dimDebugOnServer}))}}static wrapLog(e,t){if(Yn.isNode)return e.bind(console);{let r=[];if(t.time||t.delta){let i=Yn.isBrowser&&navigator.userAgent.includes("Chrome")?["",et.timeStr(!!t.time,!!t.delta)]:[];r.push(...i)}return t.prefix&&(Wn?r.push(new gf("dim",t.prefix)):r.push(t.prefix)),e.bind(console,...r)}}static timeStr(e,t,r=0){if(!performance.now)return;let n=performance.now();et.firstLog||(et.firstLog=n,et.lastLog=n);let i=new mf(n-et.firstLog,n-et.lastLog,e,t);return et.lastLog=n,r?i.toString():i}static getOriginFromStack(e){let t=!1;for(let r of e.split(`
2
+ `)){let n=r.match(/^\s+at\s+(.*)/);if(n){if(t)return n[1].trim().replace(__dirname,"");t=!0}}}},Se=et;mr(Se,"ERROR",2);mr(Se,"WARN",4);mr(Se,"INFO",6);mr(Se,"LOG",6);mr(Se,"DEBUG",8);mr(Se,"VERBOSE",10);mr(Se,"firstLog",0);mr(Se,"lastLog",0);Yn.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Rs&&Rs.length){for(let t of Rs)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof mf))return null;Wn||(Wn=!0);let t=Se.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof gf?(Wn||(Wn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1})):Yn.isNode;var cg=co({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),VE=co({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),bf=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),fg=af({name:"sha2-256",code:18,encode:bf("SHA-256")}),KE=af({name:"sha2-512",code:19,encode:bf("SHA-512")}),{WARN:lg,LOG:zE,DEBUG:dg,VERBOSE:oo,ERROR:qE}=Se.setup(Se.INFO),vf=114;function _f(e,t=["cid"]){let r={};for(let[n,i]of Object.entries(e))i===void 0&&(lg(`log.${n} is undefined, which is not allowed - encoding as null`,e),i=null),t.includes(n)?oo("excluding app log",{key:n,val:i}):r[n]=i&&n==="pv"?Ut.parse(i):i;return r}function ta(e){return ra(wf(e).bytes)}function wf(e){return Tf(_f(e))}function ra(e){let t=Qm(e),r=nf.create(fg.code,t),n=Ut.create(1,cf,r);return oo("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function Tf(e){dg("[encodeBlock]",e);let t=Zs(e);return{bytes:t,cid:ra(t)}}function na(e){let t=null,r=[];try{t=Ut.parse(e)}catch(n){oo("[retrieveThread] couldn't parse pubID with default base"),r.push(n)}if(!t)try{t=Ut.parse(e,cg)}catch(n){oo("[retrieveThread] couldn't parse pubID with base36"),r.push(n)}return{cid:t,errors:r,isIpns:t&&t.code===vf}}var Yt=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(l){let w=new Map;function I(){return new Map(w)}l.Entries=I;function P(){return w.clear()}l.Clear=P;function N(_){return w.delete(_)}l.Delete=N;function E(_){return w.has(_)}l.Has=E;function h(_,u){w.set(_,u)}l.Set=h;function S(_){return w.get(_)}l.Get=S})(t||(e.TypeRegistry=t={}));var r=class extends Error{constructor(l){super(l)}};e.TypeBoxError=r;var n;(function(l){let w=new Map;function I(){return new Map(w)}l.Entries=I;function P(){return w.clear()}l.Clear=P;function N(_){return w.delete(_)}l.Delete=N;function E(_){return w.has(_)}l.Has=E;function h(_,u){w.set(_,u)}l.Set=h;function S(_){return w.get(_)}l.Get=S})(n||(e.FormatRegistry=n={}));var i;(function(l){function w(v){return Array.isArray(v)}l.IsArray=w;function I(v){return typeof v=="bigint"}l.IsBigInt=I;function P(v){return typeof v=="boolean"}l.IsBoolean=P;function N(v){return v instanceof globalThis.Date}l.IsDate=N;function E(v){return v===null}l.IsNull=E;function h(v){return typeof v=="number"}l.IsNumber=h;function S(v){return typeof v=="object"&&v!==null}l.IsObject=S;function _(v){return typeof v=="string"}l.IsString=_;function u(v){return v instanceof globalThis.Uint8Array}l.IsUint8Array=u;function A(v){return v===void 0}l.IsUndefined=A})(i||(e.ValueGuard=i={}));var s=class extends r{};e.TypeGuardUnknownTypeError=s;var o;(function(l){function w(m){try{return new RegExp(m),!0}catch{return!1}}function I(m){if(!i.IsString(m))return!1;for(let $e=0;$e<m.length;$e++){let yt=m.charCodeAt($e);if(yt>=7&&yt<=13||yt===27||yt===127)return!1}return!0}function P(m){return h(m)||Ve(m)}function N(m){return i.IsUndefined(m)||i.IsBigInt(m)}function E(m){return i.IsUndefined(m)||i.IsNumber(m)}function h(m){return i.IsUndefined(m)||i.IsBoolean(m)}function S(m){return i.IsUndefined(m)||i.IsString(m)}function _(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)&&w(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)}function A(m){return i.IsUndefined(m)||Ve(m)}function v(m){return we(m,"Any")&&S(m.$id)}l.TAny=v;function b(m){return we(m,"Array")&&m.type==="array"&&S(m.$id)&&Ve(m.items)&&E(m.minItems)&&E(m.maxItems)&&h(m.uniqueItems)&&A(m.contains)&&E(m.minContains)&&E(m.maxContains)}l.TArray=b;function $(m){return we(m,"AsyncIterator")&&m.type==="AsyncIterator"&&S(m.$id)&&Ve(m.items)}l.TAsyncIterator=$;function V(m){return we(m,"BigInt")&&m.type==="bigint"&&S(m.$id)&&N(m.exclusiveMaximum)&&N(m.exclusiveMinimum)&&N(m.maximum)&&N(m.minimum)&&N(m.multipleOf)}l.TBigInt=V;function X(m){return we(m,"Boolean")&&m.type==="boolean"&&S(m.$id)}l.TBoolean=X;function re(m){return we(m,"Constructor")&&m.type==="Constructor"&&S(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every($e=>Ve($e))&&Ve(m.returns)}l.TConstructor=re;function me(m){return we(m,"Date")&&m.type==="Date"&&S(m.$id)&&E(m.exclusiveMaximumTimestamp)&&E(m.exclusiveMinimumTimestamp)&&E(m.maximumTimestamp)&&E(m.minimumTimestamp)&&E(m.multipleOfTimestamp)}l.TDate=me;function _e(m){return we(m,"Function")&&m.type==="Function"&&S(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every($e=>Ve($e))&&Ve(m.returns)}l.TFunction=_e;function Pe(m){return we(m,"Integer")&&m.type==="integer"&&S(m.$id)&&E(m.exclusiveMaximum)&&E(m.exclusiveMinimum)&&E(m.maximum)&&E(m.minimum)&&E(m.multipleOf)}l.TInteger=Pe;function je(m){return we(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every($e=>Ve($e)&&!kn($e))&&S(m.type)&&(h(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&S(m.$id)}l.TIntersect=je;function Er(m){return we(m,"Iterator")&&m.type==="Iterator"&&S(m.$id)&&Ve(m.items)}l.TIterator=Er;function we(m,$e){return ir(m)&&m[e.Kind]===$e}l.TKindOf=we;function ir(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}l.TKind=ir;function Sr(m){return x(m)&&i.IsString(m.const)}l.TLiteralString=Sr;function T(m){return x(m)&&i.IsNumber(m.const)}l.TLiteralNumber=T;function le(m){return x(m)&&i.IsBoolean(m.const)}l.TLiteralBoolean=le;function x(m){return we(m,"Literal")&&S(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}l.TLiteral=x;function ge(m){return we(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}l.TNever=ge;function oe(m){return we(m,"Not")&&Ve(m.not)}l.TNot=oe;function pe(m){return we(m,"Null")&&m.type==="null"&&S(m.$id)}l.TNull=pe;function Ee(m){return we(m,"Number")&&m.type==="number"&&S(m.$id)&&E(m.exclusiveMaximum)&&E(m.exclusiveMinimum)&&E(m.maximum)&&E(m.minimum)&&E(m.multipleOf)}l.TNumber=Ee;function Me(m){return we(m,"Object")&&m.type==="object"&&S(m.$id)&&i.IsObject(m.properties)&&P(m.additionalProperties)&&E(m.minProperties)&&E(m.maxProperties)&&Object.entries(m.properties).every(([$e,yt])=>I($e)&&Ve(yt))}l.TObject=Me;function Xe(m){return we(m,"Promise")&&m.type==="Promise"&&S(m.$id)&&Ve(m.item)}l.TPromise=Xe;function We(m){return we(m,"Record")&&m.type==="object"&&S(m.$id)&&P(m.additionalProperties)&&i.IsObject(m.patternProperties)&&($e=>{let yt=Object.getOwnPropertyNames($e.patternProperties);return yt.length===1&&w(yt[0])&&i.IsObject($e.patternProperties)&&Ve($e.patternProperties[yt[0]])})(m)}l.TRecord=We;function Ze(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}l.TRecursive=Ze;function Jt(m){return we(m,"Ref")&&S(m.$id)&&i.IsString(m.$ref)}l.TRef=Jt;function rn(m){return we(m,"String")&&m.type==="string"&&S(m.$id)&&E(m.minLength)&&E(m.maxLength)&&_(m.pattern)&&u(m.format)}l.TString=rn;function nn(m){return we(m,"Symbol")&&m.type==="symbol"&&S(m.$id)}l.TSymbol=nn;function xr(m){return we(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}l.TTemplateLiteral=xr;function Ci(m){return we(m,"This")&&S(m.$id)&&i.IsString(m.$ref)}l.TThis=Ci;function kn(m){return i.IsObject(m)&&e.Transform in m}l.TTransform=kn;function Fe(m){return we(m,"Tuple")&&m.type==="array"&&S(m.$id)&&i.IsNumber(m.minItems)&&i.IsNumber(m.maxItems)&&m.minItems===m.maxItems&&(i.IsUndefined(m.items)&&i.IsUndefined(m.additionalItems)&&m.minItems===0||i.IsArray(m.items)&&m.items.every($e=>Ve($e)))}l.TTuple=Fe;function Pi(m){return we(m,"Undefined")&&m.type==="undefined"&&S(m.$id)}l.TUndefined=Pi;function ss(m){return Nr(m)&&m.anyOf.every($e=>Sr($e)||T($e))}l.TUnionLiteral=ss;function Nr(m){return we(m,"Union")&&S(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every($e=>Ve($e))}l.TUnion=Nr;function on(m){return we(m,"Uint8Array")&&m.type==="Uint8Array"&&S(m.$id)&&E(m.minByteLength)&&E(m.maxByteLength)}l.TUint8Array=on;function Ye(m){return we(m,"Unknown")&&S(m.$id)}l.TUnknown=Ye;function Ui(m){return we(m,"Unsafe")}l.TUnsafe=Ui;function Mn(m){return we(m,"Void")&&m.type==="void"&&S(m.$id)}l.TVoid=Mn;function as(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}l.TReadonly=as;function us(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}l.TOptional=us;function Ve(m){return i.IsObject(m)&&(v(m)||b(m)||X(m)||V(m)||$(m)||re(m)||me(m)||_e(m)||Pe(m)||je(m)||Er(m)||x(m)||ge(m)||oe(m)||pe(m)||Ee(m)||Me(m)||Xe(m)||We(m)||Jt(m)||rn(m)||nn(m)||xr(m)||Ci(m)||Fe(m)||Pi(m)||Nr(m)||on(m)||Ye(m)||Ui(m)||Mn(m)||ir(m)&&t.Has(m[e.Kind]))}l.TSchema=Ve})(o||(e.TypeGuard=o={}));var a;(function(l){function w(I){return I[e.Kind]==="Intersect"?I.allOf.every(P=>w(P)):I[e.Kind]==="Union"?I.anyOf.some(P=>w(P)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!w(I.not):!1}l.Check=w})(a||(e.ExtendsUndefined=a={}));var f=class extends r{};e.TypeExtendsError=f;var c;(function(l){l[l.Union=0]="Union",l[l.True=1]="True",l[l.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var y;(function(l){function w(d){return d===c.False?d:c.True}function I(d){throw new f(d)}function P(d){return o.TNever(d)||o.TIntersect(d)||o.TUnion(d)||o.TUnknown(d)||o.TAny(d)}function N(d,p){return o.TNever(p)?we(d,p):o.TIntersect(p)?_e(d,p):o.TUnion(p)?cs(d,p):o.TUnknown(p)?lu(d,p):o.TAny(p)?E(d,p):I("StructuralRight")}function E(d,p){return c.True}function h(d,p){return o.TIntersect(p)?_e(d,p):o.TUnion(p)&&p.anyOf.some(Te=>o.TAny(Te)||o.TUnknown(Te))?c.True:o.TUnion(p)?c.Union:o.TUnknown(p)||o.TAny(p)?c.True:c.Union}function S(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)?c.True:c.False}function _(d,p){return o.TObject(p)&&xr(p)?c.True:P(p)?N(d,p):o.TArray(p)?w(Ne(d.items,p.items)):c.False}function u(d,p){return P(p)?N(d,p):o.TAsyncIterator(p)?w(Ne(d.items,p.items)):c.False}function A(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TBigInt(p)?c.True:c.False}function v(d,p){return o.TLiteral(d)&&i.IsBoolean(d.const)||o.TBoolean(d)?c.True:c.False}function b(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TBoolean(p)?c.True:c.False}function $(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TConstructor(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((Te,St)=>w(Ne(p.parameters[St],Te))===c.True)?w(Ne(d.returns,p.returns)):c.False:c.False}function V(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TDate(p)?c.True:c.False}function X(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TFunction(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((Te,St)=>w(Ne(p.parameters[St],Te))===c.True)?w(Ne(d.returns,p.returns)):c.False:c.False}function re(d,p){return o.TLiteral(d)&&i.IsNumber(d.const)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function me(d,p){return o.TInteger(p)||o.TNumber(p)?c.True:P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):c.False}function _e(d,p){return p.allOf.every(Te=>Ne(d,Te)===c.True)?c.True:c.False}function Pe(d,p){return d.allOf.some(Te=>Ne(Te,p)===c.True)?c.True:c.False}function je(d,p){return P(p)?N(d,p):o.TIterator(p)?w(Ne(d.items,p.items)):c.False}function Er(d,p){return o.TLiteral(p)&&p.const===d.const?c.True:P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TString(p)?Mn(d,p):o.TNumber(p)?x(d,p):o.TInteger(p)?re(d,p):o.TBoolean(p)?v(d,p):c.False}function we(d,p){return c.False}function ir(d,p){return c.True}function Sr(d){let[p,Te]=[d,0];for(;o.TNot(p);)p=p.not,Te+=1;return Te%2===0?p:e.Type.Unknown()}function T(d,p){return o.TNot(d)?Ne(Sr(d),p):o.TNot(p)?Ne(d,Sr(p)):I("Invalid fallthrough for Not")}function le(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TNull(p)?c.True:c.False}function x(d,p){return o.TLiteralNumber(d)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function ge(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TInteger(p)||o.TNumber(p)?c.True:c.False}function oe(d,p){return Object.getOwnPropertyNames(d.properties).length===p}function pe(d){return xr(d)}function Ee(d){return oe(d,0)||oe(d,1)&&"description"in d.properties&&o.TUnion(d.properties.description)&&d.properties.description.anyOf.length===2&&(o.TString(d.properties.description.anyOf[0])&&o.TUndefined(d.properties.description.anyOf[1])||o.TString(d.properties.description.anyOf[1])&&o.TUndefined(d.properties.description.anyOf[0]))}function Me(d){return oe(d,0)}function Xe(d){return oe(d,0)}function We(d){return oe(d,0)}function Ze(d){return oe(d,0)}function Jt(d){return xr(d)}function rn(d){let p=e.Type.Number();return oe(d,0)||oe(d,1)&&"length"in d.properties&&w(Ne(d.properties.length,p))===c.True}function nn(d){return oe(d,0)}function xr(d){let p=e.Type.Number();return oe(d,0)||oe(d,1)&&"length"in d.properties&&w(Ne(d.properties.length,p))===c.True}function Ci(d){let p=e.Type.Function([e.Type.Any()],e.Type.Any());return oe(d,0)||oe(d,1)&&"then"in d.properties&&w(Ne(d.properties.then,p))===c.True}function kn(d,p){return Ne(d,p)===c.False||o.TOptional(d)&&!o.TOptional(p)?c.False:c.True}function Fe(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)||o.TLiteralString(d)&&pe(p)||o.TLiteralNumber(d)&&Me(p)||o.TLiteralBoolean(d)&&Xe(p)||o.TSymbol(d)&&Ee(p)||o.TBigInt(d)&&We(p)||o.TString(d)&&pe(p)||o.TSymbol(d)&&Ee(p)||o.TNumber(d)&&Me(p)||o.TInteger(d)&&Me(p)||o.TBoolean(d)&&Xe(p)||o.TUint8Array(d)&&Jt(p)||o.TDate(d)&&Ze(p)||o.TConstructor(d)&&nn(p)||o.TFunction(d)&&rn(p)?c.True:o.TRecord(d)&&o.TString(Nr(d))?p[e.Hint]==="Record"?c.True:c.False:o.TRecord(d)&&o.TNumber(Nr(d))?oe(p,0)?c.True:c.False:c.False}function Pi(d,p){return P(p)?N(d,p):o.TRecord(p)?Ye(d,p):o.TObject(p)?(()=>{for(let Te of Object.getOwnPropertyNames(p.properties)){if(!(Te in d.properties)&&!o.TOptional(p.properties[Te]))return c.False;if(o.TOptional(p.properties[Te]))return c.True;if(kn(d.properties[Te],p.properties[Te])===c.False)return c.False}return c.True})():c.False}function ss(d,p){return P(p)?N(d,p):o.TObject(p)&&Ci(p)?c.True:o.TPromise(p)?w(Ne(d.item,p.item)):c.False}function Nr(d){return e.PatternNumberExact in d.patternProperties?e.Type.Number():e.PatternStringExact in d.patternProperties?e.Type.String():I("Unknown record key pattern")}function on(d){return e.PatternNumberExact in d.patternProperties?d.patternProperties[e.PatternNumberExact]:e.PatternStringExact in d.patternProperties?d.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function Ye(d,p){let[Te,St]=[Nr(p),on(p)];return o.TLiteralString(d)&&o.TNumber(Te)&&w(Ne(d,St))===c.True?c.True:o.TUint8Array(d)&&o.TNumber(Te)||o.TString(d)&&o.TNumber(Te)||o.TArray(d)&&o.TNumber(Te)?Ne(d,St):o.TObject(d)?(()=>{for(let Op of Object.getOwnPropertyNames(d.properties))if(kn(St,d.properties[Op])===c.False)return c.False;return c.True})():c.False}function Ui(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ne(on(d),on(p)):c.False}function Mn(d,p){return o.TLiteral(d)&&i.IsString(d.const)||o.TString(d)?c.True:c.False}function as(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TString(p)?c.True:c.False}function us(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TSymbol(p)?c.True:c.False}function Ve(d,p){return o.TTemplateLiteral(d)?Ne(F.Resolve(d),p):o.TTemplateLiteral(p)?Ne(d,F.Resolve(p)):I("Invalid fallthrough for TemplateLiteral")}function m(d,p){return o.TArray(p)&&d.items!==void 0&&d.items.every(Te=>Ne(Te,p.items)===c.True)}function $e(d,p){return o.TNever(d)?c.True:o.TUnknown(d)?c.False:o.TAny(d)?c.Union:c.False}function yt(d,p){return P(p)?N(d,p):o.TObject(p)&&xr(p)||o.TArray(p)&&m(d,p)?c.True:o.TTuple(p)?i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||!i.IsUndefined(d.items)&&i.IsUndefined(p.items)?c.False:i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||d.items.every((Te,St)=>Ne(Te,p.items[St])===c.True)?c.True:c.False:c.False}function mp(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TUint8Array(p)?c.True:c.False}function gp(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TVoid(p)?_p(d,p):o.TUndefined(p)?c.True:c.False}function cs(d,p){return p.anyOf.some(Te=>Ne(d,Te)===c.True)?c.True:c.False}function bp(d,p){return d.anyOf.every(Te=>Ne(Te,p)===c.True)?c.True:c.False}function lu(d,p){return c.True}function vp(d,p){return o.TNever(p)?we(d,p):o.TIntersect(p)?_e(d,p):o.TUnion(p)?cs(d,p):o.TAny(p)?E(d,p):o.TString(p)?Mn(d,p):o.TNumber(p)?x(d,p):o.TInteger(p)?re(d,p):o.TBoolean(p)?v(d,p):o.TArray(p)?S(d,p):o.TTuple(p)?$e(d,p):o.TObject(p)?Fe(d,p):o.TUnknown(p)?c.True:c.False}function _p(d,p){return o.TUndefined(d)||o.TUndefined(d)?c.True:c.False}function wp(d,p){return o.TIntersect(p)?_e(d,p):o.TUnion(p)?cs(d,p):o.TUnknown(p)?lu(d,p):o.TAny(p)?E(d,p):o.TObject(p)?Fe(d,p):o.TVoid(p)?c.True:c.False}function Ne(d,p){return o.TTemplateLiteral(d)||o.TTemplateLiteral(p)?Ve(d,p):o.TNot(d)||o.TNot(p)?T(d,p):o.TAny(d)?h(d,p):o.TArray(d)?_(d,p):o.TBigInt(d)?A(d,p):o.TBoolean(d)?b(d,p):o.TAsyncIterator(d)?u(d,p):o.TConstructor(d)?$(d,p):o.TDate(d)?V(d,p):o.TFunction(d)?X(d,p):o.TInteger(d)?me(d,p):o.TIntersect(d)?Pe(d,p):o.TIterator(d)?je(d,p):o.TLiteral(d)?Er(d,p):o.TNever(d)?ir(d,p):o.TNull(d)?le(d,p):o.TNumber(d)?ge(d,p):o.TObject(d)?Pi(d,p):o.TRecord(d)?Ui(d,p):o.TString(d)?as(d,p):o.TSymbol(d)?us(d,p):o.TTuple(d)?yt(d,p):o.TPromise(d)?ss(d,p):o.TUint8Array(d)?mp(d,p):o.TUndefined(d)?gp(d,p):o.TUnion(d)?bp(d,p):o.TUnknown(d)?vp(d,p):o.TVoid(d)?wp(d,p):I(`Unknown left type operand '${d[e.Kind]}'`)}function Tp(d,p){return Ne(d,p)}l.Extends=Tp})(y||(e.TypeExtends=y={}));var g;(function(l){function w(_){return _.map(u=>E(u))}function I(_){return new Date(_.getTime())}function P(_){return new Uint8Array(_)}function N(_){let u=Object.getOwnPropertyNames(_).reduce((v,b)=>({...v,[b]:E(_[b])}),{}),A=Object.getOwnPropertySymbols(_).reduce((v,b)=>({...v,[b]:E(_[b])}),{});return{...u,...A}}function E(_){return i.IsArray(_)?w(_):i.IsDate(_)?I(_):i.IsUint8Array(_)?P(_):i.IsObject(_)?N(_):_}function h(_){return _.map(u=>S(u))}l.Rest=h;function S(_,u={}){return{...E(_),...u}}l.Type=S})(g||(e.TypeClone=g={}));var k;(function(l){function w($){return $.map(V=>{let{[e.Optional]:X,...re}=g.Type(V);return re})}function I($){return $.every(V=>o.TOptional(V))}function P($){return $.some(V=>o.TOptional(V))}function N($){return I($.allOf)?e.Type.Optional(e.Type.Intersect(w($.allOf))):$}function E($){return P($.anyOf)?e.Type.Optional(e.Type.Union(w($.anyOf))):$}function h($){return $[e.Kind]==="Intersect"?N($):$[e.Kind]==="Union"?E($):$}function S($,V){let X=$.allOf.reduce((re,me)=>{let _e=v(me,V);return _e[e.Kind]==="Never"?re:[...re,_e]},[]);return h(e.Type.Intersect(X))}function _($,V){let X=$.anyOf.map(re=>v(re,V));return h(e.Type.Union(X))}function u($,V){let X=$.properties[V];return i.IsUndefined(X)?e.Type.Never():e.Type.Union([X])}function A($,V){let X=$.items;if(i.IsUndefined(X))return e.Type.Never();let re=X[V];return i.IsUndefined(re)?e.Type.Never():re}function v($,V){return $[e.Kind]==="Intersect"?S($,V):$[e.Kind]==="Union"?_($,V):$[e.Kind]==="Object"?u($,V):$[e.Kind]==="Tuple"?A($,V):e.Type.Never()}function b($,V,X={}){let re=V.map(me=>v($,me.toString()));return h(e.Type.Union(re,X))}l.Resolve=b})(k||(e.IndexedAccessor=k={}));var U;(function(l){function w(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toLowerCase()}${b}`}function I(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toUpperCase()}${b}`}function P(A){return A.toUpperCase()}function N(A){return A.toLowerCase()}function E(A,v){let b=K.ParseExact(A.pattern);if(!D.Check(b))return{...A,pattern:h(A.pattern,v)};let X=[...M.Generate(b)].map(_e=>e.Type.Literal(_e)),re=S(X,v),me=e.Type.Union(re);return e.Type.TemplateLiteral([me])}function h(A,v){return typeof A=="string"?v==="Uncapitalize"?w(A):v==="Capitalize"?I(A):v==="Uppercase"?P(A):v==="Lowercase"?N(A):A:A.toString()}function S(A,v){if(A.length===0)return[];let[b,...$]=A;return[u(b,v),...S($,v)]}function _(A,v){return o.TTemplateLiteral(A)?E(A,v):o.TUnion(A)?e.Type.Union(S(A.anyOf,v)):o.TLiteral(A)?e.Type.Literal(h(A.const,v)):A}function u(A,v){return _(A,v)}l.Map=u})(U||(e.Intrinsic=U={}));var j;(function(l){function w(h,S){return e.Type.Intersect(h.allOf.map(_=>N(_,S)),{...h})}function I(h,S){return e.Type.Union(h.anyOf.map(_=>N(_,S)),{...h})}function P(h,S){return S(h)}function N(h,S){return h[e.Kind]==="Intersect"?w(h,S):h[e.Kind]==="Union"?I(h,S):h[e.Kind]==="Object"?P(h,S):h}function E(h,S,_){return{...N(g.Type(h),S),..._}}l.Map=E})(j||(e.ObjectMap=j={}));var te;(function(l){function w(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function I(u,A){return u.allOf.reduce((v,b)=>[...v,...h(b,A)],[])}function P(u,A){let v=u.anyOf.map(b=>h(b,A));return[...v.reduce((b,$)=>$.map(V=>v.every(X=>X.includes(V))?b.add(V):b)[0],new Set)]}function N(u,A){return Object.getOwnPropertyNames(u.properties)}function E(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function h(u,A){return o.TIntersect(u)?I(u,A):o.TUnion(u)?P(u,A):o.TObject(u)?N(u,A):o.TRecord(u)?E(u,A):[]}function S(u,A){return[...new Set(h(u,A))]}l.ResolveKeys=S;function _(u){return`^(${S(u,{includePatterns:!0}).map(b=>`(${w(b)})`).join("|")})$`}l.ResolvePattern=_})(te||(e.KeyResolver=te={}));var W=class extends r{};e.KeyArrayResolverError=W;var B;(function(l){function w(I){return Array.isArray(I)?I:o.TUnionLiteral(I)?I.anyOf.map(P=>P.const.toString()):o.TLiteral(I)?[I.const]:o.TTemplateLiteral(I)?(()=>{let P=K.ParseExact(I.pattern);if(!D.Check(P))throw new W("Cannot resolve keys from infinite template expression");return[...M.Generate(P)]})():[]}l.Resolve=w})(B||(e.KeyArrayResolver=B={}));var z;(function(l){function*w(P){for(let N of P.anyOf)N[e.Kind]==="Union"?yield*w(N):yield N}function I(P){return e.Type.Union([...w(P)],{...P})}l.Resolve=I})(z||(e.UnionResolver=z={}));var Y=class extends r{};e.TemplateLiteralPatternError=Y;var ie;(function(l){function w(E){throw new Y(E)}function I(E){return E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P(E,h){return o.TTemplateLiteral(E)?E.pattern.slice(1,E.pattern.length-1):o.TUnion(E)?`(${E.anyOf.map(S=>P(S,h)).join("|")})`:o.TNumber(E)?`${h}${e.PatternNumber}`:o.TInteger(E)?`${h}${e.PatternNumber}`:o.TBigInt(E)?`${h}${e.PatternNumber}`:o.TString(E)?`${h}${e.PatternString}`:o.TLiteral(E)?`${h}${I(E.const.toString())}`:o.TBoolean(E)?`${h}${e.PatternBoolean}`:w(`Unexpected Kind '${E[e.Kind]}'`)}function N(E){return`^${E.map(h=>P(h,"")).join("")}$`}l.Create=N})(ie||(e.TemplateLiteralPattern=ie={}));var F;(function(l){function w(I){let P=K.ParseExact(I.pattern);if(!D.Check(P))return e.Type.String();let N=[...M.Generate(P)].map(E=>e.Type.Literal(E));return e.Type.Union(N)}l.Resolve=w})(F||(e.TemplateLiteralResolver=F={}));var se=class extends r{};e.TemplateLiteralParserError=se;var K;(function(l){function w($,V,X){return $[V]===X&&$.charCodeAt(V-1)!==92}function I($,V){return w($,V,"(")}function P($,V){return w($,V,")")}function N($,V){return w($,V,"|")}function E($){if(!(I($,0)&&P($,$.length-1)))return!1;let V=0;for(let X=0;X<$.length;X++)if(I($,X)&&(V+=1),P($,X)&&(V-=1),V===0&&X!==$.length-1)return!1;return!0}function h($){return $.slice(1,$.length-1)}function S($){let V=0;for(let X=0;X<$.length;X++)if(I($,X)&&(V+=1),P($,X)&&(V-=1),N($,X)&&V===0)return!0;return!1}function _($){for(let V=0;V<$.length;V++)if(I($,V))return!0;return!1}function u($){let[V,X]=[0,0],re=[];for(let _e=0;_e<$.length;_e++)if(I($,_e)&&(V+=1),P($,_e)&&(V-=1),N($,_e)&&V===0){let Pe=$.slice(X,_e);Pe.length>0&&re.push(v(Pe)),X=_e+1}let me=$.slice(X);return me.length>0&&re.push(v(me)),re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"or",expr:re}}function A($){function V(me,_e){if(!I(me,_e))throw new se("TemplateLiteralParser: Index must point to open parens");let Pe=0;for(let je=_e;je<me.length;je++)if(I(me,je)&&(Pe+=1),P(me,je)&&(Pe-=1),Pe===0)return[_e,je];throw new se("TemplateLiteralParser: Unclosed group parens in expression")}function X(me,_e){for(let Pe=_e;Pe<me.length;Pe++)if(I(me,Pe))return[_e,Pe];return[_e,me.length]}let re=[];for(let me=0;me<$.length;me++)if(I($,me)){let[_e,Pe]=V($,me),je=$.slice(_e,Pe+1);re.push(v(je)),me=Pe}else{let[_e,Pe]=X($,me),je=$.slice(_e,Pe);je.length>0&&re.push(v(je)),me=Pe-1}return re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"and",expr:re}}function v($){return E($)?v(h($)):S($)?u($):_($)?A($):{type:"const",const:$}}l.Parse=v;function b($){return v($.slice(1,$.length-1))}l.ParseExact=b})(K||(e.TemplateLiteralParser=K={}));var ye=class extends r{};e.TemplateLiteralFiniteError=ye;var D;(function(l){function w(h){throw new ye(h)}function I(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="0"&&h.expr[1].type==="const"&&h.expr[1].const==="[1-9][0-9]*"}function P(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="true"&&h.expr[1].type==="const"&&h.expr[1].const==="false"}function N(h){return h.type==="const"&&h.const===".*"}function E(h){return P(h)?!0:I(h)||N(h)?!1:h.type==="and"?h.expr.every(S=>E(S)):h.type==="or"?h.expr.every(S=>E(S)):h.type==="const"?!0:w("Unknown expression type")}l.Check=E})(D||(e.TemplateLiteralFinite=D={}));var R=class extends r{};e.TemplateLiteralGeneratorError=R;var M;(function(l){function*w(h){if(h.length===1)return yield*h[0];for(let S of h[0])for(let _ of w(h.slice(1)))yield`${S}${_}`}function*I(h){return yield*w(h.expr.map(S=>[...E(S)]))}function*P(h){for(let S of h.expr)yield*E(S)}function*N(h){return yield h.const}function*E(h){return h.type==="and"?yield*I(h):h.type==="or"?yield*P(h):h.type==="const"?yield*N(h):(()=>{throw new R("Unknown expression")})()}l.Generate=E})(M||(e.TemplateLiteralGenerator=M={}));var ee;(function(l){function*w(E){let h=E.trim().replace(/"|'/g,"");return h==="boolean"?yield e.Type.Boolean():h==="number"?yield e.Type.Number():h==="bigint"?yield e.Type.BigInt():h==="string"?yield e.Type.String():yield(()=>{let S=h.split("|").map(_=>e.Type.Literal(_.trim()));return S.length===0?e.Type.Never():S.length===1?S[0]:e.Type.Union(S)})()}function*I(E){if(E[1]!=="{"){let h=e.Type.Literal("$"),S=P(E.slice(1));return yield*[h,...S]}for(let h=2;h<E.length;h++)if(E[h]==="}"){let S=w(E.slice(2,h)),_=P(E.slice(h+1));return yield*[...S,..._]}yield e.Type.Literal(E)}function*P(E){for(let h=0;h<E.length;h++)if(E[h]==="$"){let S=e.Type.Literal(E.slice(0,h)),_=I(E.slice(h));return yield*[S,..._]}yield e.Type.Literal(E)}function N(E){return[...P(E)]}l.Parse=N})(ee||(e.TemplateLiteralDslParser=ee={}));var Q=class{constructor(l){this.schema=l}Decode(l){return new O(this.schema,l)}};e.TransformDecodeBuilder=Q;var O=class{constructor(l,w){this.schema=l,this.decode=w}Encode(l){let w=g.Type(this.schema);return o.TTransform(w)?(()=>{let N={Encode:E=>w[e.Transform].Encode(l(E)),Decode:E=>this.decode(w[e.Transform].Decode(E))};return{...w,[e.Transform]:N}})():(()=>{let I={Decode:this.decode,Encode:l};return{...w,[e.Transform]:I}})()}};e.TransformEncodeBuilder=O;var q=0,ne=class extends r{};e.TypeBuilderError=ne;var G=class{Create(l){return l}Throw(l){throw new ne(l)}Discard(l,w){return w.reduce((I,P)=>{let{[P]:N,...E}=I;return E},l)}Strict(l){return JSON.parse(JSON.stringify(l))}};e.TypeBuilder=G;var J=class extends G{ReadonlyOptional(l){return this.Readonly(this.Optional(l))}Readonly(l){return{...g.Type(l),[e.Readonly]:"Readonly"}}Optional(l){return{...g.Type(l),[e.Optional]:"Optional"}}Any(l={}){return this.Create({...l,[e.Kind]:"Any"})}Array(l,w={}){return this.Create({...w,[e.Kind]:"Array",type:"array",items:g.Type(l)})}Boolean(l={}){return this.Create({...l,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(l,w={}){return{...U.Map(g.Type(l),"Capitalize"),...w}}Composite(l,w){let I=e.Type.Intersect(l,{}),N=te.ResolveKeys(I,{includePatterns:!1}).reduce((E,h)=>({...E,[h]:e.Type.Index(I,[h])}),{});return e.Type.Object(N,w)}Enum(l,w={}){if(i.IsUndefined(l))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(l).filter(E=>isNaN(E)).map(E=>l[E]),N=[...new Set(I)].map(E=>e.Type.Literal(E));return this.Union(N,{...w,[e.Hint]:"Enum"})}Extends(l,w,I,P,N={}){switch(y.Extends(l,w)){case c.Union:return this.Union([g.Type(I,N),g.Type(P,N)]);case c.True:return g.Type(I,N);case c.False:return g.Type(P,N)}}Exclude(l,w,I={}){return o.TTemplateLiteral(l)?this.Exclude(F.Resolve(l),w,I):o.TTemplateLiteral(w)?this.Exclude(l,F.Resolve(w),I):o.TUnion(l)?(()=>{let P=l.anyOf.filter(N=>y.Extends(N,w)===c.False);return P.length===1?g.Type(P[0],I):this.Union(P,I)})():y.Extends(l,w)!==c.False?this.Never(I):g.Type(l,I)}Extract(l,w,I={}){return o.TTemplateLiteral(l)?this.Extract(F.Resolve(l),w,I):o.TTemplateLiteral(w)?this.Extract(l,F.Resolve(w),I):o.TUnion(l)?(()=>{let P=l.anyOf.filter(N=>y.Extends(N,w)!==c.False);return P.length===1?g.Type(P[0],I):this.Union(P,I)})():y.Extends(l,w)!==c.False?g.Type(l,I):this.Never(I)}Index(l,w,I={}){return o.TArray(l)&&o.TNumber(w)?g.Type(l.items,I):o.TTuple(l)&&o.TNumber(w)?(()=>{let N=(i.IsUndefined(l.items)?[]:l.items).map(E=>g.Type(E));return this.Union(N,I)})():(()=>{let P=B.Resolve(w),N=g.Type(l);return k.Resolve(N,P,I)})()}Integer(l={}){return this.Create({...l,[e.Kind]:"Integer",type:"integer"})}Intersect(l,w={}){if(l.length===0)return e.Type.Never();if(l.length===1)return g.Type(l[0],w);l.some(E=>o.TTransform(E))&&this.Throw("Cannot intersect transform types");let I=l.every(E=>o.TObject(E)),P=g.Rest(l),N=o.TSchema(w.unevaluatedProperties)?{unevaluatedProperties:g.Type(w.unevaluatedProperties)}:{};return w.unevaluatedProperties===!1||o.TSchema(w.unevaluatedProperties)||I?this.Create({...w,...N,[e.Kind]:"Intersect",type:"object",allOf:P}):this.Create({...w,...N,[e.Kind]:"Intersect",allOf:P})}KeyOf(l,w={}){return o.TRecord(l)?(()=>{let I=Object.getOwnPropertyNames(l.patternProperties)[0];return I===e.PatternNumberExact?this.Number(w):I===e.PatternStringExact?this.String(w):this.Throw("Unable to resolve key type from Record key pattern")})():o.TTuple(l)?(()=>{let P=(i.IsUndefined(l.items)?[]:l.items).map((N,E)=>e.Type.Literal(E.toString()));return this.Union(P,w)})():o.TArray(l)?this.Number(w):(()=>{let I=te.ResolveKeys(l,{includePatterns:!1});if(I.length===0)return this.Never(w);let P=I.map(N=>this.Literal(N));return this.Union(P,w)})()}Literal(l,w={}){return this.Create({...w,[e.Kind]:"Literal",const:l,type:typeof l})}Lowercase(l,w={}){return{...U.Map(g.Type(l),"Lowercase"),...w}}Never(l={}){return this.Create({...l,[e.Kind]:"Never",not:{}})}Not(l,w){return this.Create({...w,[e.Kind]:"Not",not:g.Type(l)})}Null(l={}){return this.Create({...l,[e.Kind]:"Null",type:"null"})}Number(l={}){return this.Create({...l,[e.Kind]:"Number",type:"number"})}Object(l,w={}){let I=Object.getOwnPropertyNames(l),P=I.filter(S=>o.TOptional(l[S])),N=I.filter(S=>!P.includes(S)),E=o.TSchema(w.additionalProperties)?{additionalProperties:g.Type(w.additionalProperties)}:{},h=I.reduce((S,_)=>({...S,[_]:g.Type(l[_])}),{});return N.length>0?this.Create({...w,...E,[e.Kind]:"Object",type:"object",properties:h,required:N}):this.Create({...w,...E,[e.Kind]:"Object",type:"object",properties:h})}Omit(l,w,I={}){let P=B.Resolve(w);return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(E=>!P.includes(E)),N.required.length===0&&delete N.required);for(let E of Object.getOwnPropertyNames(N.properties))P.includes(E)&&delete N.properties[E];return this.Create(N)},I)}Partial(l,w={}){return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),I=>{let P=Object.getOwnPropertyNames(I.properties).reduce((N,E)=>({...N,[E]:this.Optional(I.properties[E])}),{});return this.Object(P,this.Discard(I,["required"]))},w)}Pick(l,w,I={}){let P=B.Resolve(w);return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(E=>P.includes(E)),N.required.length===0&&delete N.required);for(let E of Object.getOwnPropertyNames(N.properties))P.includes(E)||delete N.properties[E];return this.Create(N)},I)}Record(l,w,I={}){return o.TTemplateLiteral(l)?(()=>{let P=K.ParseExact(l.pattern);return D.Check(P)?this.Object([...M.Generate(P)].reduce((N,E)=>({...N,[E]:g.Type(w)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[l.pattern]:g.Type(w)}})})():o.TUnion(l)?(()=>{let P=z.Resolve(l);if(o.TUnionLiteral(P)){let N=P.anyOf.reduce((E,h)=>({...E,[h.const]:g.Type(w)}),{});return this.Object(N,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():o.TLiteral(l)?i.IsString(l.const)||i.IsNumber(l.const)?this.Object({[l.const]:g.Type(w)},I):this.Throw("Record key of type literal is not of type string or number"):o.TInteger(l)||o.TNumber(l)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(w)}}):o.TString(l)?(()=>{let P=i.IsUndefined(l.pattern)?e.PatternStringExact:l.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[P]:g.Type(w)}})})():this.Never()}Recursive(l,w={}){i.IsUndefined(w.$id)&&(w.$id=`T${q++}`);let I=l({[e.Kind]:"This",$ref:`${w.$id}`});return I.$id=w.$id,this.Create({...w,[e.Hint]:"Recursive",...I})}Ref(l,w={}){return i.IsString(l)?this.Create({...w,[e.Kind]:"Ref",$ref:l}):(i.IsUndefined(l.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({...w,[e.Kind]:"Ref",$ref:l.$id}))}Required(l,w={}){return j.Map(this.Discard(g.Type(l),["$id",e.Transform]),I=>{let P=Object.getOwnPropertyNames(I.properties).reduce((N,E)=>({...N,[E]:this.Discard(I.properties[E],[e.Optional])}),{});return this.Object(P,I)},w)}Rest(l){return o.TTuple(l)&&!i.IsUndefined(l.items)?g.Rest(l.items):o.TIntersect(l)?g.Rest(l.allOf):o.TUnion(l)?g.Rest(l.anyOf):[]}String(l={}){return this.Create({...l,[e.Kind]:"String",type:"string"})}TemplateLiteral(l,w={}){let I=i.IsString(l)?ie.Create(ee.Parse(l)):ie.Create(l);return this.Create({...w,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(l){return new Q(l)}Tuple(l,w={}){let[I,P,N]=[!1,l.length,l.length],E=g.Rest(l),h=l.length>0?{...w,[e.Kind]:"Tuple",type:"array",items:E,additionalItems:I,minItems:P,maxItems:N}:{...w,[e.Kind]:"Tuple",type:"array",minItems:P,maxItems:N};return this.Create(h)}Uncapitalize(l,w={}){return{...U.Map(g.Type(l),"Uncapitalize"),...w}}Union(l,w={}){return o.TTemplateLiteral(l)?F.Resolve(l):(()=>{let I=l;if(I.length===0)return this.Never(w);if(I.length===1)return this.Create(g.Type(I[0],w));let P=g.Rest(I);return this.Create({...w,[e.Kind]:"Union",anyOf:P})})()}Unknown(l={}){return this.Create({...l,[e.Kind]:"Unknown"})}Unsafe(l={}){return this.Create({...l,[e.Kind]:l[e.Kind]||"Unsafe"})}Uppercase(l,w={}){return{...U.Map(g.Type(l),"Uppercase"),...w}}};e.JsonTypeBuilder=J;var de=class extends J{AsyncIterator(l,w={}){return this.Create({...w,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(l)})}Awaited(l,w={}){let I=P=>P.length>0?(()=>{let[N,...E]=P;return[this.Awaited(N),...I(E)]})():P;return o.TIntersect(l)?e.Type.Intersect(I(l.allOf)):o.TUnion(l)?e.Type.Union(I(l.anyOf)):o.TPromise(l)?this.Awaited(l.item):g.Type(l,w)}BigInt(l={}){return this.Create({...l,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(l,w={}){return this.Tuple([...l.parameters],{...w})}Constructor(l,w,I){let[P,N]=[g.Rest(l),g.Type(w)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:P,returns:N})}Date(l={}){return this.Create({...l,[e.Kind]:"Date",type:"Date"})}Function(l,w,I){let[P,N]=[g.Rest(l),g.Type(w)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:P,returns:N})}InstanceType(l,w={}){return g.Type(l.returns,w)}Iterator(l,w={}){return this.Create({...w,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(l)})}Parameters(l,w={}){return this.Tuple(l.parameters,{...w})}Promise(l,w={}){return this.Create({...w,[e.Kind]:"Promise",type:"Promise",item:g.Type(l)})}RegExp(l,w={}){let I=i.IsString(l)?l:l.source;return this.Create({...w,[e.Kind]:"String",type:"string",pattern:I})}RegEx(l,w={}){return this.RegExp(l,w)}ReturnType(l,w={}){return g.Type(l.returns,w)}Symbol(l){return this.Create({...l,[e.Kind]:"Symbol",type:"symbol"})}Undefined(l={}){return this.Create({...l,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(l={}){return this.Create({...l,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(l={}){return this.Create({...l,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=de,e.JsonType=new J,e.Type=new de}}),mn=jt(Yt(),1),{String:pg,Optional:yg,Boolean:hg,Object:mg,Number:gg}=mn.Type,bg=pg.bind(mn.Type),vg=gg.bind(mn.Type),pS=mg.bind(mn.Type),yS=yg.bind(mn.Type),_g=hg.bind(mn.Type),hS=bg(),mS=vg(),gS=_g();function Of(e){return Array.isArray(e)?e:[e]}var wg=Le({"../../../node_modules/.pnpm/safe-stable-stringify@2.4.3/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:r}=Object.prototype,n=W();n.configure=W,n.stringify=n,n.default=n,e.stringify=n,e.configure=W,t.exports=n;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function s(B){return B.length<5e3&&!i.test(B)?`"${B}"`:JSON.stringify(B)}function o(B){if(B.length>200)return B.sort();for(let z=1;z<B.length;z++){let Y=B[z],ie=z;for(;ie!==0&&B[ie-1]>Y;)B[ie]=B[ie-1],ie--;B[ie]=Y}return B}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function f(B){return a.call(B)!==void 0&&B.length!==0}function c(B,z,Y){B.length<Y&&(Y=B.length);let ie=z===","?"":" ",F=`"0":${ie}${B[0]}`;for(let se=1;se<Y;se++)F+=`${z}"${se}":${ie}${B[se]}`;return F}function y(B){if(r.call(B,"circularValue")){let z=B.circularValue;if(typeof z=="string")return`"${z}"`;if(z==null)return z;if(z===Error||z===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function g(B,z){let Y;if(r.call(B,z)&&(Y=B[z],typeof Y!="boolean"))throw new TypeError(`The "${z}" argument must be of type boolean`);return Y===void 0?!0:Y}function k(B,z){let Y;if(r.call(B,z)){if(Y=B[z],typeof Y!="number")throw new TypeError(`The "${z}" argument must be of type number`);if(!Number.isInteger(Y))throw new TypeError(`The "${z}" argument must be an integer`);if(Y<1)throw new RangeError(`The "${z}" argument must be >= 1`)}return Y===void 0?1/0:Y}function U(B){return B===1?"1 item":`${B} items`}function j(B){let z=new Set;for(let Y of B)(typeof Y=="string"||typeof Y=="number")&&z.add(String(Y));return z}function te(B){if(r.call(B,"strict")){let z=B.strict;if(typeof z!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(z)return Y=>{let ie=`Object can not safely be stringified. Received type ${typeof Y}`;throw typeof Y!="function"&&(ie+=` (${Y.toString()})`),new Error(ie)}}}function W(B){B={...B};let z=te(B);z&&(B.bigint===void 0&&(B.bigint=!1),"circularValue"in B||(B.circularValue=Error));let Y=y(B),ie=g(B,"bigint"),F=g(B,"deterministic"),se=k(B,"maximumDepth"),K=k(B,"maximumBreadth");function ye(Q,O,q,ne,G,J){let de=O[Q];switch(typeof de=="object"&&de!==null&&typeof de.toJSON=="function"&&(de=de.toJSON(Q)),de=ne.call(O,Q,de),typeof de){case"string":return s(de);case"object":{if(de===null)return"null";if(q.indexOf(de)!==-1)return Y;let l="",w=",",I=J;if(Array.isArray(de)){if(de.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(de),G!==""&&(J+=G,l+=`
3
+ ${J}`,w=`,
4
+ ${J}`);let _=Math.min(de.length,K),u=0;for(;u<_-1;u++){let v=ye(String(u),de,q,ne,G,J);l+=v!==void 0?v:"null",l+=w}let A=ye(String(u),de,q,ne,G,J);if(l+=A!==void 0?A:"null",de.length-1>K){let v=de.length-K-1;l+=`${w}"... ${U(v)} not stringified"`}return G!==""&&(l+=`
5
+ ${I}`),q.pop(),`[${l}]`}let P=Object.keys(de),N=P.length;if(N===0)return"{}";if(se<q.length+1)return'"[Object]"';let E="",h="";G!==""&&(J+=G,w=`,
6
+ ${J}`,E=" ");let S=Math.min(N,K);F&&!f(de)&&(P=o(P)),q.push(de);for(let _=0;_<S;_++){let u=P[_],A=ye(u,de,q,ne,G,J);A!==void 0&&(l+=`${h}${s(u)}:${E}${A}`,h=w)}if(N>K){let _=N-K;l+=`${h}"...":${E}"${U(_)} not stringified"`,h=w}return G!==""&&h.length>1&&(l=`
7
+ ${J}${l}
8
+ ${I}`),q.pop(),`{${l}}`}case"number":return isFinite(de)?String(de):z?z(de):"null";case"boolean":return de===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(de);default:return z?z(de):void 0}}function D(Q,O,q,ne,G,J){switch(typeof O=="object"&&O!==null&&typeof O.toJSON=="function"&&(O=O.toJSON(Q)),typeof O){case"string":return s(O);case"object":{if(O===null)return"null";if(q.indexOf(O)!==-1)return Y;let de=J,l="",w=",";if(Array.isArray(O)){if(O.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(O),G!==""&&(J+=G,l+=`
9
+ ${J}`,w=`,
10
+ ${J}`);let N=Math.min(O.length,K),E=0;for(;E<N-1;E++){let S=D(String(E),O[E],q,ne,G,J);l+=S!==void 0?S:"null",l+=w}let h=D(String(E),O[E],q,ne,G,J);if(l+=h!==void 0?h:"null",O.length-1>K){let S=O.length-K-1;l+=`${w}"... ${U(S)} not stringified"`}return G!==""&&(l+=`
11
+ ${de}`),q.pop(),`[${l}]`}q.push(O);let I="";G!==""&&(J+=G,w=`,
12
+ ${J}`,I=" ");let P="";for(let N of ne){let E=D(N,O[N],q,ne,G,J);E!==void 0&&(l+=`${P}${s(N)}:${I}${E}`,P=w)}return G!==""&&P.length>1&&(l=`
13
+ ${J}${l}
14
+ ${de}`),q.pop(),`{${l}}`}case"number":return isFinite(O)?String(O):z?z(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(O);default:return z?z(O):void 0}}function R(Q,O,q,ne,G){switch(typeof O){case"string":return s(O);case"object":{if(O===null)return"null";if(typeof O.toJSON=="function"){if(O=O.toJSON(Q),typeof O!="object")return R(Q,O,q,ne,G);if(O===null)return"null"}if(q.indexOf(O)!==-1)return Y;let J=G;if(Array.isArray(O)){if(O.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(O),G+=ne;let E=`
15
+ ${G}`,h=`,
16
+ ${G}`,S=Math.min(O.length,K),_=0;for(;_<S-1;_++){let A=R(String(_),O[_],q,ne,G);E+=A!==void 0?A:"null",E+=h}let u=R(String(_),O[_],q,ne,G);if(E+=u!==void 0?u:"null",O.length-1>K){let A=O.length-K-1;E+=`${h}"... ${U(A)} not stringified"`}return E+=`
17
+ ${J}`,q.pop(),`[${E}]`}let de=Object.keys(O),l=de.length;if(l===0)return"{}";if(se<q.length+1)return'"[Object]"';G+=ne;let w=`,
18
+ ${G}`,I="",P="",N=Math.min(l,K);f(O)&&(I+=c(O,w,K),de=de.slice(O.length),N-=O.length,P=w),F&&(de=o(de)),q.push(O);for(let E=0;E<N;E++){let h=de[E],S=R(h,O[h],q,ne,G);S!==void 0&&(I+=`${P}${s(h)}: ${S}`,P=w)}if(l>K){let E=l-K;I+=`${P}"...": "${U(E)} not stringified"`,P=w}return P!==""&&(I=`
19
+ ${G}${I}
20
+ ${J}`),q.pop(),`{${I}}`}case"number":return isFinite(O)?String(O):z?z(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(O);default:return z?z(O):void 0}}function M(Q,O,q){switch(typeof O){case"string":return s(O);case"object":{if(O===null)return"null";if(typeof O.toJSON=="function"){if(O=O.toJSON(Q),typeof O!="object")return M(Q,O,q);if(O===null)return"null"}if(q.indexOf(O)!==-1)return Y;let ne="";if(Array.isArray(O)){if(O.length===0)return"[]";if(se<q.length+1)return'"[Array]"';q.push(O);let w=Math.min(O.length,K),I=0;for(;I<w-1;I++){let N=M(String(I),O[I],q);ne+=N!==void 0?N:"null",ne+=","}let P=M(String(I),O[I],q);if(ne+=P!==void 0?P:"null",O.length-1>K){let N=O.length-K-1;ne+=`,"... ${U(N)} not stringified"`}return q.pop(),`[${ne}]`}let G=Object.keys(O),J=G.length;if(J===0)return"{}";if(se<q.length+1)return'"[Object]"';let de="",l=Math.min(J,K);f(O)&&(ne+=c(O,",",K),G=G.slice(O.length),l-=O.length,de=","),F&&(G=o(G)),q.push(O);for(let w=0;w<l;w++){let I=G[w],P=M(I,O[I],q);P!==void 0&&(ne+=`${de}${s(I)}:${P}`,de=",")}if(J>K){let w=J-K;ne+=`${de}"...":"${U(w)} not stringified"`}return q.pop(),`{${ne}}`}case"number":return isFinite(O)?String(O):z?z(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(ie)return String(O);default:return z?z(O):void 0}}function ee(Q,O,q){if(arguments.length>1){let ne="";if(typeof q=="number"?ne=" ".repeat(Math.min(q,10)):typeof q=="string"&&(ne=q.slice(0,10)),O!=null){if(typeof O=="function")return ye("",{"":Q},[],O,ne,"");if(Array.isArray(O))return D("",Q,[],j(O),ne,"")}if(ne.length!==0)return R("",Q,[],ne,"")}return M("",Q,[])}return ee}}}),An=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(F){return c(F)&&Symbol.asyncIterator in F}e.IsAsyncIterator=t;function r(F){return c(F)&&Symbol.iterator in F}e.IsIterator=r;function n(F){return ArrayBuffer.isView(F)}e.IsTypedArray=n;function i(F){return F instanceof Promise}e.IsPromise=i;function s(F){return F instanceof Uint8Array}e.IsUint8Array=s;function o(F){return F instanceof Date&&Number.isFinite(F.getTime())}e.IsDate=o;function a(F,se){return se in F}e.HasPropertyKey=a;function f(F){return c(F)&&z(F.constructor)&&F.constructor.name==="Object"}e.IsPlainObject=f;function c(F){return F!==null&&typeof F=="object"}e.IsObject=c;function y(F){return Array.isArray(F)&&!ArrayBuffer.isView(F)}e.IsArray=y;function g(F){return F===void 0}e.IsUndefined=g;function k(F){return F===null}e.IsNull=k;function U(F){return typeof F=="boolean"}e.IsBoolean=U;function j(F){return typeof F=="number"}e.IsNumber=j;function te(F){return j(F)&&Number.isInteger(F)}e.IsInteger=te;function W(F){return typeof F=="bigint"}e.IsBigInt=W;function B(F){return typeof F=="string"}e.IsString=B;function z(F){return typeof F=="function"}e.IsFunction=z;function Y(F){return typeof F=="symbol"}e.IsSymbol=Y;function ie(F){return W(F)||U(F)||k(F)||j(F)||B(F)||Y(F)||g(F)}e.IsValueType=ie}}),gl=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=An(),r=Fo(),n=Yt(),i=class extends n.TypeBoxError{constructor(y){super(`Duplicate type kind '${y}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var s=class extends n.TypeBoxError{constructor(y){super(`Duplicate string format '${y}' detected`)}};e.TypeSystemDuplicateFormat=s;var o;(function(y){function g(U,j){if(n.TypeRegistry.Has(U))throw new i(U);return n.TypeRegistry.Set(U,j),(te={})=>n.Type.Unsafe({...te,[n.Kind]:U})}y.Type=g;function k(U,j){if(n.FormatRegistry.Has(U))throw new s(U);return n.FormatRegistry.Set(U,j),U}y.Format=k})(o||(e.TypeSystem=o={}));var a;(function(y){let g=c;function k(){g=c}y.Reset=k;function U(te){g=te}y.Set=U;function j(){return g}y.Get=j})(a||(e.TypeSystemErrorFunction=a={}));var f;(function(y){y.ExactOptionalPropertyTypes=!1,y.AllowArrayObject=!1,y.AllowNaN=!1,y.AllowNullVoid=!1;function g(W,B){return y.ExactOptionalPropertyTypes?B in W:W[B]!==void 0}y.IsExactOptionalProperty=g;function k(W){let B=(0,t.IsObject)(W);return y.AllowArrayObject?B:B&&!(0,t.IsArray)(W)}y.IsObjectLike=k;function U(W){return k(W)&&!(W instanceof Date)&&!(W instanceof Uint8Array)}y.IsRecordLike=U;function j(W){let B=(0,t.IsNumber)(W);return y.AllowNaN?B:B&&Number.isFinite(W)}y.IsNumberLike=j;function te(W){let B=(0,t.IsUndefined)(W);return y.AllowNullVoid?B||W===null:B}y.IsVoidLike=te})(f||(e.TypeSystemPolicy=f={}));function c(y,g){switch(g){case r.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case r.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${y.maxContains} matching values`;case r.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${y.minContains} matching values`;case r.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${y.maxItems}`;case r.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${y.minItems}`;case r.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case r.ValueErrorType.Array:return"Expected array";case r.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case r.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${y.exclusiveMaximum}`;case r.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${y.exclusiveMinimum}`;case r.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${y.maximum}`;case r.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${y.minimum}`;case r.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${y.multipleOf}`;case r.ValueErrorType.BigInt:return"Expected bigint";case r.ValueErrorType.Boolean:return"Expected boolean";case r.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${y.exclusiveMinimumTimestamp}`;case r.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${y.exclusiveMaximumTimestamp}`;case r.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${y.minimumTimestamp}`;case r.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${y.maximumTimestamp}`;case r.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${y.multipleOfTimestamp}`;case r.ValueErrorType.Date:return"Expected Date";case r.ValueErrorType.Function:return"Expected function";case r.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${y.exclusiveMaximum}`;case r.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${y.exclusiveMinimum}`;case r.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${y.maximum}`;case r.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${y.minimum}`;case r.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${y.multipleOf}`;case r.ValueErrorType.Integer:return"Expected integer";case r.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case r.ValueErrorType.Intersect:return"Expected all values to match";case r.ValueErrorType.Iterator:return"Expected Iterator";case r.ValueErrorType.Literal:return`Expected ${typeof y.const=="string"?`'${y.const}'`:y.const}`;case r.ValueErrorType.Never:return"Never";case r.ValueErrorType.Not:return"Value should not match";case r.ValueErrorType.Null:return"Expected null";case r.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${y.exclusiveMaximum}`;case r.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${y.exclusiveMinimum}`;case r.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${y.maximum}`;case r.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${y.minimum}`;case r.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${y.multipleOf}`;case r.ValueErrorType.Number:return"Expected number";case r.ValueErrorType.Object:return"Expected object";case r.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case r.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${y.maxProperties} properties`;case r.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${y.minProperties} properties`;case r.ValueErrorType.ObjectRequiredProperty:return"Required property";case r.ValueErrorType.Promise:return"Expected Promise";case r.ValueErrorType.StringFormatUnknown:return`Unknown format '${y.format}'`;case r.ValueErrorType.StringFormat:return`Expected string to match '${y.format}' format`;case r.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${y.maxLength}`;case r.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${y.minLength}`;case r.ValueErrorType.StringPattern:return`Expected string to match '${y.pattern}'`;case r.ValueErrorType.String:return"Expected string";case r.ValueErrorType.Symbol:return"Expected symbol";case r.ValueErrorType.TupleLength:return`Expected tuple to have ${y.maxItems||0} elements`;case r.ValueErrorType.Tuple:return"Expected tuple";case r.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${y.maxByteLength}`;case r.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${y.minByteLength}`;case r.ValueErrorType.Uint8Array:return"Expected Uint8Array";case r.ValueErrorType.Undefined:return"Expected undefined";case r.ValueErrorType.Union:return"Expected union value";case r.ValueErrorType.Void:return"Expected void";case r.ValueErrorType.Kind:return`Expected kind '${y[n.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),Lo=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=Yt(),r=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=r;function n(i,s){let o=s.findIndex(a=>a.$id===i.$ref);if(o===-1)throw new r(i);return s[o]}e.Deref=n}}),Ca=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=An(),r=class extends Error{constructor(R){super("Unable to hash value"),this.value=R}};e.ValueHashError=r;var n;(function(R){R[R.Undefined=0]="Undefined",R[R.Null=1]="Null",R[R.Boolean=2]="Boolean",R[R.Number=3]="Number",R[R.String=4]="String",R[R.Object=5]="Object",R[R.Array=6]="Array",R[R.Date=7]="Date",R[R.Uint8Array=8]="Uint8Array",R[R.Symbol=9]="Symbol",R[R.BigInt=10]="BigInt"})(n||(e.ByteMarker=n={}));var i=BigInt("14695981039346656037"),[s,o]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((R,M)=>BigInt(M)),f=new Float64Array(1),c=new DataView(f.buffer),y=new Uint8Array(f.buffer);function*g(R){let M=R===0?1:Math.ceil(Math.floor(Math.log2(R)+1)/8);for(let ee=0;ee<M;ee++)yield R>>8*(M-1-ee)&255}function k(R){ye(n.Array);for(let M of R)K(M)}function U(R){ye(n.Boolean),ye(R?1:0)}function j(R){ye(n.BigInt),c.setBigInt64(0,R);for(let M of y)ye(M)}function te(R){ye(n.Date),K(R.getTime())}function W(R){ye(n.Null)}function B(R){ye(n.Number),c.setFloat64(0,R);for(let M of y)ye(M)}function z(R){ye(n.Object);for(let M of globalThis.Object.keys(R).sort())K(M),K(R[M])}function Y(R){ye(n.String);for(let M=0;M<R.length;M++)for(let ee of g(R.charCodeAt(M)))ye(ee)}function ie(R){ye(n.Symbol),K(R.description)}function F(R){ye(n.Uint8Array);for(let M=0;M<R.length;M++)ye(R[M])}function se(R){return ye(n.Undefined)}function K(R){if((0,t.IsArray)(R))return k(R);if((0,t.IsBoolean)(R))return U(R);if((0,t.IsBigInt)(R))return j(R);if((0,t.IsDate)(R))return te(R);if((0,t.IsNull)(R))return W(R);if((0,t.IsNumber)(R))return B(R);if((0,t.IsPlainObject)(R))return z(R);if((0,t.IsString)(R))return Y(R);if((0,t.IsSymbol)(R))return ie(R);if((0,t.IsUint8Array)(R))return F(R);if((0,t.IsUndefined)(R))return se(R);throw new r(R)}function ye(R){i=i^a[R],i=i*s%o}function D(R){return i=BigInt("14695981039346656037"),K(R),i}e.Hash=D}}),Fo=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=An(),r=gl(),n=Lo(),i=Ca(),s=Yt(),o;(function(u){u[u.ArrayContains=0]="ArrayContains",u[u.ArrayMaxContains=1]="ArrayMaxContains",u[u.ArrayMaxItems=2]="ArrayMaxItems",u[u.ArrayMinContains=3]="ArrayMinContains",u[u.ArrayMinItems=4]="ArrayMinItems",u[u.ArrayUniqueItems=5]="ArrayUniqueItems",u[u.Array=6]="Array",u[u.AsyncIterator=7]="AsyncIterator",u[u.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",u[u.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",u[u.BigIntMaximum=10]="BigIntMaximum",u[u.BigIntMinimum=11]="BigIntMinimum",u[u.BigIntMultipleOf=12]="BigIntMultipleOf",u[u.BigInt=13]="BigInt",u[u.Boolean=14]="Boolean",u[u.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",u[u.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",u[u.DateMaximumTimestamp=17]="DateMaximumTimestamp",u[u.DateMinimumTimestamp=18]="DateMinimumTimestamp",u[u.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",u[u.Date=20]="Date",u[u.Function=21]="Function",u[u.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",u[u.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",u[u.IntegerMaximum=24]="IntegerMaximum",u[u.IntegerMinimum=25]="IntegerMinimum",u[u.IntegerMultipleOf=26]="IntegerMultipleOf",u[u.Integer=27]="Integer",u[u.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",u[u.Intersect=29]="Intersect",u[u.Iterator=30]="Iterator",u[u.Kind=31]="Kind",u[u.Literal=32]="Literal",u[u.Never=33]="Never",u[u.Not=34]="Not",u[u.Null=35]="Null",u[u.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",u[u.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",u[u.NumberMaximum=38]="NumberMaximum",u[u.NumberMinimum=39]="NumberMinimum",u[u.NumberMultipleOf=40]="NumberMultipleOf",u[u.Number=41]="Number",u[u.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",u[u.ObjectMaxProperties=43]="ObjectMaxProperties",u[u.ObjectMinProperties=44]="ObjectMinProperties",u[u.ObjectRequiredProperty=45]="ObjectRequiredProperty",u[u.Object=46]="Object",u[u.Promise=47]="Promise",u[u.StringFormatUnknown=48]="StringFormatUnknown",u[u.StringFormat=49]="StringFormat",u[u.StringMaxLength=50]="StringMaxLength",u[u.StringMinLength=51]="StringMinLength",u[u.StringPattern=52]="StringPattern",u[u.String=53]="String",u[u.Symbol=54]="Symbol",u[u.TupleLength=55]="TupleLength",u[u.Tuple=56]="Tuple",u[u.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",u[u.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",u[u.Uint8Array=59]="Uint8Array",u[u.Undefined=60]="Undefined",u[u.Union=61]="Union",u[u.Void=62]="Void"})(o||(e.ValueErrorType=o={}));var a=class extends s.TypeBoxError{constructor(u){super("Unknown type"),this.schema=u}};e.ValueErrorsUnknownTypeError=a;function f(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=f;function c(u){return u!==void 0}var y=class{constructor(u){this.iterator=u}[Symbol.iterator](){return this.iterator}First(){let u=this.iterator.next();return u.done?void 0:u.value}};e.ValueErrorIterator=y;function g(u,A,v,b){return{type:u,schema:A,path:v,value:b,message:r.TypeSystemErrorFunction.Get()(A,u)}}function*k(u,A,v,b){}function*U(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(o.Array,u,v,b);c(u.minItems)&&!(b.length>=u.minItems)&&(yield g(o.ArrayMinItems,u,v,b)),c(u.maxItems)&&!(b.length<=u.maxItems)&&(yield g(o.ArrayMaxItems,u,v,b));for(let X=0;X<b.length;X++)yield*S(u.items,A,`${v}/${X}`,b[X]);if(u.uniqueItems===!0&&!function(){let X=new Set;for(let re of b){let me=(0,i.Hash)(re);if(X.has(me))return!1;X.add(me)}return!0}()&&(yield g(o.ArrayUniqueItems,u,v,b)),!(c(u.contains)||c(u.minContains)||c(u.maxContains)))return;let $=c(u.contains)?u.contains:s.Type.Never(),V=b.reduce((X,re,me)=>S($,A,`${v}${me}`,re).next().done===!0?X+1:X,0);V===0&&(yield g(o.ArrayContains,u,v,b)),(0,t.IsNumber)(u.minContains)&&V<u.minContains&&(yield g(o.ArrayMinContains,u,v,b)),(0,t.IsNumber)(u.maxContains)&&V>u.maxContains&&(yield g(o.ArrayMaxContains,u,v,b))}function*j(u,A,v,b){(0,t.IsAsyncIterator)(b)||(yield g(o.AsyncIterator,u,v,b))}function*te(u,A,v,b){if(!(0,t.IsBigInt)(b))return yield g(o.BigInt,u,v,b);c(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(o.BigIntExclusiveMaximum,u,v,b)),c(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(o.BigIntExclusiveMinimum,u,v,b)),c(u.maximum)&&!(b<=u.maximum)&&(yield g(o.BigIntMaximum,u,v,b)),c(u.minimum)&&!(b>=u.minimum)&&(yield g(o.BigIntMinimum,u,v,b)),c(u.multipleOf)&&b%u.multipleOf!==BigInt(0)&&(yield g(o.BigIntMultipleOf,u,v,b))}function*W(u,A,v,b){(0,t.IsBoolean)(b)||(yield g(o.Boolean,u,v,b))}function*B(u,A,v,b){yield*S(u.returns,A,v,b.prototype)}function*z(u,A,v,b){if(!(0,t.IsDate)(b))return yield g(o.Date,u,v,b);c(u.exclusiveMaximumTimestamp)&&!(b.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(o.DateExclusiveMaximumTimestamp,u,v,b)),c(u.exclusiveMinimumTimestamp)&&!(b.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(o.DateExclusiveMinimumTimestamp,u,v,b)),c(u.maximumTimestamp)&&!(b.getTime()<=u.maximumTimestamp)&&(yield g(o.DateMaximumTimestamp,u,v,b)),c(u.minimumTimestamp)&&!(b.getTime()>=u.minimumTimestamp)&&(yield g(o.DateMinimumTimestamp,u,v,b)),c(u.multipleOfTimestamp)&&b.getTime()%u.multipleOfTimestamp!==0&&(yield g(o.DateMultipleOfTimestamp,u,v,b))}function*Y(u,A,v,b){(0,t.IsFunction)(b)||(yield g(o.Function,u,v,b))}function*ie(u,A,v,b){if(!(0,t.IsInteger)(b))return yield g(o.Integer,u,v,b);c(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(o.IntegerExclusiveMaximum,u,v,b)),c(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(o.IntegerExclusiveMinimum,u,v,b)),c(u.maximum)&&!(b<=u.maximum)&&(yield g(o.IntegerMaximum,u,v,b)),c(u.minimum)&&!(b>=u.minimum)&&(yield g(o.IntegerMinimum,u,v,b)),c(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(o.IntegerMultipleOf,u,v,b))}function*F(u,A,v,b){for(let $ of u.allOf){let V=S($,A,v,b).next();V.done||(yield g(o.Intersect,u,v,b),yield V.value)}if(u.unevaluatedProperties===!1){let $=new RegExp(s.KeyResolver.ResolvePattern(u));for(let V of Object.getOwnPropertyNames(b))$.test(V)||(yield g(o.IntersectUnevaluatedProperties,u,`${v}/${V}`,b))}if(typeof u.unevaluatedProperties=="object"){let $=new RegExp(s.KeyResolver.ResolvePattern(u));for(let V of Object.getOwnPropertyNames(b))if(!$.test(V)){let X=S(u.unevaluatedProperties,A,`${v}/${V}`,b[V]).next();X.done||(yield X.value)}}}function*se(u,A,v,b){(0,t.IsIterator)(b)||(yield g(o.Iterator,u,v,b))}function*K(u,A,v,b){b!==u.const&&(yield g(o.Literal,u,v,b))}function*ye(u,A,v,b){yield g(o.Never,u,v,b)}function*D(u,A,v,b){S(u.not,A,v,b).next().done===!0&&(yield g(o.Not,u,v,b))}function*R(u,A,v,b){(0,t.IsNull)(b)||(yield g(o.Null,u,v,b))}function*M(u,A,v,b){if(!r.TypeSystemPolicy.IsNumberLike(b))return yield g(o.Number,u,v,b);c(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(o.NumberExclusiveMaximum,u,v,b)),c(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(o.NumberExclusiveMinimum,u,v,b)),c(u.maximum)&&!(b<=u.maximum)&&(yield g(o.NumberMaximum,u,v,b)),c(u.minimum)&&!(b>=u.minimum)&&(yield g(o.NumberMinimum,u,v,b)),c(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(o.NumberMultipleOf,u,v,b))}function*ee(u,A,v,b){if(!r.TypeSystemPolicy.IsObjectLike(b))return yield g(o.Object,u,v,b);c(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,v,b)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,v,b));let $=Array.isArray(u.required)?u.required:[],V=Object.getOwnPropertyNames(u.properties),X=Object.getOwnPropertyNames(b);for(let re of $)X.includes(re)||(yield g(o.ObjectRequiredProperty,u.properties[re],`${v}/${f(re)}`,void 0));if(u.additionalProperties===!1)for(let re of X)V.includes(re)||(yield g(o.ObjectAdditionalProperties,u,`${v}/${f(re)}`,b[re]));if(typeof u.additionalProperties=="object")for(let re of X)V.includes(re)||(yield*S(u.additionalProperties,A,`${v}/${f(re)}`,b[re]));for(let re of V){let me=u.properties[re];u.required&&u.required.includes(re)?(yield*S(me,A,`${v}/${f(re)}`,b[re]),s.ExtendsUndefined.Check(u)&&!(re in b)&&(yield g(o.ObjectRequiredProperty,me,`${v}/${f(re)}`,void 0))):r.TypeSystemPolicy.IsExactOptionalProperty(b,re)&&(yield*S(me,A,`${v}/${f(re)}`,b[re]))}}function*Q(u,A,v,b){(0,t.IsPromise)(b)||(yield g(o.Promise,u,v,b))}function*O(u,A,v,b){if(!r.TypeSystemPolicy.IsRecordLike(b))return yield g(o.Object,u,v,b);c(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,v,b)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,v,b));let[$,V]=Object.entries(u.patternProperties)[0],X=new RegExp($);for(let[re,me]of Object.entries(b))X.test(re)&&(yield*S(V,A,`${v}/${f(re)}`,me));if(typeof u.additionalProperties=="object")for(let[re,me]of Object.entries(b))X.test(re)||(yield*S(u.additionalProperties,A,`${v}/${f(re)}`,me));if(u.additionalProperties===!1){for(let[re,me]of Object.entries(b))if(!X.test(re))return yield g(o.ObjectAdditionalProperties,u,`${v}/${f(re)}`,me)}}function*q(u,A,v,b){yield*S((0,n.Deref)(u,A),A,v,b)}function*ne(u,A,v,b){if(!(0,t.IsString)(b))return yield g(o.String,u,v,b);c(u.minLength)&&!(b.length>=u.minLength)&&(yield g(o.StringMinLength,u,v,b)),c(u.maxLength)&&!(b.length<=u.maxLength)&&(yield g(o.StringMaxLength,u,v,b)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(b)||(yield g(o.StringPattern,u,v,b))),(0,t.IsString)(u.format)&&(s.FormatRegistry.Has(u.format)?s.FormatRegistry.Get(u.format)(b)||(yield g(o.StringFormat,u,v,b)):yield g(o.StringFormatUnknown,u,v,b))}function*G(u,A,v,b){(0,t.IsSymbol)(b)||(yield g(o.Symbol,u,v,b))}function*J(u,A,v,b){if(!(0,t.IsString)(b))return yield g(o.String,u,v,b);new RegExp(u.pattern).test(b)||(yield g(o.StringPattern,u,v,b))}function*de(u,A,v,b){yield*S((0,n.Deref)(u,A),A,v,b)}function*l(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(o.Tuple,u,v,b);if(u.items===void 0&&b.length!==0)return yield g(o.TupleLength,u,v,b);if(b.length!==u.maxItems)return yield g(o.TupleLength,u,v,b);if(u.items)for(let $=0;$<u.items.length;$++)yield*S(u.items[$],A,`${v}/${$}`,b[$])}function*w(u,A,v,b){(0,t.IsUndefined)(b)||(yield g(o.Undefined,u,v,b))}function*I(u,A,v,b){let $=0;for(let V of u.anyOf){let X=[...S(V,A,v,b)];if(X.length===0)return;$+=X.length}$>0&&(yield g(o.Union,u,v,b))}function*P(u,A,v,b){if(!(0,t.IsUint8Array)(b))return yield g(o.Uint8Array,u,v,b);c(u.maxByteLength)&&!(b.length<=u.maxByteLength)&&(yield g(o.Uint8ArrayMaxByteLength,u,v,b)),c(u.minByteLength)&&!(b.length>=u.minByteLength)&&(yield g(o.Uint8ArrayMinByteLength,u,v,b))}function*N(u,A,v,b){}function*E(u,A,v,b){r.TypeSystemPolicy.IsVoidLike(b)||(yield g(o.Void,u,v,b))}function*h(u,A,v,b){s.TypeRegistry.Get(u[s.Kind])(u,b)||(yield g(o.Kind,u,v,b))}function*S(u,A,v,b){let $=c(u.$id)?[...A,u]:A,V=u;switch(V[s.Kind]){case"Any":return yield*k(V,$,v,b);case"Array":return yield*U(V,$,v,b);case"AsyncIterator":return yield*j(V,$,v,b);case"BigInt":return yield*te(V,$,v,b);case"Boolean":return yield*W(V,$,v,b);case"Constructor":return yield*B(V,$,v,b);case"Date":return yield*z(V,$,v,b);case"Function":return yield*Y(V,$,v,b);case"Integer":return yield*ie(V,$,v,b);case"Intersect":return yield*F(V,$,v,b);case"Iterator":return yield*se(V,$,v,b);case"Literal":return yield*K(V,$,v,b);case"Never":return yield*ye(V,$,v,b);case"Not":return yield*D(V,$,v,b);case"Null":return yield*R(V,$,v,b);case"Number":return yield*M(V,$,v,b);case"Object":return yield*ee(V,$,v,b);case"Promise":return yield*Q(V,$,v,b);case"Record":return yield*O(V,$,v,b);case"Ref":return yield*q(V,$,v,b);case"String":return yield*ne(V,$,v,b);case"Symbol":return yield*G(V,$,v,b);case"TemplateLiteral":return yield*J(V,$,v,b);case"This":return yield*de(V,$,v,b);case"Tuple":return yield*l(V,$,v,b);case"Undefined":return yield*w(V,$,v,b);case"Union":return yield*I(V,$,v,b);case"Uint8Array":return yield*P(V,$,v,b);case"Unknown":return yield*N(V,$,v,b);case"Void":return yield*E(V,$,v,b);default:if(!s.TypeRegistry.Has(V[s.Kind]))throw new a(u);return yield*h(V,$,v,b)}}function _(...u){let A=u.length===3?S(u[0],u[1],"",u[2]):S(u[0],[],"",u[1]);return new y(A)}e.Errors=_}}),Tg=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=e&&e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Fo(),e)}}),bl=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,f)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var n=Fo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(gl(),e)}}),Og=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=An(),r=bl(),n=Lo(),i=Ca(),s=Yt(),o=class extends s.TypeBoxError{constructor(h){super("Unknown type"),this.schema=h}};e.ValueCheckUnknownTypeError=o;function a(h){return h[s.Kind]==="Any"||h[s.Kind]==="Unknown"}function f(h){return h!==void 0}function c(h,S,_){return!0}function y(h,S,_){if(!(0,t.IsArray)(_)||f(h.minItems)&&!(_.length>=h.minItems)||f(h.maxItems)&&!(_.length<=h.maxItems)||!_.every(v=>N(h.items,S,v))||h.uniqueItems===!0&&!function(){let v=new Set;for(let b of _){let $=(0,i.Hash)(b);if(v.has($))return!1;v.add($)}return!0}())return!1;if(!(f(h.contains)||(0,t.IsNumber)(h.minContains)||(0,t.IsNumber)(h.maxContains)))return!0;let u=f(h.contains)?h.contains:s.Type.Never(),A=_.reduce((v,b)=>N(u,S,b)?v+1:v,0);return!(A===0||(0,t.IsNumber)(h.minContains)&&A<h.minContains||(0,t.IsNumber)(h.maxContains)&&A>h.maxContains)}function g(h,S,_){return(0,t.IsAsyncIterator)(_)}function k(h,S,_){return!(!(0,t.IsBigInt)(_)||f(h.exclusiveMaximum)&&!(_<h.exclusiveMaximum)||f(h.exclusiveMinimum)&&!(_>h.exclusiveMinimum)||f(h.maximum)&&!(_<=h.maximum)||f(h.minimum)&&!(_>=h.minimum)||f(h.multipleOf)&&_%h.multipleOf!==BigInt(0))}function U(h,S,_){return(0,t.IsBoolean)(_)}function j(h,S,_){return N(h.returns,S,_.prototype)}function te(h,S,_){return!(!(0,t.IsDate)(_)||f(h.exclusiveMaximumTimestamp)&&!(_.getTime()<h.exclusiveMaximumTimestamp)||f(h.exclusiveMinimumTimestamp)&&!(_.getTime()>h.exclusiveMinimumTimestamp)||f(h.maximumTimestamp)&&!(_.getTime()<=h.maximumTimestamp)||f(h.minimumTimestamp)&&!(_.getTime()>=h.minimumTimestamp)||f(h.multipleOfTimestamp)&&_.getTime()%h.multipleOfTimestamp!==0)}function W(h,S,_){return(0,t.IsFunction)(_)}function B(h,S,_){return!(!(0,t.IsInteger)(_)||f(h.exclusiveMaximum)&&!(_<h.exclusiveMaximum)||f(h.exclusiveMinimum)&&!(_>h.exclusiveMinimum)||f(h.maximum)&&!(_<=h.maximum)||f(h.minimum)&&!(_>=h.minimum)||f(h.multipleOf)&&_%h.multipleOf!==0)}function z(h,S,_){let u=h.allOf.every(A=>N(A,S,_));if(h.unevaluatedProperties===!1){let A=new RegExp(s.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(_).every(b=>A.test(b));return u&&v}else if(s.TypeGuard.TSchema(h.unevaluatedProperties)){let A=new RegExp(s.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(_).every(b=>A.test(b)||N(h.unevaluatedProperties,S,_[b]));return u&&v}else return u}function Y(h,S,_){return(0,t.IsIterator)(_)}function ie(h,S,_){return _===h.const}function F(h,S,_){return!1}function se(h,S,_){return!N(h.not,S,_)}function K(h,S,_){return(0,t.IsNull)(_)}function ye(h,S,_){return!(!r.TypeSystemPolicy.IsNumberLike(_)||f(h.exclusiveMaximum)&&!(_<h.exclusiveMaximum)||f(h.exclusiveMinimum)&&!(_>h.exclusiveMinimum)||f(h.minimum)&&!(_>=h.minimum)||f(h.maximum)&&!(_<=h.maximum)||f(h.multipleOf)&&_%h.multipleOf!==0)}function D(h,S,_){if(!r.TypeSystemPolicy.IsObjectLike(_)||f(h.minProperties)&&!(Object.getOwnPropertyNames(_).length>=h.minProperties)||f(h.maxProperties)&&!(Object.getOwnPropertyNames(_).length<=h.maxProperties))return!1;let u=Object.getOwnPropertyNames(h.properties);for(let A of u){let v=h.properties[A];if(h.required&&h.required.includes(A)){if(!N(v,S,_[A])||(s.ExtendsUndefined.Check(v)||a(v))&&!(A in _))return!1}else if(r.TypeSystemPolicy.IsExactOptionalProperty(_,A)&&!N(v,S,_[A]))return!1}if(h.additionalProperties===!1){let A=Object.getOwnPropertyNames(_);return h.required&&h.required.length===u.length&&A.length===u.length?!0:A.every(v=>u.includes(v))}else return typeof h.additionalProperties=="object"?Object.getOwnPropertyNames(_).every(v=>u.includes(v)||N(h.additionalProperties,S,_[v])):!0}function R(h,S,_){return(0,t.IsPromise)(_)}function M(h,S,_){if(!r.TypeSystemPolicy.IsRecordLike(_)||f(h.minProperties)&&!(Object.getOwnPropertyNames(_).length>=h.minProperties)||f(h.maxProperties)&&!(Object.getOwnPropertyNames(_).length<=h.maxProperties))return!1;let[u,A]=Object.entries(h.patternProperties)[0],v=new RegExp(u),b=Object.entries(_).every(([X,re])=>v.test(X)?N(A,S,re):!0),$=typeof h.additionalProperties=="object"?Object.entries(_).every(([X,re])=>v.test(X)?!0:N(h.additionalProperties,S,re)):!0,V=h.additionalProperties===!1?Object.getOwnPropertyNames(_).every(X=>v.test(X)):!0;return b&&$&&V}function ee(h,S,_){return N((0,n.Deref)(h,S),S,_)}function Q(h,S,_){return!(0,t.IsString)(_)||f(h.minLength)&&!(_.length>=h.minLength)||f(h.maxLength)&&!(_.length<=h.maxLength)||f(h.pattern)&&!new RegExp(h.pattern).test(_)?!1:f(h.format)?s.FormatRegistry.Has(h.format)?s.FormatRegistry.Get(h.format)(_):!1:!0}function O(h,S,_){return(0,t.IsSymbol)(_)}function q(h,S,_){return(0,t.IsString)(_)&&new RegExp(h.pattern).test(_)}function ne(h,S,_){return N((0,n.Deref)(h,S),S,_)}function G(h,S,_){if(!(0,t.IsArray)(_)||h.items===void 0&&_.length!==0||_.length!==h.maxItems)return!1;if(!h.items)return!0;for(let u=0;u<h.items.length;u++)if(!N(h.items[u],S,_[u]))return!1;return!0}function J(h,S,_){return(0,t.IsUndefined)(_)}function de(h,S,_){return h.anyOf.some(u=>N(u,S,_))}function l(h,S,_){return!(!(0,t.IsUint8Array)(_)||f(h.maxByteLength)&&!(_.length<=h.maxByteLength)||f(h.minByteLength)&&!(_.length>=h.minByteLength))}function w(h,S,_){return!0}function I(h,S,_){return r.TypeSystemPolicy.IsVoidLike(_)}function P(h,S,_){return s.TypeRegistry.Has(h[s.Kind])?s.TypeRegistry.Get(h[s.Kind])(h,_):!1}function N(h,S,_){let u=f(h.$id)?[...S,h]:S,A=h;switch(A[s.Kind]){case"Any":return c(A,u,_);case"Array":return y(A,u,_);case"AsyncIterator":return g(A,u,_);case"BigInt":return k(A,u,_);case"Boolean":return U(A,u,_);case"Constructor":return j(A,u,_);case"Date":return te(A,u,_);case"Function":return W(A,u,_);case"Integer":return B(A,u,_);case"Intersect":return z(A,u,_);case"Iterator":return Y(A,u,_);case"Literal":return ie(A,u,_);case"Never":return F(A,u,_);case"Not":return se(A,u,_);case"Null":return K(A,u,_);case"Number":return ye(A,u,_);case"Object":return D(A,u,_);case"Promise":return R(A,u,_);case"Record":return M(A,u,_);case"Ref":return ee(A,u,_);case"String":return Q(A,u,_);case"Symbol":return O(A,u,_);case"TemplateLiteral":return q(A,u,_);case"This":return ne(A,u,_);case"Tuple":return G(A,u,_);case"Undefined":return J(A,u,_);case"Union":return de(A,u,_);case"Uint8Array":return l(A,u,_);case"Unknown":return w(A,u,_);case"Void":return I(A,u,_);default:if(!s.TypeRegistry.Has(A[s.Kind]))throw new o(A);return P(A,u,_)}}function E(...h){return h.length===3?N(h[0],h[1],h[2]):N(h[0],[],h[1])}e.Check=E}}),Ag=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=An(),r=Lo(),n=Og(),i=Yt(),s=class extends i.TypeBoxError{constructor(k,U,j){super("Unable to decode due to invalid value"),this.schema=k,this.value=U,this.error=j}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(k,U,j){super("Unable to encode due to invalid value"),this.schema=k,this.value=U,this.error=j}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(k,U,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=k,this.value=U}};e.TransformDecodeError=a;var f=class extends i.TypeBoxError{constructor(k,U,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=k,this.value=U}};e.TransformEncodeError=f;var c;(function(k){function U(O,q){return i.TypeGuard.TTransform(O)||M(O.items,q)}function j(O,q){return i.TypeGuard.TTransform(O)||M(O.items,q)}function te(O,q){return i.TypeGuard.TTransform(O)||M(O.returns,q)||O.parameters.some(ne=>M(ne,q))}function W(O,q){return i.TypeGuard.TTransform(O)||M(O.returns,q)||O.parameters.some(ne=>M(ne,q))}function B(O,q){return i.TypeGuard.TTransform(O)||i.TypeGuard.TTransform(O.unevaluatedProperties)||O.allOf.some(ne=>M(ne,q))}function z(O,q){return i.TypeGuard.TTransform(O)||M(O.items,q)}function Y(O,q){return i.TypeGuard.TTransform(O)||M(O.not,q)}function ie(O,q){return i.TypeGuard.TTransform(O)||Object.values(O.properties).some(ne=>M(ne,q))||i.TypeGuard.TSchema(O.additionalProperties)&&M(O.additionalProperties,q)}function F(O,q){return i.TypeGuard.TTransform(O)||M(O.item,q)}function se(O,q){let ne=Object.getOwnPropertyNames(O.patternProperties)[0],G=O.patternProperties[ne];return i.TypeGuard.TTransform(O)||M(G,q)||i.TypeGuard.TSchema(O.additionalProperties)&&i.TypeGuard.TTransform(O.additionalProperties)}function K(O,q){return i.TypeGuard.TTransform(O)?!0:M((0,r.Deref)(O,q),q)}function ye(O,q){return i.TypeGuard.TTransform(O)?!0:M((0,r.Deref)(O,q),q)}function D(O,q){return i.TypeGuard.TTransform(O)||!(0,t.IsUndefined)(O.items)&&O.items.some(ne=>M(ne,q))}function R(O,q){return i.TypeGuard.TTransform(O)||O.anyOf.some(ne=>M(ne,q))}function M(O,q){let ne=(0,t.IsString)(O.$id)?[...q,O]:q,G=O;if(O.$id&&ee.has(O.$id))return!1;switch(O.$id&&ee.add(O.$id),O[i.Kind]){case"Array":return U(G,ne);case"AsyncIterator":return j(G,ne);case"Constructor":return te(G,ne);case"Function":return W(G,ne);case"Intersect":return B(G,ne);case"Iterator":return z(G,ne);case"Not":return Y(G,ne);case"Object":return ie(G,ne);case"Promise":return F(G,ne);case"Record":return se(G,ne);case"Ref":return K(G,ne);case"This":return ye(G,ne);case"Tuple":return D(G,ne);case"Union":return R(G,ne);default:return i.TypeGuard.TTransform(O)}}let ee=new Set;function Q(O,q){return ee.clear(),M(O,q)}k.Has=Q})(c||(e.HasTransform=c={}));var y;(function(k){function U(D,R){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Decode(R):R}catch(M){throw new a(D,R,M)}}function j(D,R,M){return(0,t.IsArray)(M)?U(D,M.map(ee=>K(D.items,R,ee))):U(D,M)}function te(D,R,M){if(!(0,t.IsPlainObject)(M)||(0,t.IsValueType)(M))return U(D,M);let ee=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(i.IndexedAccessor.Resolve(D,[J]),R,G[J])}:G,M);if(!i.TypeGuard.TTransform(D.unevaluatedProperties))return U(D,Q);let O=Object.getOwnPropertyNames(Q),q=D.unevaluatedProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:U(q,G[J])},Q);return U(D,ne)}function W(D,R,M){return U(D,K(D.not,R,M))}function B(D,R,M){if(!(0,t.IsPlainObject)(M))return U(D,M);let ee=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(D.properties[J],R,G[J])}:G,M);if(!i.TypeGuard.TSchema(D.additionalProperties))return U(D,Q);let O=Object.getOwnPropertyNames(Q),q=D.additionalProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:U(q,G[J])},Q);return U(D,ne)}function z(D,R,M){if(!(0,t.IsPlainObject)(M))return U(D,M);let ee=Object.getOwnPropertyNames(D.patternProperties)[0],Q=new RegExp(ee),O=Object.getOwnPropertyNames(M).reduce((J,de)=>Q.test(de)?{...J,[de]:K(D.patternProperties[ee],R,J[de])}:J,M);if(!i.TypeGuard.TSchema(D.additionalProperties))return U(D,O);let q=Object.getOwnPropertyNames(O),ne=D.additionalProperties,G=q.reduce((J,de)=>Q.test(de)?J:{...J,[de]:U(ne,J[de])},O);return U(D,G)}function Y(D,R,M){let ee=(0,r.Deref)(D,R);return U(D,K(ee,R,M))}function ie(D,R,M){let ee=(0,r.Deref)(D,R);return U(D,K(ee,R,M))}function F(D,R,M){return(0,t.IsArray)(M)&&(0,t.IsArray)(D.items)?U(D,D.items.map((ee,Q)=>K(ee,R,M[Q]))):U(D,M)}function se(D,R,M){let ee=U(D,M);for(let Q of D.anyOf)if((0,n.Check)(Q,R,ee))return K(Q,R,ee);return ee}function K(D,R,M){let ee=typeof D.$id=="string"?[...R,D]:R,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,M);case"Intersect":return te(Q,ee,M);case"Not":return W(Q,ee,M);case"Object":return B(Q,ee,M);case"Record":return z(Q,ee,M);case"Ref":return Y(Q,ee,M);case"Symbol":return U(Q,M);case"This":return ie(Q,ee,M);case"Tuple":return F(Q,ee,M);case"Union":return se(Q,ee,M);default:return U(Q,M)}}function ye(D,R,M){return K(D,R,M)}k.Decode=ye})(y||(e.DecodeTransform=y={}));var g;(function(k){function U(D,R){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Encode(R):R}catch(M){throw new f(D,R,M)}}function j(D,R,M){let ee=U(D,M);return(0,t.IsArray)(ee)?ee.map(Q=>K(D.items,R,Q)):ee}function te(D,R,M){let ee=U(D,M);if(!(0,t.IsPlainObject)(M)||(0,t.IsValueType)(M))return ee;let Q=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),O=Q.reduce((G,J)=>J in ee?{...G,[J]:K(i.IndexedAccessor.Resolve(D,[J]),R,G[J])}:G,ee);if(!i.TypeGuard.TTransform(D.unevaluatedProperties))return U(D,O);let q=Object.getOwnPropertyNames(O),ne=D.unevaluatedProperties;return q.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:U(ne,G[J])},O)}function W(D,R,M){return U(D.not,U(D,M))}function B(D,R,M){let ee=U(D,M);if(!(0,t.IsPlainObject)(M))return ee;let Q=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),O=Q.reduce((G,J)=>J in G?{...G,[J]:K(D.properties[J],R,G[J])}:G,ee);if(!i.TypeGuard.TSchema(D.additionalProperties))return O;let q=Object.getOwnPropertyNames(O),ne=D.additionalProperties;return q.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:U(ne,G[J])},O)}function z(D,R,M){let ee=U(D,M);if(!(0,t.IsPlainObject)(M))return ee;let Q=Object.getOwnPropertyNames(D.patternProperties)[0],O=new RegExp(Q),q=Object.getOwnPropertyNames(M).reduce((J,de)=>O.test(de)?{...J,[de]:K(D.patternProperties[Q],R,J[de])}:J,ee);if(!i.TypeGuard.TSchema(D.additionalProperties))return U(D,q);let ne=Object.getOwnPropertyNames(q),G=D.additionalProperties;return ne.reduce((J,de)=>O.test(de)?J:{...J,[de]:U(G,J[de])},q)}function Y(D,R,M){let ee=(0,r.Deref)(D,R),Q=K(ee,R,M);return U(D,Q)}function ie(D,R,M){let ee=(0,r.Deref)(D,R),Q=K(ee,R,M);return U(D,Q)}function F(D,R,M){let ee=U(D,M);return(0,t.IsArray)(D.items)?D.items.map((Q,O)=>K(Q,R,ee[O])):[]}function se(D,R,M){for(let ee of D.anyOf){if(!(0,n.Check)(ee,R,M))continue;let Q=K(ee,R,M);return U(D,Q)}for(let ee of D.anyOf){let Q=K(ee,R,M);if((0,n.Check)(D,R,Q))return U(D,Q)}return U(D,M)}function K(D,R,M){let ee=typeof D.$id=="string"?[...R,D]:R,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,M);case"Intersect":return te(Q,ee,M);case"Not":return W(Q,ee,M);case"Object":return B(Q,ee,M);case"Record":return z(Q,ee,M);case"Ref":return Y(Q,ee,M);case"This":return ie(Q,ee,M);case"Tuple":return F(Q,ee,M);case"Union":return se(Q,ee,M);default:return U(Q,M)}}function ye(D,R,M){return K(D,R,M)}k.Encode=ye})(g||(e.EncodeTransform=g={}))}}),Ig=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=Ag(),r=An(),n=Fo(),i=bl(),s=Lo(),o=Ca(),a=Yt(),f=class{constructor(B,z,Y,ie){this.schema=B,this.references=z,this.checkFunc=Y,this.code=ie,this.hasTransform=t.HasTransform.Has(B,z)}Code(){return this.code}Errors(B){return(0,n.Errors)(this.schema,this.references,B)}Check(B){return this.checkFunc(B)}Decode(B){if(!this.checkFunc(B))throw new t.TransformDecodeCheckError(this.schema,B,this.Errors(B).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,B):B}Encode(B){let z=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,B):B;if(!this.checkFunc(z))throw new t.TransformEncodeCheckError(this.schema,B,this.Errors(B).First());return z}};e.TypeCheck=f;var c;(function(B){function z(se){return se===36}B.DollarSign=z;function Y(se){return se===95}B.IsUnderscore=Y;function ie(se){return se>=65&&se<=90||se>=97&&se<=122}B.IsAlpha=ie;function F(se){return se>=48&&se<=57}B.IsNumeric=F})(c||(c={}));var y;(function(B){function z(se){return se.length===0?!1:c.IsNumeric(se.charCodeAt(0))}function Y(se){if(z(se))return!1;for(let K=0;K<se.length;K++){let ye=se.charCodeAt(K);if(!(c.IsAlpha(ye)||c.IsNumeric(ye)||c.DollarSign(ye)||c.IsUnderscore(ye)))return!1}return!0}function ie(se){return se.replace(/'/g,"\\'")}function F(se,K){return Y(K)?`${se}.${K}`:`${se}['${ie(K)}']`}B.Encode=F})(y||(y={}));var g;(function(B){function z(Y){let ie=[];for(let F=0;F<Y.length;F++){let se=Y.charCodeAt(F);c.IsNumeric(se)||c.IsAlpha(se)?ie.push(Y.charAt(F)):ie.push(`_${se}_`)}return ie.join("").replace(/__/g,"_")}B.Encode=z})(g||(g={}));var k;(function(B){function z(Y){return Y.replace(/'/g,"\\'")}B.Escape=z})(k||(k={}));var U=class extends a.TypeBoxError{constructor(B){super("Unknown type"),this.schema=B}};e.TypeCompilerUnknownTypeError=U;var j=class extends a.TypeBoxError{constructor(B){super("Preflight validation check failed to guard for the given schema"),this.schema=B}};e.TypeCompilerTypeGuardError=j;var te;(function(B){function z(K,ye,D){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${ye}' in ${K} ? ${D} : true)`:`(${y.Encode(K,ye)} !== undefined ? ${D} : true)`}B.IsExactOptionalProperty=z;function Y(K){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${K} === 'object' && ${K} !== null)`:`(typeof ${K} === 'object' && ${K} !== null && !Array.isArray(${K}))`}B.IsObjectLike=Y;function ie(K){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${K} === 'object' && ${K} !== null && !(${K} instanceof Date) && !(${K} instanceof Uint8Array))`:`(typeof ${K} === 'object' && ${K} !== null && !Array.isArray(${K}) && !(${K} instanceof Date) && !(${K} instanceof Uint8Array))`}B.IsRecordLike=ie;function F(K){return i.TypeSystemPolicy.AllowNaN?`typeof ${K} === 'number'`:`(typeof ${K} === 'number' && Number.isFinite(${K}))`}B.IsNumberLike=F;function se(K){return i.TypeSystemPolicy.AllowNullVoid?`(${K} === undefined || ${K} === null)`:`${K} === undefined`}B.IsVoidLike=se})(te||(e.Policy=te={}));var W;(function(B){function z(T){return T[a.Kind]==="Any"||T[a.Kind]==="Unknown"}function*Y(T,le,x){yield"true"}function*ie(T,le,x){yield`Array.isArray(${x})`;let[ge,oe]=[je("value","any"),je("acc","number")];(0,r.IsNumber)(T.maxItems)&&(yield`${x}.length <= ${T.maxItems}`),(0,r.IsNumber)(T.minItems)&&(yield`${x}.length >= ${T.minItems}`);let pe=re(T.items,le,"value");if(yield`${x}.every((${ge}) => ${pe})`,a.TypeGuard.TSchema(T.contains)||(0,r.IsNumber)(T.minContains)||(0,r.IsNumber)(T.maxContains)){let Ee=a.TypeGuard.TSchema(T.contains)?T.contains:a.Type.Never(),Me=re(Ee,le,"value"),Xe=(0,r.IsNumber)(T.minContains)?[`(count >= ${T.minContains})`]:[],We=(0,r.IsNumber)(T.maxContains)?[`(count <= ${T.maxContains})`]:[],Ze=`const count = value.reduce((${oe}, ${ge}) => ${Me} ? acc + 1 : acc, 0)`,Jt=["(count > 0)",...Xe,...We].join(" && ");yield`((${ge}) => { ${Ze}; return ${Jt}})(${x})`}T.uniqueItems===!0&&(yield`((${ge}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${x})`)}function*F(T,le,x){yield`(typeof value === 'object' && Symbol.asyncIterator in ${x})`}function*se(T,le,x){yield`(typeof ${x} === 'bigint')`,(0,r.IsBigInt)(T.exclusiveMaximum)&&(yield`${x} < BigInt(${T.exclusiveMaximum})`),(0,r.IsBigInt)(T.exclusiveMinimum)&&(yield`${x} > BigInt(${T.exclusiveMinimum})`),(0,r.IsBigInt)(T.maximum)&&(yield`${x} <= BigInt(${T.maximum})`),(0,r.IsBigInt)(T.minimum)&&(yield`${x} >= BigInt(${T.minimum})`),(0,r.IsBigInt)(T.multipleOf)&&(yield`(${x} % BigInt(${T.multipleOf})) === 0`)}function*K(T,le,x){yield`(typeof ${x} === 'boolean')`}function*ye(T,le,x){yield*V(T.returns,le,`${x}.prototype`)}function*D(T,le,x){yield`(${x} instanceof Date) && Number.isFinite(${x}.getTime())`,(0,r.IsNumber)(T.exclusiveMaximumTimestamp)&&(yield`${x}.getTime() < ${T.exclusiveMaximumTimestamp}`),(0,r.IsNumber)(T.exclusiveMinimumTimestamp)&&(yield`${x}.getTime() > ${T.exclusiveMinimumTimestamp}`),(0,r.IsNumber)(T.maximumTimestamp)&&(yield`${x}.getTime() <= ${T.maximumTimestamp}`),(0,r.IsNumber)(T.minimumTimestamp)&&(yield`${x}.getTime() >= ${T.minimumTimestamp}`),(0,r.IsNumber)(T.multipleOfTimestamp)&&(yield`(${x}.getTime() % ${T.multipleOfTimestamp}) === 0`)}function*R(T,le,x){yield`(typeof ${x} === 'function')`}function*M(T,le,x){yield`(typeof ${x} === 'number' && Number.isInteger(${x}))`,(0,r.IsNumber)(T.exclusiveMaximum)&&(yield`${x} < ${T.exclusiveMaximum}`),(0,r.IsNumber)(T.exclusiveMinimum)&&(yield`${x} > ${T.exclusiveMinimum}`),(0,r.IsNumber)(T.maximum)&&(yield`${x} <= ${T.maximum}`),(0,r.IsNumber)(T.minimum)&&(yield`${x} >= ${T.minimum}`),(0,r.IsNumber)(T.multipleOf)&&(yield`(${x} % ${T.multipleOf}) === 0`)}function*ee(T,le,x){let ge=T.allOf.map(oe=>re(oe,le,x)).join(" && ");if(T.unevaluatedProperties===!1){let oe=_e(`${new RegExp(a.KeyResolver.ResolvePattern(T))};`),pe=`Object.getOwnPropertyNames(${x}).every(key => ${oe}.test(key))`;yield`(${ge} && ${pe})`}else if(a.TypeGuard.TSchema(T.unevaluatedProperties)){let oe=_e(`${new RegExp(a.KeyResolver.ResolvePattern(T))};`),pe=`Object.getOwnPropertyNames(${x}).every(key => ${oe}.test(key) || ${re(T.unevaluatedProperties,le,`${x}[key]`)})`;yield`(${ge} && ${pe})`}else yield`(${ge})`}function*Q(T,le,x){yield`(typeof value === 'object' && Symbol.iterator in ${x})`}function*O(T,le,x){typeof T.const=="number"||typeof T.const=="boolean"?yield`(${x} === ${T.const})`:yield`(${x} === '${k.Escape(T.const)}')`}function*q(T,le,x){yield"false"}function*ne(T,le,x){yield`(!${re(T.not,le,x)})`}function*G(T,le,x){yield`(${x} === null)`}function*J(T,le,x){yield te.IsNumberLike(x),(0,r.IsNumber)(T.exclusiveMaximum)&&(yield`${x} < ${T.exclusiveMaximum}`),(0,r.IsNumber)(T.exclusiveMinimum)&&(yield`${x} > ${T.exclusiveMinimum}`),(0,r.IsNumber)(T.maximum)&&(yield`${x} <= ${T.maximum}`),(0,r.IsNumber)(T.minimum)&&(yield`${x} >= ${T.minimum}`),(0,r.IsNumber)(T.multipleOf)&&(yield`(${x} % ${T.multipleOf}) === 0`)}function*de(T,le,x){yield te.IsObjectLike(x),(0,r.IsNumber)(T.minProperties)&&(yield`Object.getOwnPropertyNames(${x}).length >= ${T.minProperties}`),(0,r.IsNumber)(T.maxProperties)&&(yield`Object.getOwnPropertyNames(${x}).length <= ${T.maxProperties}`);let ge=Object.getOwnPropertyNames(T.properties);for(let oe of ge){let pe=y.Encode(x,oe),Ee=T.properties[oe];if(T.required&&T.required.includes(oe))yield*V(Ee,le,pe),(a.ExtendsUndefined.Check(Ee)||z(Ee))&&(yield`('${oe}' in ${x})`);else{let Me=re(Ee,le,pe);yield te.IsExactOptionalProperty(x,oe,Me)}}if(T.additionalProperties===!1)if(T.required&&T.required.length===ge.length)yield`Object.getOwnPropertyNames(${x}).length === ${ge.length}`;else{let oe=`[${ge.map(pe=>`'${pe}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${x}).every(key => ${oe}.includes(key))`}if(typeof T.additionalProperties=="object"){let oe=re(T.additionalProperties,le,`${x}[key]`),pe=`[${ge.map(Ee=>`'${Ee}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${x}).every(key => ${pe}.includes(key) || ${oe}))`}}function*l(T,le,x){yield`(typeof value === 'object' && typeof ${x}.then === 'function')`}function*w(T,le,x){yield te.IsRecordLike(x),(0,r.IsNumber)(T.minProperties)&&(yield`Object.getOwnPropertyNames(${x}).length >= ${T.minProperties}`),(0,r.IsNumber)(T.maxProperties)&&(yield`Object.getOwnPropertyNames(${x}).length <= ${T.maxProperties}`);let[ge,oe]=Object.entries(T.patternProperties)[0],pe=_e(`${new RegExp(ge)}`),Ee=re(oe,le,"value"),Me=a.TypeGuard.TSchema(T.additionalProperties)?re(T.additionalProperties,le,x):T.additionalProperties===!1?"false":"true",Xe=`(${pe}.test(key) ? ${Ee} : ${Me})`;yield`(Object.entries(${x}).every(([key, value]) => ${Xe}))`}function*I(T,le,x){let ge=(0,s.Deref)(T,le);if(X.functions.has(T.$ref))return yield`${me(T.$ref)}(${x})`;yield*V(ge,le,x)}function*P(T,le,x){yield`(typeof ${x} === 'string')`,(0,r.IsNumber)(T.maxLength)&&(yield`${x}.length <= ${T.maxLength}`),(0,r.IsNumber)(T.minLength)&&(yield`${x}.length >= ${T.minLength}`),T.pattern!==void 0&&(yield`${_e(`${new RegExp(T.pattern)};`)}.test(${x})`),T.format!==void 0&&(yield`format('${T.format}', ${x})`)}function*N(T,le,x){yield`(typeof ${x} === 'symbol')`}function*E(T,le,x){yield`(typeof ${x} === 'string')`,yield`${_e(`${new RegExp(T.pattern)};`)}.test(${x})`}function*h(T,le,x){yield`${me(T.$ref)}(${x})`}function*S(T,le,x){if(yield`Array.isArray(${x})`,T.items===void 0)return yield`${x}.length === 0`;yield`(${x}.length === ${T.maxItems})`;for(let ge=0;ge<T.items.length;ge++)yield`${re(T.items[ge],le,`${x}[${ge}]`)}`}function*_(T,le,x){yield`${x} === undefined`}function*u(T,le,x){yield`(${T.anyOf.map(oe=>re(oe,le,x)).join(" || ")})`}function*A(T,le,x){yield`${x} instanceof Uint8Array`,(0,r.IsNumber)(T.maxByteLength)&&(yield`(${x}.length <= ${T.maxByteLength})`),(0,r.IsNumber)(T.minByteLength)&&(yield`(${x}.length >= ${T.minByteLength})`)}function*v(T,le,x){yield"true"}function*b(T,le,x){yield te.IsVoidLike(x)}function*$(T,le,x){let ge=X.instances.size;X.instances.set(ge,T),yield`kind('${T[a.Kind]}', ${ge}, ${x})`}function*V(T,le,x,ge=!0){let oe=(0,r.IsString)(T.$id)?[...le,T]:le,pe=T;if(ge&&(0,r.IsString)(T.$id)){let Ee=me(T.$id);if(X.functions.has(Ee))return yield`${Ee}(${x})`;{let Me=Pe(Ee,T,le,"value",!1);return X.functions.set(Ee,Me),yield`${Ee}(${x})`}}switch(pe[a.Kind]){case"Any":return yield*Y(pe,oe,x);case"Array":return yield*ie(pe,oe,x);case"AsyncIterator":return yield*F(pe,oe,x);case"BigInt":return yield*se(pe,oe,x);case"Boolean":return yield*K(pe,oe,x);case"Constructor":return yield*ye(pe,oe,x);case"Date":return yield*D(pe,oe,x);case"Function":return yield*R(pe,oe,x);case"Integer":return yield*M(pe,oe,x);case"Intersect":return yield*ee(pe,oe,x);case"Iterator":return yield*Q(pe,oe,x);case"Literal":return yield*O(pe,oe,x);case"Never":return yield*q(pe,oe,x);case"Not":return yield*ne(pe,oe,x);case"Null":return yield*G(pe,oe,x);case"Number":return yield*J(pe,oe,x);case"Object":return yield*de(pe,oe,x);case"Promise":return yield*l(pe,oe,x);case"Record":return yield*w(pe,oe,x);case"Ref":return yield*I(pe,oe,x);case"String":return yield*P(pe,oe,x);case"Symbol":return yield*N(pe,oe,x);case"TemplateLiteral":return yield*E(pe,oe,x);case"This":return yield*h(pe,oe,x);case"Tuple":return yield*S(pe,oe,x);case"Undefined":return yield*_(pe,oe,x);case"Union":return yield*u(pe,oe,x);case"Uint8Array":return yield*A(pe,oe,x);case"Unknown":return yield*v(pe,oe,x);case"Void":return yield*b(pe,oe,x);default:if(!a.TypeRegistry.Has(pe[a.Kind]))throw new U(T);return yield*$(pe,oe,x)}}let X={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function re(T,le,x,ge=!0){return`(${[...V(T,le,x,ge)].join(" && ")})`}function me(T){return`check_${g.Encode(T)}`}function _e(T){let le=`local_${X.variables.size}`;return X.variables.set(le,`const ${le} = ${T}`),le}function Pe(T,le,x,ge,oe=!0){let[pe,Ee]=[`
21
+ `,Ze=>"".padStart(Ze," ")],Me=je("value","any"),Xe=Er("boolean"),We=[...V(le,x,ge,oe)].map(Ze=>`${Ee(4)}${Ze}`).join(` &&${pe}`);return`function ${T}(${Me})${Xe} {${pe}${Ee(2)}return (${pe}${We}${pe}${Ee(2)})
22
+ }`}function je(T,le){let x=X.language==="typescript"?`: ${le}`:"";return`${T}${x}`}function Er(T){return X.language==="typescript"?`: ${T}`:""}function we(T,le,x){let ge=Pe("check",T,le,"value"),oe=je("value","any"),pe=Er("boolean"),Ee=[...X.functions.values()],Me=[...X.variables.values()],Xe=(0,r.IsString)(T.$id)?`return function check(${oe})${pe} {
23
+ return ${me(T.$id)}(value)
24
+ }`:`return ${ge}`;return[...Me,...Ee,Xe].join(`
25
+ `)}function ir(...T){let le={language:"javascript"},[x,ge,oe]=T.length===2&&(0,r.IsArray)(T[1])?[T[0],T[1],le]:T.length===2&&!(0,r.IsArray)(T[1])?[T[0],[],T[1]]:T.length===3?[T[0],T[1],T[2]]:T.length===1?[T[0],[],le]:[null,[],le];if(X.language=oe.language,X.variables.clear(),X.functions.clear(),X.instances.clear(),!a.TypeGuard.TSchema(x))throw new j(x);for(let pe of ge)if(!a.TypeGuard.TSchema(pe))throw new j(pe);return we(x,ge,oe)}B.Code=ir;function Sr(T,le=[]){let x=ir(T,le,{language:"javascript"}),ge=globalThis.Function("kind","format","hash",x),oe=new Map(X.instances);function pe(We,Ze,Jt){if(!a.TypeRegistry.Has(We)||!oe.has(Ze))return!1;let rn=a.TypeRegistry.Get(We),nn=oe.get(Ze);return rn(nn,Jt)}function Ee(We,Ze){return a.FormatRegistry.Has(We)?a.FormatRegistry.Get(We)(Ze):!1}function Me(We){return(0,o.Hash)(We)}let Xe=ge(pe,Ee,Me);return new f(T,le,Xe,x)}B.Compile=Sr})(W||(e.TypeCompiler=W={}))}}),Eg=Le({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,f)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var n=Tg();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(Ig(),e)}}),Sg={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,r){return"Cannot apply '"+t+"' to '"+r.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,r){return"[mobx.array] Index out of bounds, "+t+" is larger than "+r},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,r){return"the entry '"+t+"' does not exist in the observable map '"+r+"'"},26:"please specify a property",27:function(t,r){return"no observable property '"+t.toString()+"' found on the observable object '"+r+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,r){return"Cycle detected in computation "+t+": "+r},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},xg=Sg;function fe(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=typeof e=="string"?e:xg[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Ng={};function Pa(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Ng}var vl=Object.assign,Ao=Object.getOwnPropertyDescriptor,Kt=Object.defineProperty,mi=Object.prototype,Io=[];Object.freeze(Io);var Ua={};Object.freeze(Ua);var $g=typeof Proxy<"u",Cg=Object.toString();function _l(){$g||fe("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function ri(e){H.verifyProxies&&fe("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function Et(){return++H.mobxGuid}function Ra(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var bn=function(){};function De(e){return typeof e=="function"}function Vr(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Vo(e){return e!==null&&typeof e=="object"}function Mt(e){if(!Vo(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===Cg}function wl(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Ko(e,t,r){Kt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Tl(e,t,r){Kt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Ar(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Vo(n)&&n[r]===!0}}function In(e){return e instanceof Map}function gi(e){return e instanceof Set}var Ol=typeof Object.getOwnPropertySymbols<"u";function Pg(e){var t=Object.keys(e);if(!Ol)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return mi.propertyIsEnumerable.call(e,n)})):t}var zo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Ol?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function la(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Al(e){return e===null?null:typeof e=="object"?""+e:e}function At(e,t){return mi.hasOwnProperty.call(e,t)}var Ug=Object.getOwnPropertyDescriptors||function(t){var r={};return zo(t).forEach(function(n){r[n]=Ao(t,n)}),r};function Af(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kg(n.key),n)}}function Ba(e,t,r){return t&&Af(e.prototype,t),r&&Af(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tr(){return tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tr.apply(this,arguments)}function Il(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,da(e,t)}function da(e,t){return da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},da(e,t)}function bo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rg(e,t){if(e){if(typeof e=="string")return If(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return If(e,t)}}function If(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Rg(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bg(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kg(e){var t=Bg(e,"string");return typeof t=="symbol"?t:String(t)}var tt=Symbol("mobx-stored-annotations");function zt(e){function t(r,n){if(bi(n))return e.decorate_20223_(r,n);En(r,n,e)}return Object.assign(t,e)}function En(e,t,r){if(At(e,tt)||Ko(e,tt,tr({},e[tt])),Eo(r)&&!At(e[tt],t)){var n=e.constructor.name+".prototype."+t.toString();fe("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}Mg(e,r,t),Eo(r)||(e[tt][t]=r)}function Mg(e,t,r){if(!Eo(t)&&At(e[tt],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[tt][r].annotationType_,s=t.annotationType_;fe("Cannot apply '@"+s+"' to '"+n+"':"+(`
27
+ The field is already decorated with '@`+i+"'.")+`
28
+ Re-decorating fields is not allowed.
29
+ Use '@override' decorator for methods overridden by subclass.`)}}function Dg(e){return At(e,tt)||Ko(e,tt,tr({},e[tt])),e[tt]}function bi(e){return typeof e=="object"&&typeof e.kind=="string"}function qo(e,t){t.includes(e.kind)||fe("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var be=Symbol("mobx administration"),vi=function(){function e(r){r===void 0&&(r="Atom@"+Et()),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ie.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return Kl(this)},t.reportChanged=function(){wt(),zl(this),Tt()},t.toString=function(){return this.name_},e}(),ka=Ar("Atom",vi);function El(e,t,r){t===void 0&&(t=bn),r===void 0&&(r=bn);var n=new vi(e);return t!==bn&&Ql(n,t),r!==bn&&Ti(n,r),n}function jg(e,t){return e===t}function Lg(e,t){return Ka(e,t)}function Fg(e,t){return Ka(e,t,1)}function Vg(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var rt={identity:jg,structural:Lg,default:Vg,shallow:Fg};function Kr(e,t,r){return Tn(e)?e:Array.isArray(e)?ke.array(e,{name:r}):Mt(e)?ke.object(e,void 0,{name:r}):In(e)?ke.map(e,{name:r}):gi(e)?ke.set(e,{name:r}):typeof e=="function"&&!Sn(e)&&!ci(e)?wl(e)?wn(e):ui(r,e):e}function Kg(e,t,r){if(e==null||Hr(e)||Nn(e)||Wt(e)||Yr(e))return e;if(Array.isArray(e))return ke.array(e,{name:r,deep:!1});if(Mt(e))return ke.object(e,void 0,{name:r,deep:!1});if(In(e))return ke.map(e,{name:r,deep:!1});if(gi(e))return ke.set(e,{name:r,deep:!1});fe("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function Go(e){return e}function zg(e,t){return Tn(e)&&fe("observable.struct should not be used with observable values"),Ka(e,t)?t:e}var qg="override";function Eo(e){return e.annotationType_===qg}function _i(e,t){return{annotationType_:e,options_:t,make_:Gg,extend_:Hg,decorate_20223_:Wg}}function Gg(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(Sn(r.value))return 1;var s=Sl(e,this,t,r,!1);return Kt(n,t,s),2}function Hg(e,t,r,n){var i=Sl(e,this,t,r);return e.defineProperty_(t,i,n)}function Wg(e,t){qo(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,s=this,o=function(c){var y,g,k,U;return zr((y=(g=s.options_)==null?void 0:g.name)!=null?y:n.toString(),c,(k=(U=s.options_)==null?void 0:U.autoAction)!=null?k:!1)};if(r=="field"){i(function(){En(this,n,s)});return}if(r=="method"){var a;return Sn(e)||(e=o(e)),(a=this.options_)!=null&&a.bound&&i(function(){var f=this,c=f[n].bind(f);c.isMobxAction=!0,f[n]=c}),e}fe("Cannot apply '"+s.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
30
+ '`+s.annotationType_+"' can only be used on properties with a function value."))}function Jg(e,t,r,n){var i=t.annotationType_,s=n.value;De(s)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
31
+ '`+i+"' can only be used on properties with a function value."))}function Sl(e,t,r,n,i){var s,o,a,f,c,y,g;i===void 0&&(i=H.safeDescriptors),Jg(e,t,r,n);var k=n.value;if((s=t.options_)!=null&&s.bound){var U;k=k.bind((U=e.proxy_)!=null?U:e.target_)}return{value:zr((o=(a=t.options_)==null?void 0:a.name)!=null?o:r.toString(),k,(f=(c=t.options_)==null?void 0:c.autoAction)!=null?f:!1,(y=t.options_)!=null&&y.bound?(g=e.proxy_)!=null?g:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function xl(e,t){return{annotationType_:e,options_:t,make_:Xg,extend_:Yg,decorate_20223_:Qg}}function Xg(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!At(e.target_,t)||!ci(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(ci(r.value))return 1;var s=Nl(e,this,t,r,!1,!1);return Kt(n,t,s),2}function Yg(e,t,r,n){var i,s=Nl(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,s,n)}function Qg(e,t){var r;qo(t,["method"]);var n=t.name,i=t.addInitializer;return ci(e)||(e=wn(e)),(r=this.options_)!=null&&r.bound&&i(function(){var s=this,o=s[n].bind(s);o.isMobXFlow=!0,s[n]=o}),e}function Zg(e,t,r,n){var i=t.annotationType_,s=n.value;De(s)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
32
+ '`+i+"' can only be used on properties with a generator function value."))}function Nl(e,t,r,n,i,s){s===void 0&&(s=H.safeDescriptors),Zg(e,t,r,n);var o=n.value;if(ci(o)||(o=wn(o)),i){var a;o=o.bind((a=e.proxy_)!=null?a:e.target_),o.isMobXFlow=!0}return{value:o,configurable:s?e.isPlainObject_:!0,enumerable:!1,writable:!s}}function Ma(e,t){return{annotationType_:e,options_:t,make_:eb,extend_:tb,decorate_20223_:rb}}function eb(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function tb(e,t,r,n){return nb(e,this,t,r),e.defineComputedProperty_(t,tr({},this.options_,{get:r.get,set:r.set}),n)}function rb(e,t){qo(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var s=$n(this)[be],o=tr({},r.options_,{get:e,context:this});o.name||(o.name=s.name_+"."+n.toString()),s.values_.set(n,new qr(o))}),function(){return this[be].getObservablePropValue_(n)}}function nb(e,t,r,n){var i=t.annotationType_,s=n.get;s||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
33
+ '`+i+"' can only be used on getter(+setter) properties."))}function Ho(e,t){return{annotationType_:e,options_:t,make_:ib,extend_:ob,decorate_20223_:sb}}function ib(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function ob(e,t,r,n){var i,s;return ab(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:Kr,n)}function sb(e,t){if(t.kind==="field")throw fe("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");qo(t,["accessor"]);var r=this,n=t.kind,i=t.name,s=new WeakSet;function o(a,f){var c,y,g=$n(a)[be],k=new _r(f,(c=(y=r.options_)==null?void 0:y.enhancer)!=null?c:Kr,g.name_+"."+i.toString(),!1);g.values_.set(i,k),s.add(a)}if(n=="accessor")return{get:function(){return s.has(this)||o(this,e.get.call(this)),this[be].getObservablePropValue_(i)},set:function(f){return s.has(this)||o(this,f),this[be].setObservablePropValue_(i,f)},init:function(f){return s.has(this)||o(this,f),f}}}function ab(e,t,r,n){var i=t.annotationType_;"value"in n||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
34
+ '`+i+"' cannot be used on getter/setter properties"))}var ub="true",cb=$l();function $l(e){return{annotationType_:ub,options_:e,make_:fb,extend_:lb,decorate_20223_:db}}function fb(e,t,r,n){var i,s;if(r.get)return Ge.make_(e,t,r,n);if(r.set){var o=zr(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:H.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Kt(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(wl(r.value)){var f,c=(f=this.options_)!=null&&f.autoBind?wn.bound:wn;return c.make_(e,t,r,n)}var y=(a=this.options_)!=null&&a.autoBind?ui.bound:ui;return y.make_(e,t,r,n)}var g=((i=this.options_)==null?void 0:i.deep)===!1?ke.ref:ke;if(typeof r.value=="function"&&(s=this.options_)!=null&&s.autoBind){var k;r.value=r.value.bind((k=e.proxy_)!=null?k:e.target_)}return g.make_(e,t,r,n)}function lb(e,t,r,n){var i,s;if(r.get)return Ge.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:H.safeDescriptors?e.isPlainObject_:!0,set:zr(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var a=((s=this.options_)==null?void 0:s.deep)===!1?ke.ref:ke;return a.extend_(e,t,r,n)}function db(e,t){fe("'"+this.annotationType_+"' cannot be used as a decorator")}var pb="observable",yb="observable.ref",hb="observable.shallow",mb="observable.struct",Cl={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Cl);function po(e){return e||Cl}var pa=Ho(pb),gb=Ho(yb,{enhancer:Go}),bb=Ho(hb,{enhancer:Kg}),vb=Ho(mb,{enhancer:zg}),Pl=zt(pa);function yo(e){return e.deep===!0?Kr:e.deep===!1?Go:wb(e.defaultDecorator)}function _b(e){var t;return e?(t=e.defaultDecorator)!=null?t:$l(e):void 0}function wb(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Kr}function Ul(e,t,r){if(bi(t))return pa.decorate_20223_(e,t);if(Vr(t)){En(e,t,pa);return}return Tn(e)?e:Mt(e)?ke.object(e,t,r):Array.isArray(e)?ke.array(e,t):In(e)?ke.map(e,t):gi(e)?ke.set(e,t):typeof e=="object"&&e!==null?e:ke.box(e,t)}vl(Ul,Pl);var Tb={box:function(t,r){var n=po(r);return new _r(t,yo(n),n.name,!0,n.equals)},array:function(t,r){var n=po(r);return(H.useProxies===!1||n.proxy===!1?Iv:hv)(t,yo(n),n.name)},map:function(t,r){var n=po(r);return new sd(t,yo(n),n.name)},set:function(t,r){var n=po(r);return new cd(t,yo(n),n.name)},object:function(t,r,n){return Qr(function(){return iv(H.useProxies===!1||n?.proxy===!1?$n({},n):dv({},n),t,r)})},ref:zt(gb),shallow:zt(bb),deep:Pl,struct:zt(vb)},ke=vl(Ul,Tb),Rl="computed",Ob="computed.struct",ya=Ma(Rl),Ab=Ma(Ob,{equals:rt.structural}),Ge=function(t,r){if(bi(r))return ya.decorate_20223_(t,r);if(Vr(r))return En(t,r,ya);if(Mt(t))return zt(Ma(Rl,t));De(t)||fe("First argument to `computed` should be an expression."),De(r)&&fe("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var n=Mt(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new qr(n)};Object.assign(Ge,ya);Ge.struct=zt(Ab);var Ef,Sf,So=0,Ib=1,Eb=(Ef=(Sf=Ao(function(){},"name"))==null?void 0:Sf.configurable)!=null?Ef:!1,xf={value:"action",configurable:!0,writable:!1,enumerable:!1};function zr(e,t,r,n){r===void 0&&(r=!1),De(t)||fe("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&fe("actions should have valid names, got: '"+e+"'");function i(){return Bl(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Eb&&(xf.value=e,Kt(i,"name",xf)),i}function Bl(e,t,r,n,i){var s=Sb(e,t,n,i);try{return r.apply(n,i)}catch(o){throw s.error_=o,o}finally{xb(s)}}function Sb(e,t,r,n){var i=He()&&!!e,s=0;if(i){s=Date.now();var o=n?Array.from(n):Io;lt({type:ja,name:e,object:r,arguments:o})}var a=H.trackingDerivation,f=!t||!a;wt();var c=H.allowStateChanges;f&&(Xr(),c=Wo(!0));var y=Da(!0),g={runAsAction_:f,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:y,notifySpy_:i,startTime_:s,actionId_:Ib++,parentActionId_:So};return So=g.actionId_,g}function xb(e){So!==e.actionId_&&fe(30),So=e.parentActionId_,e.error_!==void 0&&(H.suppressReactionErrors=!0),Jo(e.prevAllowStateChanges_),ii(e.prevAllowStateReads_),Tt(),e.runAsAction_&&er(e.prevDerivation_),e.notifySpy_&&dt({time:Date.now()-e.startTime_}),H.suppressReactionErrors=!1}function Nb(e,t){var r=Wo(e);try{return t()}finally{Jo(r)}}function Wo(e){var t=H.allowStateChanges;return H.allowStateChanges=e,t}function Jo(e){H.allowStateChanges=e}var kl,$b="create";kl=Symbol.toPrimitive;var _r=function(e){Il(t,e);function t(n,i,s,o,a){var f;return s===void 0&&(s="ObservableValue@"+Et()),o===void 0&&(o=!0),a===void 0&&(a=rt.default),f=e.call(this,s)||this,f.enhancer=void 0,f.name_=void 0,f.equals=void 0,f.hasUnreportedChange_=!1,f.interceptors_=void 0,f.changeListeners_=void 0,f.value_=void 0,f.dehancer=void 0,f.enhancer=i,f.name_=s,f.equals=a,f.value_=i(n,void 0,s),o&&He()&&Gr({type:$b,object:bo(f),observableKind:"value",debugObjectName:f.name_,newValue:""+f.value_}),f}var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){var s=this.value_;if(i=this.prepareNewValue_(i),i!==H.UNCHANGED){var o=He();o&&lt({type:Rt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&dt()}},r.prepareNewValue_=function(i){if(Vt(this),vt(this)){var s=_t(this,{object:this,type:Rt,newValue:i});if(!s)return H.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?H.UNCHANGED:i},r.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),Bt(this)&&kt(this,{type:Rt,object:this,newValue:i,oldValue:s})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Oi(this,i)},r.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Rt,newValue:this.value_,oldValue:void 0}),Ai(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Al(this.get())},r[kl]=function(){return this.valueOf()},t}(vi),Cb=Ar("ObservableValue",_r),Ml;Ml=Symbol.toPrimitive;var qr=function(){function e(r){this.dependenciesState_=Ie.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ie.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new xo(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=It.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||fe(31),this.derivation=r.get,this.name_=r.name||"ComputedValue@"+Et(),r.set&&(this.setter_=zr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?rt.structural:rt.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Lb(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing_&&fe(32,this.name_,this.derivation),H.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)ha(this)&&(this.warnAboutUntrackedRead_(),wt(),this.value_=this.computeValue_(!1),Tt());else if(Kl(this),ha(this)){var n=H.trackingContext;this.keepAlive_&&!n&&(H.trackingContext=this),this.trackAndCompute()&&jb(this),H.trackingContext=n}var i=this.value_;if(vo(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter_&&fe(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else fe(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Ie.NOT_TRACKING_,s=this.computeValue_(!0),o=i||vo(n)||vo(s)||!this.equals_(n,s);return o&&(this.value_=s,He()&&Gr({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:s})),o},t.computeValue_=function(n){this.isComputing_=!0;var i=Wo(!1),s;if(n)s=Dl(this,this.derivation,this.scope_);else if(H.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new xo(o)}return Jo(i),this.isComputing_=!1,s},t.suspend_=function(){this.keepAlive_||(ma(this),this.value_=void 0,this.isTracing_!==It.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(n,i){var s=this,o=!0,a=void 0;return qt(function(){var f=s.get();if(!o||i){var c=Xr();n({observableKind:"computed",debugObjectName:s.name_,type:Rt,object:s,newValue:f,oldValue:a}),er(c)}o=!1,a=f})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==It.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:H.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Al(this.get())},t[Ml]=function(){return this.valueOf()},e}(),wi=Ar("ComputedValue",qr),Ie;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Ie||(Ie={}));var It;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(It||(It={}));var xo=function(t){this.cause=void 0,this.cause=t};function vo(e){return e instanceof xo}function ha(e){switch(e.dependenciesState_){case Ie.UP_TO_DATE_:return!1;case Ie.NOT_TRACKING_:case Ie.STALE_:return!0;case Ie.POSSIBLY_STALE_:{for(var t=Da(!0),r=Xr(),n=e.observing_,i=n.length,s=0;s<i;s++){var o=n[s];if(wi(o)){if(H.disableErrorBoundaries)o.get();else try{o.get()}catch{return er(r),ii(t),!0}if(e.dependenciesState_===Ie.STALE_)return er(r),ii(t),!0}}return jl(e),er(r),ii(t),!1}}}function Pb(){return H.trackingDerivation!==null}function Vt(e){var t=e.observers_.size>0;!H.allowStateChanges&&(t||H.enforceActions==="always")&&console.warn("[MobX] "+(H.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function Ub(e){!H.allowStateReads&&H.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Dl(e,t,r){var n=Da(!0);jl(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++H.runId;var i=H.trackingDerivation;H.trackingDerivation=e,H.inBatch++;var s;if(H.disableErrorBoundaries===!0)s=t.call(r);else try{s=t.call(r)}catch(o){s=new xo(o)}return H.inBatch--,H.trackingDerivation=i,Bb(e),Rb(e),ii(n),s}function Rb(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:H.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function Bb(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Ie.UP_TO_DATE_,i=0,s=e.unboundDepsCount_,o=0;o<s;o++){var a=r[o];a.diffValue_===0&&(a.diffValue_=1,i!==o&&(r[i]=a),i++),a.dependenciesState_>n&&(n=a.dependenciesState_)}for(r.length=i,e.newObserving_=null,s=t.length;s--;){var f=t[s];f.diffValue_===0&&Fl(f,e),f.diffValue_=0}for(;i--;){var c=r[i];c.diffValue_===1&&(c.diffValue_=0,Db(c,e))}n!==Ie.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function ma(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Fl(t[r],e);e.dependenciesState_=Ie.NOT_TRACKING_}function Be(e){var t=Xr();try{return e()}finally{er(t)}}function Xr(){var e=H.trackingDerivation;return H.trackingDerivation=null,e}function er(e){H.trackingDerivation=e}function Da(e){var t=H.allowStateReads;return H.allowStateReads=e,t}function ii(e){H.allowStateReads=e}function jl(e){if(e.dependenciesState_!==Ie.UP_TO_DATE_){e.dependenciesState_=Ie.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Ie.UP_TO_DATE_}}var _o=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},wo=!0,Ll=!1,H=function(){var e=Pa();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(wo=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new _o().version&&(wo=!1),wo?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new _o):(setTimeout(function(){Ll||fe(35)},1),new _o)}();function kb(){if((H.pendingReactions.length||H.inBatch||H.isRunningReactions)&&fe(36),Ll=!0,wo){var e=Pa();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),H=new _o}}function Mb(){return H}function Db(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Fl(e,t){e.observers_.delete(t),e.observers_.size===0&&Vl(e)}function Vl(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,H.pendingUnobservations.push(e))}function wt(){H.inBatch++}function Tt(){if(--H.inBatch===0){Hl();for(var e=H.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation_=!1,r.observers_.size===0&&(r.isBeingObserved_&&(r.isBeingObserved_=!1,r.onBUO()),r instanceof qr&&r.suspend_())}H.pendingUnobservations=[]}}function Kl(e){Ub(e);var t=H.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&H.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(e.observers_.size===0&&H.inBatch>0&&Vl(e),!1)}function zl(e){e.lowestObserverState_!==Ie.STALE_&&(e.lowestObserverState_=Ie.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.UP_TO_DATE_&&(t.isTracing_!==It.NONE&&ql(t,e),t.onBecomeStale_()),t.dependenciesState_=Ie.STALE_}))}function jb(e){e.lowestObserverState_!==Ie.STALE_&&(e.lowestObserverState_=Ie.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.POSSIBLY_STALE_?(t.dependenciesState_=Ie.STALE_,t.isTracing_!==It.NONE&&ql(t,e)):t.dependenciesState_===Ie.UP_TO_DATE_&&(e.lowestObserverState_=Ie.UP_TO_DATE_)}))}function Lb(e){e.lowestObserverState_===Ie.UP_TO_DATE_&&(e.lowestObserverState_=Ie.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.UP_TO_DATE_&&(t.dependenciesState_=Ie.POSSIBLY_STALE_,t.onBecomeStale_())}))}function ql(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===It.BREAK){var r=[];Gl(Xo(e),r,1),new Function(`debugger;
35
+ /*
36
+ Tracing '`+e.name_+`'
37
+
38
+ You are entering this break point because derivation '`+e.name_+"' is being traced and '"+t.name_+`' is now forcing it to update.
39
+ Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
40
+ The stackframe you are looking for is at least ~6-8 stack-frames up.
41
+
42
+ `+(e instanceof qr?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
43
+
44
+ The dependencies for this derivation are:
45
+
46
+ `+r.join(`
47
+ `)+`
48
+ */
49
+ `)()}}function Gl(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return Gl(n,t,r+1)})}var ai=function(){function e(r,n,i,s){r===void 0&&(r="Reaction@"+Et()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ie.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=It.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=s}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,H.pendingReactions.push(this),Hl())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){wt(),this.isScheduled_=!1;var n=H.trackingContext;if(H.trackingContext=this,ha(this)){this.isTrackPending_=!0;try{this.onInvalidate_(),this.isTrackPending_&&He()&&Gr({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}H.trackingContext=n,Tt()}},t.track=function(n){if(!this.isDisposed_){wt();var i=He(),s;i&&(s=Date.now(),lt({name:this.name_,type:"reaction"})),this.isRunning_=!0;var o=H.trackingContext;H.trackingContext=this;var a=Dl(this,n,void 0);H.trackingContext=o,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&ma(this),vo(a)&&this.reportExceptionInDerivation_(a.cause),i&&dt({time:Date.now()-s}),Tt()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(H.disableErrorBoundaries)throw n;var s="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";H.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(s,n),He()&&Gr({type:"error",name:this.name_,message:s,error:""+n}),H.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(wt(),ma(this),Tt()))},t.getDisposer_=function(n){var i=this,s=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",s),s[be]=this,s},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){n===void 0&&(n=!1),rd(this,n)},e}(),Nf=100,ga=function(t){return t()};function Hl(){H.inBatch>0||H.isRunningReactions||ga(Fb)}function Fb(){H.isRunningReactions=!0;for(var e=H.pendingReactions,t=0;e.length>0;){++t===Nf&&(console.error("Reaction doesn't converge to a stable state after "+Nf+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}H.isRunningReactions=!1}var No=Ar("Reaction",ai);function Vb(e){var t=ga;ga=function(n){return e(function(){return t(n)})}}function He(){return!!H.spyListeners.length}function Gr(e){if(H.spyListeners.length)for(var t=H.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function lt(e){var t=tr({},e,{spyReportStart:!0});Gr(t)}var Kb={type:"report-end",spyReportEnd:!0};function dt(e){Gr(e?tr({},e,{type:"report-end",spyReportEnd:!0}):Kb)}function zb(e){return H.spyListeners.push(e),Ra(function(){H.spyListeners=H.spyListeners.filter(function(t){return t!==e})})}var ja="action",qb="action.bound",Wl="autoAction",Gb="autoAction.bound",Jl="<unnamed action>",ba=_i(ja),Hb=_i(qb,{bound:!0}),va=_i(Wl,{autoAction:!0}),Wb=_i(Gb,{autoAction:!0,bound:!0});function Xl(e){var t=function(n,i){if(De(n))return zr(n.name||Jl,n,e);if(De(i))return zr(n,i,e);if(bi(i))return(e?va:ba).decorate_20223_(n,i);if(Vr(i))return En(n,i,e?va:ba);if(Vr(n))return zt(_i(e?Wl:ja,{name:n,autoAction:e}));fe("Invalid arguments for `action`")};return t}var Ot=Xl(!1);Object.assign(Ot,ba);var ui=Xl(!0);Object.assign(ui,va);Ot.bound=zt(Hb);ui.bound=zt(Wb);function Jb(e){return Bl(e.name||Jl,!1,e,this,void 0)}function Sn(e){return De(e)&&e.isMobxAction===!0}function qt(e,t){var r,n,i,s,o;t===void 0&&(t=Ua),De(e)||fe("Autorun expects a function as first argument"),Sn(e)&&fe("Autorun does not accept actions since actions are untrackable");var a=(r=(n=t)==null?void 0:n.name)!=null?r:e.name||"Autorun@"+Et(),f=!t.scheduler&&!t.delay,c;if(f)c=new ai(a,function(){this.track(k)},t.onError,t.requiresObservable);else{var y=Yl(t),g=!1;c=new ai(a,function(){g||(g=!0,y(function(){g=!1,c.isDisposed_||c.track(k)}))},t.onError,t.requiresObservable)}function k(){e(c)}return(i=t)!=null&&(s=i.signal)!=null&&s.aborted||c.schedule_(),c.getDisposer_((o=t)==null?void 0:o.signal)}var Xb=function(t){return t()};function Yl(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Xb}function Yb(e,t,r){var n,i,s,o;r===void 0&&(r=Ua),(!De(e)||!De(t))&&fe("First and second argument to reaction should be functions"),Mt(r)||fe("Third argument of reactions should be an object");var a=(n=r.name)!=null?n:"Reaction@"+Et(),f=Ot(a,r.onError?Qb(r.onError,t):t),c=!r.scheduler&&!r.delay,y=Yl(r),g=!0,k=!1,U,j,te=r.compareStructural?rt.structural:r.equals||rt.default,W=new ai(a,function(){g||c?B():k||(k=!0,y(B))},r.onError,r.requiresObservable);function B(){if(k=!1,!W.isDisposed_){var z=!1;W.track(function(){var Y=Nb(!1,function(){return e(W)});z=g||!te(U,Y),j=U,U=Y}),(g&&r.fireImmediately||!g&&z)&&f(U,j,W),g=!1}}return(i=r)!=null&&(s=i.signal)!=null&&s.aborted||W.schedule_(),W.getDisposer_((o=r)==null?void 0:o.signal)}function Qb(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var Zb="onBO",ev="onBUO";function Ql(e,t,r){return Zl(Zb,e,t,r)}function Ti(e,t,r){return Zl(ev,e,t,r)}function Zl(e,t,r,n){var i=typeof n=="function"?wr(t,r):wr(t),s=De(n)?n:r,o=e+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var a=i[o];a&&(a.delete(s),a.size===0&&delete i[o])}}var tv="never",ho="always",rv="observed";function nv(e){e.isolateGlobalState===!0&&kb();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(H.useProxies=t===ho?!0:t===tv?!1:typeof Proxy<"u"),t==="ifavailable"&&(H.verifyProxies=!0),r!==void 0){var n=r===ho?ho:r===rv;H.enforceActions=n,H.allowStateChanges=!(n===!0||n===ho)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(H[i]=!!e[i])}),H.allowStateReads=!H.observableRequiresReaction,H.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Vb(e.reactionScheduler)}function iv(e,t,r,n){arguments.length>4&&fe("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&fe("'extendObservable' expects an object as first argument"),Wt(e)&&fe("'extendObservable' should not be used on maps, use map.merge instead"),Mt(t)||fe("'extendObservable' only accepts plain objects as second argument"),(Tn(t)||Tn(r))&&fe("Extending an object with another observable (object) is not supported");var i=Ug(t);return Qr(function(){var s=$n(e,n)[be];zo(i).forEach(function(o){s.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function Xo(e,t){return ed(wr(e,t))}function ed(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=ov(e.observing_).map(ed)),t}function ov(e){return Array.from(new Set(e))}var sv=0;function td(){this.message="FLOW_CANCELLED"}td.prototype=Object.create(Error.prototype);var ia=xl("flow"),av=xl("flow.bound",{bound:!0}),wn=Object.assign(function(t,r){if(bi(r))return ia.decorate_20223_(t,r);if(Vr(r))return En(t,r,ia);arguments.length!==1&&fe("Flow expects single argument with generator function");var n=t,i=n.name||"<unnamed flow>",s=function(){var a=this,f=arguments,c=++sv,y=Ot(i+" - runid: "+c+" - init",n).apply(a,f),g,k=void 0,U=new Promise(function(j,te){var W=0;g=te;function B(ie){k=void 0;var F;try{F=Ot(i+" - runid: "+c+" - yield "+W++,y.next).call(y,ie)}catch(se){return te(se)}Y(F)}function z(ie){k=void 0;var F;try{F=Ot(i+" - runid: "+c+" - yield "+W++,y.throw).call(y,ie)}catch(se){return te(se)}Y(F)}function Y(ie){if(De(ie?.then)){ie.then(Y,te);return}return ie.done?j(ie.value):(k=Promise.resolve(ie.value),k.then(B,z))}B(void 0)});return U.cancel=Ot(i+" - runid: "+c+" - cancel",function(){try{k&&$f(k);var j=y.return(void 0),te=Promise.resolve(j.value);te.then(bn,bn),$f(te),g(new td)}catch(W){g(W)}}),U};return s.isMobXFlow=!0,s},ia);wn.bound=zt(av);function $f(e){De(e.cancel)&&e.cancel()}function ci(e){return e?.isMobXFlow===!0}function uv(e,t){return e?t!==void 0?Wt(e)||Nn(e)?fe("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Hr(e)?e[be].values_.has(t):!1:Hr(e)||!!e[be]||ka(e)||No(e)||wi(e):!1}function Tn(e){return arguments.length!==1&&fe("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),uv(e)}function cv(e){if(Hr(e))return e[be].ownKeys_();fe(38)}function mo(e,t,r){return e.set(t,r),r}function gn(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Tn(e))return e;if(Cb(e)||wi(e))return gn(e.get(),t);if(t.has(e))return t.get(e);if(Nn(e)){var r=mo(t,e,new Array(e.length));return e.forEach(function(o,a){r[a]=gn(o,t)}),r}if(Yr(e)){var n=mo(t,e,new Set);return e.forEach(function(o){n.add(gn(o,t))}),n}if(Wt(e)){var i=mo(t,e,new Map);return e.forEach(function(o,a){i.set(a,gn(o,t))}),i}else{var s=mo(t,e,{});return cv(e).forEach(function(o){mi.propertyIsEnumerable.call(e,o)&&(s[o]=gn(e[o],t))}),s}}function _n(e,t){return t&&fe("toJS no longer supports options"),gn(e,new Map)}function rd(){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=fv(r);if(!i)return fe("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===It.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?It.BREAK:It.LOG}function fv(e){switch(e.length){case 0:return H.trackingDerivation;case 1:return wr(e[0]);case 2:return wr(e[0],e[1])}}function Qt(e,t){t===void 0&&(t=void 0),wt();try{return e.apply(t)}finally{Tt()}}function jr(e){return e[be]}var lv={has:function(t,r){return H.trackingDerivation&&ri("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),jr(t).has_(r)},get:function(t,r){return jr(t).get_(r)},set:function(t,r,n){var i;return Vr(r)?(jr(t).values_.has(r)||ri("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=jr(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return ri("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Vr(r)?(n=jr(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return ri("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=jr(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return H.trackingDerivation&&ri("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),jr(t).ownKeys_()},preventExtensions:function(t){fe(13)}};function dv(e,t){var r,n;return _l(),e=$n(e,t),(n=(r=e[be]).proxy_)!=null?n:r.proxy_=new Proxy(e,lv)}function vt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Oi(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Ra(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function _t(e,t){var r=Xr();try{for(var n=[].concat(e.interceptors_||[]),i=0,s=n.length;i<s&&(t=n[i](t),t&&!t.type&&fe(14),!!t);i++);return t}finally{er(r)}}function Bt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Ai(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Ra(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function kt(e,t){var r=Xr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,s=n.length;i<s;i++)n[i](t);er(r)}}function xn(e,t,r){return Qr(function(){var n,i=$n(e,r)[be];t&&e[tt]&&fe("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=Dg(e)),zo(t).forEach(function(s){return i.make_(s,t[s])})}),e}var Cf="splice",Rt="update",pv=1e4,yv={get:function(t,r){var n=t[be];return r===be?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):At($o,r)?$o[r]:t[r]},set:function(t,r,n){var i=t[be];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){fe(15)}},La=function(){function e(r,n,i,s){r===void 0&&(r="ObservableArray@"+Et()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=s,this.atom_=new vi(r),this.enhancer_=function(o,a){return n(o,a,r+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return Oi(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Ai(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&fe("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var s=new Array(n-i),o=0;o<n-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&fe(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&dd(n+i+1)},t.spliceWithArray_=function(n,i,s){var o=this;Vt(this.atom_);var a=this.values_.length;if(n===void 0?n=0:n>a?n=a:n<0&&(n=Math.max(0,a+n)),arguments.length===1?i=a-n:i==null?i=0:i=Math.max(0,Math.min(i,a-n)),s===void 0&&(s=Io),vt(this)){var f=_t(this,{object:this.proxy_,type:Cf,index:n,removedCount:i,added:s});if(!f)return Io;i=f.removedCount,s=f.added}s=s.length===0?s:s.map(function(g){return o.enhancer_(g,void 0)}),this.legacyMode_;var c=s.length-i;this.updateArrayLength_(a,c);var y=this.spliceItemsIntoValues_(n,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(n,s,y),this.dehanceValues_(y)},t.spliceItemsIntoValues_=function(n,i,s){if(s.length<pv){var o;return(o=this.values_).splice.apply(o,[n,i].concat(s))}else{var a=this.values_.slice(n,n+i),f=this.values_.slice(n+i);this.values_.length+=s.length-i;for(var c=0;c<s.length;c++)this.values_[n+c]=s[c];for(var y=0;y<f.length;y++)this.values_[n+s.length+y]=f[y];return a}},t.notifyArrayChildUpdate_=function(n,i,s){var o=!this.owned_&&He(),a=Bt(this),f=a||o?{observableKind:"array",object:this.proxy_,type:Rt,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:s}:null;o&&lt(f),this.atom_.reportChanged(),a&&kt(this,f),o&&dt()},t.notifyArraySplice_=function(n,i,s){var o=!this.owned_&&He(),a=Bt(this),f=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Cf,index:n,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&lt(f),this.atom_.reportChanged(),a&&kt(this,f),o&&dt()},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var s=this.values_;if(this.legacyMode_&&n>s.length&&fe(17,n,s.length),n<s.length){Vt(this.atom_);var o=s[n];if(vt(this)){var a=_t(this,{type:Rt,object:this.proxy_,index:n,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,o);var f=i!==o;f&&(s[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var c=new Array(n+1-s.length),y=0;y<c.length-1;y++)c[y]=void 0;c[c.length-1]=i,this.spliceWithArray_(s.length,0,c)}},e}();function hv(e,t,r,n){return r===void 0&&(r="ObservableArray@"+Et()),n===void 0&&(n=!1),_l(),Qr(function(){var i=new La(r,t,n,!1);Tl(i.values_,be,i);var s=new Proxy(i.values_,yv);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var $o={clear:function(){return this.splice(0)},replace:function(t){var r=this[be];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];var o=this[be];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[be].spliceWithArray_(t,r,n)},push:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[be].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return H.trackingDerivation&&fe(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){H.trackingDerivation&&fe(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[be],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Ce("at",pt);Ce("concat",pt);Ce("flat",pt);Ce("includes",pt);Ce("indexOf",pt);Ce("join",pt);Ce("lastIndexOf",pt);Ce("slice",pt);Ce("toString",pt);Ce("toLocaleString",pt);Ce("toSorted",pt);Ce("toSpliced",pt);Ce("with",pt);Ce("every",Dt);Ce("filter",Dt);Ce("find",Dt);Ce("findIndex",Dt);Ce("findLast",Dt);Ce("findLastIndex",Dt);Ce("flatMap",Dt);Ce("forEach",Dt);Ce("map",Dt);Ce("some",Dt);Ce("toReversed",Dt);Ce("reduce",nd);Ce("reduceRight",nd);function Ce(e,t){typeof Array.prototype[e]=="function"&&($o[e]=t(e))}function pt(e){return function(){var t=this[be];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Dt(e){return function(t,r){var n=this,i=this[be];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,a){return t.call(r,o,a,n)})}}function nd(e){return function(){var t=this,r=this[be];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(s,o,a){return i(s,o,a,t)},n[e].apply(n,arguments)}}var mv=Ar("ObservableArrayAdministration",La);function Nn(e){return Vo(e)&&mv(e[be])}var id,od,gv={},vr="add",Co="delete";id=Symbol.iterator;od=Symbol.toStringTag;var sd=function(){function e(r,n,i){var s=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableMap@"+Et()),this.enhancer_=void 0,this.name_=void 0,this[be]=gv,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,De(Map)||fe(18),Qr(function(){s.keysAtom_=El(s.name_+".keys()"),s.data_=new Map,s.hasMap_=new Map,r&&s.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!H.trackingDerivation)return this.has_(n);var s=this.hasMap_.get(n);if(!s){var o=s=new _r(this.has_(n),Go,this.name_+"."+la(n)+"?",!1);this.hasMap_.set(n,o),Ti(o,function(){return i.hasMap_.delete(n)})}return s.get()},t.set=function(n,i){var s=this.has_(n);if(vt(this)){var o=_t(this,{type:s?Rt:vr,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return s?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(Vt(this.keysAtom_),vt(this)){var s=_t(this,{type:Co,object:this,name:n});if(!s)return!1}if(this.has_(n)){var o=He(),a=Bt(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:Co,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return o&&lt(f),Qt(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(n))==null||c.setNewValue_(!1);var y=i.data_.get(n);y.setNewValue_(void 0),i.data_.delete(n)}),a&&kt(this,f),o&&dt(),!0}return!1},t.updateValue_=function(n,i){var s=this.data_.get(n);if(i=s.prepareNewValue_(i),i!==H.UNCHANGED){var o=He(),a=Bt(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:Rt,object:this,oldValue:s.value_,name:n,newValue:i}:null;o&&lt(f),s.setNewValue_(i),a&&kt(this,f),o&&dt()}},t.addValue_=function(n,i){var s=this;Vt(this.keysAtom_),Qt(function(){var c,y=new _r(i,s.enhancer_,s.name_+"."+la(n),!1);s.data_.set(n,y),i=y.value_,(c=s.hasMap_.get(n))==null||c.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=He(),a=Bt(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:vr,object:this,name:n,newValue:i}:null;o&&lt(f),a&&kt(this,f),o&&dt()},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return fi({next:function(){var o=i.next(),a=o.done,f=o.value;return{done:a,value:a?void 0:n.get(f)}}})},t.entries=function(){var n=this,i=this.keys();return fi({next:function(){var o=i.next(),a=o.done,f=o.value;return{done:a,value:a?void 0:[f,n.get(f)]}}})},t[id]=function(){return this.entries()},t.forEach=function(n,i){for(var s=vn(this),o;!(o=s()).done;){var a=o.value,f=a[0],c=a[1];n.call(i,c,f,this)}},t.merge=function(n){var i=this;return Wt(n)&&(n=new Map(n)),Qt(function(){Mt(n)?Pg(n).forEach(function(s){return i.set(s,n[s])}):Array.isArray(n)?n.forEach(function(s){var o=s[0],a=s[1];return i.set(o,a)}):In(n)?(n.constructor!==Map&&fe(19,n),n.forEach(function(s,o){return i.set(o,s)})):n!=null&&fe(20,n)}),this},t.clear=function(){var n=this;Qt(function(){Be(function(){for(var i=vn(n.keys()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Qt(function(){for(var s=bv(n),o=new Map,a=!1,f=vn(i.data_.keys()),c;!(c=f()).done;){var y=c.value;if(!s.has(y)){var g=i.delete(y);if(g)a=!0;else{var k=i.data_.get(y);o.set(y,k)}}}for(var U=vn(s.entries()),j;!(j=U()).done;){var te=j.value,W=te[0],B=te[1],z=i.data_.has(W);if(i.set(W,B),i.data_.has(W)){var Y=i.data_.get(W);o.set(W,Y),z||(a=!0)}}if(!a)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var ie=i.data_.keys(),F=o.keys(),se=ie.next(),K=F.next();!se.done;){if(se.value!==K.value){i.keysAtom_.reportChanged();break}se=ie.next(),K=F.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with maps."),Ai(this,n)},t.intercept_=function(n){return Oi(this,n)},Ba(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:od,get:function(){return"Map"}}]),e}(),Wt=Ar("ObservableMap",sd);function bv(e){if(In(e)||Wt(e))return e;if(Array.isArray(e))return new Map(e);if(Mt(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return fe(21,e)}var ad,ud,vv={};ad=Symbol.iterator;ud=Symbol.toStringTag;var cd=function(){function e(r,n,i){var s=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableSet@"+Et()),this.name_=void 0,this[be]=vv,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,De(Set)||fe(22),this.enhancer_=function(o,a){return n(o,a,i)},Qr(function(){s.atom_=El(s.name_),r&&s.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Qt(function(){Be(function(){for(var i=vn(n.data_.values()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.forEach=function(n,i){for(var s=vn(this),o;!(o=s()).done;){var a=o.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(Vt(this.atom_),vt(this)){var s=_t(this,{type:vr,object:this,newValue:n});if(!s)return this}if(!this.has(n)){Qt(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=He(),a=Bt(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:vr,object:this,newValue:n}:null;o&&lt(f),a&&kt(this,f),o&&dt()}return this},t.delete=function(n){var i=this;if(vt(this)){var s=_t(this,{type:Co,object:this,oldValue:n});if(!s)return!1}if(this.has(n)){var o=He(),a=Bt(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:Co,object:this,oldValue:n}:null;return o&&lt(f),Qt(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&kt(this,f),o&&dt(),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=0,i=Array.from(this.keys()),s=Array.from(this.values());return fi({next:function(){var a=n;return n+=1,a<s.length?{value:[i[a],s[a]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=0,s=Array.from(this.data_.values());return fi({next:function(){return i<s.length?{value:n.dehanceValue_(s[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return Yr(n)&&(n=new Set(n)),Qt(function(){Array.isArray(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):gi(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):n!=null&&fe("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with sets."),Ai(this,n)},t.intercept_=function(n){return Oi(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[ad]=function(){return this.values()},Ba(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:ud,get:function(){return"Set"}}]),e}(),Yr=Ar("ObservableSet",cd),Pf=Object.create(null),Uf="remove",_a=function(){function e(r,n,i,s){n===void 0&&(n=new Map),s===void 0&&(s=cb),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=s,this.keysAtom_=new vi(this.name_+".keys"),this.isPlainObject_=Mt(this.target_),pd(this.defaultAnnotation_)||fe("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var s=this.values_.get(n);if(s instanceof qr)return s.set(i),!0;if(vt(this)){var o=_t(this,{type:Rt,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==H.UNCHANGED){var a=Bt(this),f=He(),c=a||f?{type:Rt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:n,newValue:i}:null;f&&lt(c),s.setNewValue_(i),a&&kt(this,c),f&&dt()}return!0},t.get_=function(n){return H.trackingDerivation&&!At(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,s){return s===void 0&&(s=!1),At(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):s?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},t.has_=function(n){if(!H.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new _r(n in this.target_,Go,this.name_+"."+la(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(kf(this,i,n),!(n in this.target_)){var s;if((s=this.target_[tt])!=null&&s[n])return;fe(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==mi;){var a=Ao(o,n);if(a){var f=i.make_(this,n,a,o);if(f===0)return;if(f===1)break}o=Object.getPrototypeOf(o)}Bf(this,i,n)}},t.extend_=function(n,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(n,i,o);kf(this,s,n);var a=s.extend_(this,n,i,o);return a&&Bf(this,s,n),a},t.defineProperty_=function(n,i,s){s===void 0&&(s=!1),Vt(this.keysAtom_);try{wt();var o=this.delete_(n);if(!o)return o;if(vt(this)){var a=_t(this,{object:this.proxy_||this.target_,name:n,type:vr,newValue:i.value});if(!a)return null;var f=a.newValue;i.value!==f&&(i=tr({},i,{value:f}))}if(s){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Kt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{Tt()}return!0},t.defineObservableProperty_=function(n,i,s,o){o===void 0&&(o=!1),Vt(this.keysAtom_);try{wt();var a=this.delete_(n);if(!a)return a;if(vt(this)){var f=_t(this,{object:this.proxy_||this.target_,name:n,type:vr,newValue:i});if(!f)return null;i=f.newValue}var c=Rf(n),y={configurable:H.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,y))return!1}else Kt(this.target_,n,y);var g=new _r(i,s,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{Tt()}return!0},t.defineComputedProperty_=function(n,i,s){s===void 0&&(s=!1),Vt(this.keysAtom_);try{wt();var o=this.delete_(n);if(!o)return o;if(vt(this)){var a=_t(this,{object:this.proxy_||this.target_,name:n,type:vr,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var f=Rf(n),c={configurable:H.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,n,c))return!1}else Kt(this.target_,n,c);this.values_.set(n,new qr(i)),this.notifyPropertyAddition_(n,void 0)}finally{Tt()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),Vt(this.keysAtom_),!At(this.target_,n))return!0;if(vt(this)){var s=_t(this,{object:this.proxy_||this.target_,name:n,type:Uf});if(!s)return null}try{var o,a;wt();var f=Bt(this),c=He(),y=this.values_.get(n),g=void 0;if(!y&&(f||c)){var k;g=(k=Ao(this.target_,n))==null?void 0:k.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(delete this.appliedAnnotations_[n],y&&(this.values_.delete(n),y instanceof _r&&(g=y.value_),zl(y)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(a=o.get(n))==null||a.set(n in this.target_),f||c){var U={type:Uf,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:g,name:n};c&&lt(U),f&&kt(this,U),c&&dt()}}finally{Tt()}return!0},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support the fire immediately property for observable objects."),Ai(this,n)},t.intercept_=function(n){return Oi(this,n)},t.notifyPropertyAddition_=function(n,i){var s,o,a=Bt(this),f=He();if(a||f){var c=a||f?{type:vr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;f&&lt(c),a&&kt(this,c),f&&dt()}(s=this.pendingKeys_)==null||(o=s.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),zo(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function $n(e,t){var r;if(t&&Hr(e)&&fe("Options can't be provided for already observable objects."),At(e,be))return Va(e)instanceof _a||fe("Cannot convert '"+Po(e)+`' into observable object:
50
+ The target is already observable of different type.
51
+ Extending builtins is not supported.`),e;Object.isExtensible(e)||fe("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:(Mt(e)?"ObservableObject":e.constructor.name)+"@"+Et(),i=new _a(e,new Map,String(n),_b(t));return Ko(e,be,i),e}var _v=Ar("ObservableObjectAdministration",_a);function Rf(e){return Pf[e]||(Pf[e]={get:function(){return this[be].getObservablePropValue_(e)},set:function(r){return this[be].setObservablePropValue_(e,r)}})}function Hr(e){return Vo(e)?_v(e[be]):!1}function Bf(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[tt])==null||delete n[r]}function kf(e,t,r){if(pd(t)||fe("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!Eo(t)&&At(e.appliedAnnotations_,r)){var n=e.name_+"."+r.toString(),i=e.appliedAnnotations_[r].annotationType_,s=t.annotationType_;fe("Cannot apply '"+s+"' to '"+n+"':"+(`
52
+ The field is already annotated with '`+i+"'.")+`
53
+ Re-annotating fields is not allowed.
54
+ Use 'override' annotation for methods overridden by subclass.`)}}var wv=ld(0),Tv=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),oa=0,fd=function(){};function Ov(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Ov(fd,Array.prototype);var Fa=function(e,t,r){Il(n,e);function n(s,o,a,f){var c;return a===void 0&&(a="ObservableArray@"+Et()),f===void 0&&(f=!1),c=e.call(this)||this,Qr(function(){var y=new La(a,o,f,!0);y.proxy_=bo(c),Tl(bo(c),be,y),s&&s.length&&c.spliceWithArray(0,0,s),Tv&&Object.defineProperty(bo(c),"0",wv)}),c}var i=n.prototype;return i.concat=function(){this[be].atom_.reportObserved();for(var o=arguments.length,a=new Array(o),f=0;f<o;f++)a[f]=arguments[f];return Array.prototype.concat.apply(this.slice(),a.map(function(c){return Nn(c)?c.slice():c}))},i[r]=function(){var s=this,o=0;return fi({next:function(){return o<s.length?{value:s[o++],done:!1}:{done:!0,value:void 0}}})},Ba(n,[{key:"length",get:function(){return this[be].getArrayLength_()},set:function(o){this[be].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(fd,Symbol.toStringTag,Symbol.iterator);Object.entries($o).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Ko(Fa.prototype,t,r)});function ld(e){return{enumerable:!1,configurable:!0,get:function(){return this[be].get_(e)},set:function(r){this[be].set_(e,r)}}}function Av(e){Kt(Fa.prototype,""+e,ld(e))}function dd(e){if(e>oa){for(var t=oa;t<e+100;t++)Av(t);oa=e}}dd(1e3);function Iv(e,t,r){return new Fa(e,t,r)}function wr(e,t){if(typeof e=="object"&&e!==null){if(Nn(e))return t!==void 0&&fe(23),e[be].atom_;if(Yr(e))return e.atom_;if(Wt(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||fe(25,t,Po(e)),r}if(Hr(e)){if(!t)return fe(26);var n=e[be].values_.get(t);return n||fe(27,t,Po(e)),n}if(ka(e)||wi(e)||No(e))return e}else if(De(e)&&No(e[be]))return e[be];fe(28)}function Va(e,t){if(e||fe(29),t!==void 0)return Va(wr(e,t));if(ka(e)||wi(e)||No(e)||Wt(e)||Yr(e))return e;if(e[be])return e[be];fe(24,e)}function Po(e,t){var r;if(t!==void 0)r=wr(e,t);else{if(Sn(e))return e.name;Hr(e)||Wt(e)||Yr(e)?r=Va(e):r=wr(e)}return r.name_}function Qr(e){var t=Xr(),r=Wo(!0);wt();try{return e()}finally{Tt(),Jo(r),er(t)}}var Mf=mi.toString;function Ka(e,t,r){return r===void 0&&(r=-1),wa(e,t,r)}function wa(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var s=typeof e;if(s!=="function"&&s!=="object"&&typeof t!="object")return!1;var o=Mf.call(e);if(o!==Mf.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=Df(e),t=Df(t);var a=o==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var f=e.constructor,c=t.constructor;if(f!==c&&!(De(f)&&f instanceof f&&De(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var y=n.length;y--;)if(n[y]===e)return i[y]===t;if(n.push(e),i.push(t),a){if(y=e.length,y!==t.length)return!1;for(;y--;)if(!wa(e[y],t[y],r-1,n,i))return!1}else{var g=Object.keys(e),k;if(y=g.length,Object.keys(t).length!==y)return!1;for(;y--;)if(k=g[y],!(At(t,k)&&wa(e[k],t[k],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function Df(e){return Nn(e)?e.slice():In(e)||Wt(e)||gi(e)||Yr(e)?Array.from(e.entries()):e}function fi(e){return e[Symbol.iterator]=Ev,e}function Ev(){return this}function pd(e){return e instanceof Object&&typeof e.annotationType_=="string"&&De(e.make_)&&De(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Pa();typeof t[e]>"u"&&fe("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:zb,extras:{getDebugName:Po},$mobx:be});var yd=jt(wg(),1),kS=yd.default.configure,Wr=yd.default,sa=100,{WARN:Sv,LOG:MS,DEBUG:br,VERBOSE:ft,ERROR:DS}=Se.setup(Se.INFO);nv({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Qe=({caller:e,thread:t,pattern:r,args:n})=>(n=n||r,`${Be(()=>t?.name?t.name+" | ":"")}${e??"caller?"}${n?`{${typeof n=="string"?n:Wr(n)}}`:""}`);function xv(e,t){return Be(()=>rt.structural(e.get(),t.get()))}function Ii(e,t){return rt.shallow(e.applogs,t.applogs)}function za(e,t){if(e.size!==t.size)return!1;for(let r=0;r<e.size;r++){let n=e.nodes[r],i=t.nodes[r];if(ft("queryNodesComparer",r,n,i),!rt.structural(n.variables,i.variables))return ft("[queryNodesComparer] changed vars:",r,n,i),!1;if(!Ii(n.logsOfThisNode,i.logsOfThisNode))return ft("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return ft("[queryNodesComparer] equal:",{a:e,b:t}),!0}var Nv=0;function Zt(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++Nv}{${t}}`;ft(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,s=$v(e,a=>i=ke.array(a,{deep:!1,name:t,equals:r}),a=>{Be(()=>(r??rt.structural)(i,a))?br(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),br(`[${n}] updated`,{updatedItems:a,observableArr:i}))},{name:n}),o=Ti(i,()=>{ft(`[${n}] dispose`),o(),s()});return i}function $v(e,t,r,{name:n}={}){br("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let i=`${n}.autorunImm`,s,o=new ai(i,(...c)=>{br(`[${i}] reaction.invalidate`,c),a(),Jb(()=>{r(s)})});function a(){o.track(()=>{let c=sa&&performance.now();br(`[${i}] runAndTrack:`,{name:n??e.name,fn:e}),s=e(),br(`[${i}] runAndTrack =>`,s),sa&&performance.now()-c>sa&&Sv(`[${i}] took ${performance.now()-c}ms`)})}return a(),t(s),br.isEnabled&&br(`[${i}] deps of reaction`,{reaction:o,result:s,deps:Xo(o)}),()=>{ft(`[${i}] dispose`),setTimeout(()=>o.dispose())}}function nt(e,t,r=!1){if(Sn(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let n=!1,i=0,s=typeof r=="boolean"?{keepAlive:r}:r,o=new Map;return function(...a){let f,c=Be(()=>a),y=`computedFnDeepCompare(${e||t.name}#${++i})${s.argsDebugName?`{${s.argsDebugName(...a)}}`:""}`;for(let[U,j]of o.entries())if(rt.structural(U,c)){f=j;break}if(f){let U=f.get();return ft(`[${y}] cache hit`,{untrackedArgs:c,cachedResult:U}),U}if(!s.keepAlive&&!Pb())return!n&&Mb().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),n=!0),t.apply(this,a);ft(`[${y}] new computation`,{untrackedArgs:c});let g,k=Ge(()=>(ft(`[${y}] update->rerun`,Be(()=>({args:a})),t),ft.isDisabled||rd(),g=t.apply(this,a)),{...s,name:y});if(ft(`[${y}] deps`,Xo(k),{untrackedArgs:c}),o.set(c,k),!s.keepAlive){let U=Ti(k,()=>{ft(`[${y}] dispose`,k),U(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return k.get()}}function Cv(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?r+=s+`
55
+ `+" ".repeat(++t):s===")"?r+=`
56
+ `+" ".repeat(--t)+s:s===","&&n===0?r+=s+`
57
+ `+" ".repeat(t):s==="{"&&n===0?(n++,r+=s+`
58
+ `+" ".repeat(t+1)):s==="}"&&n===1?(n--,r+=`
59
+ `+" ".repeat(t)+s):s==="{"&&n>0?(n++,r+=s):(s==="}"&&n>1&&n--,r+=s)}return r}var{WARN:jf,LOG:jS,DEBUG:Pv,VERBOSE:LS,ERROR:gr}=Se.setup(Se.INFO,{prefix:"[thread]"});function rr(e){return e.init!==void 0}var qa=class{constructor(e,t,r,n=[]){this.name=e,this._applogs=n,this.parents=t===null?null:Of(t),this.filters=r,Be(()=>this.parents?.length===0)&&jf("[Thread] empty parents array",e),xn(this,{applogsCids:Ge,insert:Ot,size:Ge,isEmpty:Ge,firstLog:Ge,latestLog:Ge},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw gr("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw gr("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw gr("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw gr("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw gr("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw gr("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):jf("unsubscribe called for non-existent",e)}notifySubscribers(e){Pv(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map||gr("applogs arr?!",this.applogs),this.applogs.map(e)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw gr("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e)}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get untrackedSize(){return Be(()=>this.size)}get nameAndSizeUntracked(){return Be(()=>`${this.name} (${this.size})`)}get prettyName(){return Cv(this.name)}};function Ta(e){"@babel/helpers - typeof";return Ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(e)}function hd(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Lf(e){hd(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Ta(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Uv(e,t){hd(2,arguments);var r=Lf(e),n=Lf(t);return r.getTime()<n.getTime()}var Rv=typeof global=="object"&&global&&global.Object===Object&&global,md=Rv,Bv=typeof self=="object"&&self&&self.Object===Object&&self,kv=md||Bv||Function("return this")(),nr=kv,Mv=nr.Symbol,Gt=Mv,gd=Object.prototype,Dv=gd.hasOwnProperty,jv=gd.toString,ni=Gt?Gt.toStringTag:void 0;function Lv(e){var t=Dv.call(e,ni),r=e[ni];try{e[ni]=void 0;var n=!0}catch{}var i=jv.call(e);return n&&(t?e[ni]=r:delete e[ni]),i}var Fv=Lv,Vv=Object.prototype,Kv=Vv.toString;function zv(e){return Kv.call(e)}var qv=zv,Gv="[object Null]",Hv="[object Undefined]",Ff=Gt?Gt.toStringTag:void 0;function Wv(e){return e==null?e===void 0?Hv:Gv:Ff&&Ff in Object(e)?Fv(e):qv(e)}var Cn=Wv;function Jv(e){return e!=null&&typeof e=="object"}var On=Jv,Xv="[object Symbol]";function Yv(e){return typeof e=="symbol"||On(e)&&Cn(e)==Xv}var li=Yv;function Qv(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Zv=Qv,e_=Array.isArray,Ht=e_,t_=1/0,Vf=Gt?Gt.prototype:void 0,Kf=Vf?Vf.toString:void 0;function bd(e){if(typeof e=="string")return e;if(Ht(e))return Zv(e,bd)+"";if(li(e))return Kf?Kf.call(e):"";var t=e+"";return t=="0"&&1/e==-t_?"-0":t}var r_=bd;function n_(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var di=n_;function i_(e){return e}var vd=i_,o_="[object AsyncFunction]",s_="[object Function]",a_="[object GeneratorFunction]",u_="[object Proxy]";function c_(e){if(!di(e))return!1;var t=Cn(e);return t==s_||t==a_||t==o_||t==u_}var _d=c_,f_=nr["__core-js_shared__"],aa=f_,zf=function(){var e=/[^.]+$/.exec(aa&&aa.keys&&aa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function l_(e){return!!zf&&zf in e}var d_=l_,p_=Function.prototype,y_=p_.toString;function h_(e){if(e!=null){try{return y_.call(e)}catch{}try{return e+""}catch{}}return""}var Zr=h_,m_=/[\\^$.*+?()[\]{}|]/g,g_=/^\[object .+?Constructor\]$/,b_=Function.prototype,v_=Object.prototype,__=b_.toString,w_=v_.hasOwnProperty,T_=RegExp("^"+__.call(w_).replace(m_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function O_(e){if(!di(e)||d_(e))return!1;var t=_d(e)?T_:g_;return t.test(Zr(e))}var A_=O_;function I_(e,t){return e?.[t]}var E_=I_;function S_(e,t){var r=E_(e,t);return A_(r)?r:void 0}var en=S_,x_=en(nr,"WeakMap"),Oa=x_;function N_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var $_=N_,C_=800,P_=16,U_=Date.now;function R_(e){var t=0,r=0;return function(){var n=U_(),i=P_-(n-r);if(r=n,i>0){if(++t>=C_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var B_=R_;function k_(e){return function(){return e}}var M_=k_,D_=function(){try{var e=en(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Uo=D_,j_=Uo?function(e,t){return Uo(e,"toString",{configurable:!0,enumerable:!1,value:M_(t),writable:!0})}:vd,L_=j_,F_=B_(L_),V_=F_,K_=9007199254740991,z_=/^(?:0|[1-9]\d*)$/;function q_(e,t){var r=typeof e;return t=t??K_,!!t&&(r=="number"||r!="symbol"&&z_.test(e))&&e>-1&&e%1==0&&e<t}var Ga=q_;function G_(e,t,r){t=="__proto__"&&Uo?Uo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var H_=G_;function W_(e,t){return e===t||e!==e&&t!==t}var Ha=W_,J_=Object.prototype,X_=J_.hasOwnProperty;function Y_(e,t,r){var n=e[t];(!(X_.call(e,t)&&Ha(n,r))||r===void 0&&!(t in e))&&H_(e,t,r)}var Q_=Y_,qf=Math.max;function Z_(e,t,r){return t=qf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=qf(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(o),$_(e,this,a)}}var ew=Z_,tw=9007199254740991;function rw(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tw}var Wa=rw;function nw(e){return e!=null&&Wa(e.length)&&!_d(e)}var iw=nw,ow=Object.prototype;function sw(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ow;return e===r}var aw=sw;function uw(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var cw=uw,fw="[object Arguments]";function lw(e){return On(e)&&Cn(e)==fw}var Gf=lw,wd=Object.prototype,dw=wd.hasOwnProperty,pw=wd.propertyIsEnumerable,yw=Gf(function(){return arguments}())?Gf:function(e){return On(e)&&dw.call(e,"callee")&&!pw.call(e,"callee")},Ja=yw;function hw(){return!1}var mw=hw,Td=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hf=Td&&typeof module=="object"&&module&&!module.nodeType&&module,gw=Hf&&Hf.exports===Td,Wf=gw?nr.Buffer:void 0,bw=Wf?Wf.isBuffer:void 0,vw=bw||mw,Aa=vw,_w="[object Arguments]",ww="[object Array]",Tw="[object Boolean]",Ow="[object Date]",Aw="[object Error]",Iw="[object Function]",Ew="[object Map]",Sw="[object Number]",xw="[object Object]",Nw="[object RegExp]",$w="[object Set]",Cw="[object String]",Pw="[object WeakMap]",Uw="[object ArrayBuffer]",Rw="[object DataView]",Bw="[object Float32Array]",kw="[object Float64Array]",Mw="[object Int8Array]",Dw="[object Int16Array]",jw="[object Int32Array]",Lw="[object Uint8Array]",Fw="[object Uint8ClampedArray]",Vw="[object Uint16Array]",Kw="[object Uint32Array]",Ue={};Ue[Bw]=Ue[kw]=Ue[Mw]=Ue[Dw]=Ue[jw]=Ue[Lw]=Ue[Fw]=Ue[Vw]=Ue[Kw]=!0;Ue[_w]=Ue[ww]=Ue[Uw]=Ue[Tw]=Ue[Rw]=Ue[Ow]=Ue[Aw]=Ue[Iw]=Ue[Ew]=Ue[Sw]=Ue[xw]=Ue[Nw]=Ue[$w]=Ue[Cw]=Ue[Pw]=!1;function zw(e){return On(e)&&Wa(e.length)&&!!Ue[Cn(e)]}var qw=zw;function Gw(e){return function(t){return e(t)}}var Hw=Gw,Od=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oi=Od&&typeof module=="object"&&module&&!module.nodeType&&module,Ww=oi&&oi.exports===Od,ua=Ww&&md.process,Jw=function(){try{var e=oi&&oi.require&&oi.require("util").types;return e||ua&&ua.binding&&ua.binding("util")}catch{}}(),Jf=Jw,Xf=Jf&&Jf.isTypedArray,Xw=Xf?Hw(Xf):qw,Ad=Xw,Yw=Object.prototype,Qw=Yw.hasOwnProperty;function Zw(e,t){var r=Ht(e),n=!r&&Ja(e),i=!r&&!n&&Aa(e),s=!r&&!n&&!i&&Ad(e),o=r||n||i||s,a=o?cw(e.length,String):[],f=a.length;for(var c in e)(t||Qw.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ga(c,f)))&&a.push(c);return a}var e0=Zw;function t0(e,t){return function(r){return e(t(r))}}var r0=t0,n0=r0(Object.keys,Object),i0=n0,o0=Object.prototype,s0=o0.hasOwnProperty;function a0(e){if(!aw(e))return i0(e);var t=[];for(var r in Object(e))s0.call(e,r)&&r!="constructor"&&t.push(r);return t}var u0=a0;function c0(e){return iw(e)?e0(e):u0(e)}var Id=c0,f0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l0=/^\w*$/;function d0(e,t){if(Ht(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||li(e)?!0:l0.test(e)||!f0.test(e)||t!=null&&e in Object(t)}var Xa=d0,p0=en(Object,"create"),pi=p0;function y0(){this.__data__=pi?pi(null):{},this.size=0}var h0=y0;function m0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var g0=m0,b0="__lodash_hash_undefined__",v0=Object.prototype,_0=v0.hasOwnProperty;function w0(e){var t=this.__data__;if(pi){var r=t[e];return r===b0?void 0:r}return _0.call(t,e)?t[e]:void 0}var T0=w0,O0=Object.prototype,A0=O0.hasOwnProperty;function I0(e){var t=this.__data__;return pi?t[e]!==void 0:A0.call(t,e)}var E0=I0,S0="__lodash_hash_undefined__";function x0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=pi&&t===void 0?S0:t,this}var N0=x0;function Pn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Pn.prototype.clear=h0;Pn.prototype.delete=g0;Pn.prototype.get=T0;Pn.prototype.has=E0;Pn.prototype.set=N0;var Yf=Pn;function $0(){this.__data__=[],this.size=0}var C0=$0;function P0(e,t){for(var r=e.length;r--;)if(Ha(e[r][0],t))return r;return-1}var Yo=P0,U0=Array.prototype,R0=U0.splice;function B0(e){var t=this.__data__,r=Yo(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():R0.call(t,r,1),--this.size,!0}var k0=B0;function M0(e){var t=this.__data__,r=Yo(t,e);return r<0?void 0:t[r][1]}var D0=M0;function j0(e){return Yo(this.__data__,e)>-1}var L0=j0;function F0(e,t){var r=this.__data__,n=Yo(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var V0=F0;function Un(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Un.prototype.clear=C0;Un.prototype.delete=k0;Un.prototype.get=D0;Un.prototype.has=L0;Un.prototype.set=V0;var Qo=Un,K0=en(nr,"Map"),yi=K0;function z0(){this.size=0,this.__data__={hash:new Yf,map:new(yi||Qo),string:new Yf}}var q0=z0;function G0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var H0=G0;function W0(e,t){var r=e.__data__;return H0(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Zo=W0;function J0(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t}var X0=J0;function Y0(e){return Zo(this,e).get(e)}var Q0=Y0;function Z0(e){return Zo(this,e).has(e)}var eT=Z0;function tT(e,t){var r=Zo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var rT=tT;function Rn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Rn.prototype.clear=q0;Rn.prototype.delete=X0;Rn.prototype.get=Q0;Rn.prototype.has=eT;Rn.prototype.set=rT;var es=Rn,nT="Expected a function";function Ya(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(nT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Ya.Cache||es),r}Ya.Cache=es;var iT=Ya,oT=500;function sT(e){var t=iT(e,function(n){return r.size===oT&&r.clear(),n}),r=t.cache;return t}var aT=sT,uT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cT=/\\(\\)?/g,fT=aT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(uT,function(r,n,i,s){t.push(i?s.replace(cT,"$1"):n||r)}),t}),lT=fT;function dT(e){return e==null?"":r_(e)}var pT=dT;function yT(e,t){return Ht(e)?e:Xa(e,t)?[e]:lT(pT(e))}var ts=yT,hT=1/0;function mT(e){if(typeof e=="string"||li(e))return e;var t=e+"";return t=="0"&&1/e==-hT?"-0":t}var Ei=mT;function gT(e,t){t=ts(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Ei(t[r++])];return r&&r==n?e:void 0}var Qa=gT;function bT(e,t,r){var n=e==null?void 0:Qa(e,t);return n===void 0?r:n}var vT=bT;function _T(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Ed=_T,Qf=Gt?Gt.isConcatSpreadable:void 0;function wT(e){return Ht(e)||Ja(e)||!!(Qf&&e&&e[Qf])}var TT=wT;function Sd(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=TT),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?Sd(a,t-1,r,n,i):Ed(i,a):n||(i[i.length]=a)}return i}var OT=Sd;function AT(e){var t=e==null?0:e.length;return t?OT(e,1):[]}var IT=AT;function ET(e){return V_(ew(e,void 0,IT),e+"")}var ST=ET;function xT(){this.__data__=new Qo,this.size=0}var NT=xT;function $T(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var CT=$T;function PT(e){return this.__data__.get(e)}var UT=PT;function RT(e){return this.__data__.has(e)}var BT=RT,kT=200;function MT(e,t){var r=this.__data__;if(r instanceof Qo){var n=r.__data__;if(!yi||n.length<kT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new es(n)}return r.set(e,t),this.size=r.size,this}var DT=MT;function Bn(e){var t=this.__data__=new Qo(e);this.size=t.size}Bn.prototype.clear=NT;Bn.prototype.delete=CT;Bn.prototype.get=UT;Bn.prototype.has=BT;Bn.prototype.set=DT;var To=Bn;function jT(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var LT=jT;function FT(){return[]}var VT=FT,KT=Object.prototype,zT=KT.propertyIsEnumerable,Zf=Object.getOwnPropertySymbols,qT=Zf?function(e){return e==null?[]:(e=Object(e),LT(Zf(e),function(t){return zT.call(e,t)}))}:VT,GT=qT;function HT(e,t,r){var n=t(e);return Ht(e)?n:Ed(n,r(e))}var WT=HT;function JT(e){return WT(e,Id,GT)}var el=JT,XT=en(nr,"DataView"),Ia=XT,YT=en(nr,"Promise"),Ea=YT,QT=en(nr,"Set"),Sa=QT,tl="[object Map]",ZT="[object Object]",rl="[object Promise]",nl="[object Set]",il="[object WeakMap]",ol="[object DataView]",eO=Zr(Ia),tO=Zr(yi),rO=Zr(Ea),nO=Zr(Sa),iO=Zr(Oa),Fr=Cn;(Ia&&Fr(new Ia(new ArrayBuffer(1)))!=ol||yi&&Fr(new yi)!=tl||Ea&&Fr(Ea.resolve())!=rl||Sa&&Fr(new Sa)!=nl||Oa&&Fr(new Oa)!=il)&&(Fr=function(e){var t=Cn(e),r=t==ZT?e.constructor:void 0,n=r?Zr(r):"";if(n)switch(n){case eO:return ol;case tO:return tl;case rO:return rl;case nO:return nl;case iO:return il}return t});var sl=Fr,oO=nr.Uint8Array,al=oO,sO="__lodash_hash_undefined__";function aO(e){return this.__data__.set(e,sO),this}var uO=aO;function cO(e){return this.__data__.has(e)}var fO=cO;function Ro(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new es;++t<r;)this.add(e[t])}Ro.prototype.add=Ro.prototype.push=uO;Ro.prototype.has=fO;var lO=Ro;function dO(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var pO=dO;function yO(e,t){return e.has(t)}var hO=yO,mO=1,gO=2;function bO(e,t,r,n,i,s){var o=r&mO,a=e.length,f=t.length;if(a!=f&&!(o&&f>a))return!1;var c=s.get(e),y=s.get(t);if(c&&y)return c==t&&y==e;var g=-1,k=!0,U=r&gO?new lO:void 0;for(s.set(e,t),s.set(t,e);++g<a;){var j=e[g],te=t[g];if(n)var W=o?n(te,j,g,t,e,s):n(j,te,g,e,t,s);if(W!==void 0){if(W)continue;k=!1;break}if(U){if(!pO(t,function(B,z){if(!hO(U,z)&&(j===B||i(j,B,r,n,s)))return U.push(z)})){k=!1;break}}else if(!(j===te||i(j,te,r,n,s))){k=!1;break}}return s.delete(e),s.delete(t),k}var xd=bO;function vO(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var _O=vO;function wO(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var TO=wO,OO=1,AO=2,IO="[object Boolean]",EO="[object Date]",SO="[object Error]",xO="[object Map]",NO="[object Number]",$O="[object RegExp]",CO="[object Set]",PO="[object String]",UO="[object Symbol]",RO="[object ArrayBuffer]",BO="[object DataView]",ul=Gt?Gt.prototype:void 0,ca=ul?ul.valueOf:void 0;function kO(e,t,r,n,i,s,o){switch(r){case BO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case RO:return!(e.byteLength!=t.byteLength||!s(new al(e),new al(t)));case IO:case EO:case NO:return Ha(+e,+t);case SO:return e.name==t.name&&e.message==t.message;case $O:case PO:return e==t+"";case xO:var a=_O;case CO:var f=n&OO;if(a||(a=TO),e.size!=t.size&&!f)return!1;var c=o.get(e);if(c)return c==t;n|=AO,o.set(e,t);var y=xd(a(e),a(t),n,i,s,o);return o.delete(e),y;case UO:if(ca)return ca.call(e)==ca.call(t)}return!1}var MO=kO,DO=1,jO=Object.prototype,LO=jO.hasOwnProperty;function FO(e,t,r,n,i,s){var o=r&DO,a=el(e),f=a.length,c=el(t),y=c.length;if(f!=y&&!o)return!1;for(var g=f;g--;){var k=a[g];if(!(o?k in t:LO.call(t,k)))return!1}var U=s.get(e),j=s.get(t);if(U&&j)return U==t&&j==e;var te=!0;s.set(e,t),s.set(t,e);for(var W=o;++g<f;){k=a[g];var B=e[k],z=t[k];if(n)var Y=o?n(z,B,k,t,e,s):n(B,z,k,e,t,s);if(!(Y===void 0?B===z||i(B,z,r,n,s):Y)){te=!1;break}W||(W=k=="constructor")}if(te&&!W){var ie=e.constructor,F=t.constructor;ie!=F&&"constructor"in e&&"constructor"in t&&!(typeof ie=="function"&&ie instanceof ie&&typeof F=="function"&&F instanceof F)&&(te=!1)}return s.delete(e),s.delete(t),te}var VO=FO,KO=1,cl="[object Arguments]",fl="[object Array]",go="[object Object]",zO=Object.prototype,ll=zO.hasOwnProperty;function qO(e,t,r,n,i,s){var o=Ht(e),a=Ht(t),f=o?fl:sl(e),c=a?fl:sl(t);f=f==cl?go:f,c=c==cl?go:c;var y=f==go,g=c==go,k=f==c;if(k&&Aa(e)){if(!Aa(t))return!1;o=!0,y=!1}if(k&&!y)return s||(s=new To),o||Ad(e)?xd(e,t,r,n,i,s):MO(e,t,f,r,n,i,s);if(!(r&KO)){var U=y&&ll.call(e,"__wrapped__"),j=g&&ll.call(t,"__wrapped__");if(U||j){var te=U?e.value():e,W=j?t.value():t;return s||(s=new To),i(te,W,r,n,s)}}return k?(s||(s=new To),VO(e,t,r,n,i,s)):!1}var GO=qO;function Nd(e,t,r,n,i){return e===t?!0:e==null||t==null||!On(e)&&!On(t)?e!==e&&t!==t:GO(e,t,r,n,Nd,i)}var $d=Nd,HO=1,WO=2;function JO(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var f=a[0],c=e[f],y=a[1];if(o&&a[2]){if(c===void 0&&!(f in e))return!1}else{var g=new To;if(n)var k=n(c,y,f,e,t,g);if(!(k===void 0?$d(y,c,HO|WO,n,g):k))return!1}}return!0}var XO=JO;function YO(e){return e===e&&!di(e)}var Cd=YO;function QO(e){for(var t=Id(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Cd(i)]}return t}var ZO=QO;function eA(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Pd=eA;function tA(e){var t=ZO(e);return t.length==1&&t[0][2]?Pd(t[0][0],t[0][1]):function(r){return r===e||XO(r,e,t)}}var rA=tA;function nA(e,t){return e!=null&&t in Object(e)}var iA=nA;function oA(e,t,r){t=ts(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=Ei(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&Wa(i)&&Ga(o,i)&&(Ht(e)||Ja(e)))}var sA=oA;function aA(e,t){return e!=null&&sA(e,t,iA)}var Ud=aA,uA=1,cA=2;function fA(e,t){return Xa(e)&&Cd(t)?Pd(Ei(e),t):function(r){var n=vT(r,e);return n===void 0&&n===t?Ud(r,e):$d(t,n,uA|cA)}}var lA=fA;function dA(e){return function(t){return t?.[e]}}var pA=dA;function yA(e){return function(t){return Qa(t,e)}}var hA=yA;function mA(e){return Xa(e)?pA(Ei(e)):hA(e)}var gA=mA;function bA(e){return typeof e=="function"?e:e==null?vd:typeof e=="object"?Ht(e)?lA(e[0],e[1]):rA(e):gA(e)}var vA=bA;function _A(e,t,r,n){if(!di(e))return e;t=ts(t,e);for(var i=-1,s=t.length,o=s-1,a=e;a!=null&&++i<s;){var f=Ei(t[i]),c=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=o){var y=a[f];c=n?n(y,f,a):void 0,c===void 0&&(c=di(y)?y:Ga(t[i+1])?[]:{})}Q_(a,f,c),a=a[f]}return e}var wA=_A;function TA(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Qa(e,o);r(a,o)&&wA(s,ts(o,e),a)}return s}var OA=TA;function AA(e,t){return OA(e,t,function(r,n){return Ud(e,n)})}var IA=AA,EA=ST(function(e,t){return e==null?{}:IA(e,t)}),dl=EA,SA=4294967295,xA=SA-1,NA=Math.floor,$A=Math.min;function CA(e,t,r,n){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=r(t);for(var o=t!==t,a=t===null,f=li(t),c=t===void 0;i<s;){var y=NA((i+s)/2),g=r(e[y]),k=g!==void 0,U=g===null,j=g===g,te=li(g);if(o)var W=n||j;else c?W=j&&(n||k):a?W=j&&k&&(n||!U):f?W=j&&k&&!U&&(n||!te):U||te?W=!1:W=n?g<=t:g<t;W?i=y+1:s=y}return $A(s,xA)}var PA=CA;function UA(e,t,r){return PA(e,t,vA(r,2))}var RA=UA,{WARN:FS,LOG:VS,DEBUG:KS,VERBOSE:pl,ERROR:BA}=Se.setup(Se.INFO),Rd=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Bd=(e,t,r="asc")=>Rd(e.ts,t.ts,r);function Jr(e,t="asc"){return e.sort((r,n)=>Bd(r,n,t))}var kd=(e,t)=>Uv(new Date(e.ts),new Date(t.ts));var Md=(e,t,r)=>rt.structural(dl(e,r),dl(t,r)),Za=e=>{let t=new Map;for(let r of e){if(!r)throw BA("falsy entry in applogs",e),new Error("falsy entry in applogs");let n=Wr(r);t.set(n,r)}return Array.from(t.values())};function Dd(e){return typeof e=="string"&&e.startsWith("?")}function jd(e){return e.slice(1)}function eu(e,t){let r={};return[Object.entries(e).reduce((i,[s,o])=>{if(Dd(o)){let a=jd(o),f=t[a];f?i[s]=f:r[s]=a}else i[s]=o;return i},{}),r]}function Ld(e,t,r){pl("[matchPartStatic]",e,t,t===r?"===":"!==",r);let n=typeof t=="function"?t(r):Array.isArray(t)&&!Array.isArray(r)?t.includes(r):t===r;return pl("[matchPartStatic] =>",e.startsWith("!")?"!":"",n),e.startsWith("!")?!n:n}var Fd=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},yl=function(t){return Fd(t)/t.length},ct={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return ct.max(e)-ct.min(e)},midrange:function(e){return ct.range(e)/2},sum:Fd,mean:yl,average:yl,median:function(e){e.sort(function(r,n){return r-n});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},r=0,n=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>r?(n=[i],r=t[i]):t[i]===r&&(n.push(i),r=t[i])}),n},variance:function(e){var t=ct.mean(e);return ct.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(ct.variance(e))},meanAbsoluteDeviation:function(e){var t=ct.mean(e);return ct.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=ct.mean(e),r=ct.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};ct.average=ct.mean;function tu(){return new Date().toISOString()}var Re=jt(Yt(),1),Vd=jt(Eg(),1),Bo=e=>Re.Type.Union([e,Re.Type.Null()]);var Kd=/^(k51qz|baguq)[0-9a-z]{56,57}$/,kA=/^[0-9A-Fa-f]{7,8}$/g;Re.FormatRegistry.Set("EntityID",e=>!!e.match(kA)||!!e.match(Kd));var ru=Re.Type.String();Re.FormatRegistry.Set("CID",e=>!!e.match(Kd));var ko=Re.Type.String({format:"CID"}),MA=/^http([s]?):\/\/.*\..*/;Re.FormatRegistry.Set("URL",e=>!!e.match(MA));var DA=Re.Type.String({format:"URL"}),zd=Re.Type.Object({en:ru,at:Re.Type.String(),vl:Bo(Re.Type.Union([Re.Type.String(),Re.Type.Boolean(),Re.Type.Number()])),ts:Re.Type.String(),ag:Re.Type.String(),pv:ko}),xa=Vd.TypeCompiler.Compile(zd);var jA=xa.Check.bind(xa),qd=Re.Type.Object({cid:ko,en:ru,at:Re.Type.String(),vl:Bo(Re.Type.Union([Re.Type.String(),Re.Type.Boolean(),Re.Type.Number()])),ts:Re.Type.String(),ag:Re.Type.String(),pv:Bo(ko)}),Mo=Vd.TypeCompiler.Compile(qd),Gd=e=>Array.from(Mo.Errors(e)),nu=Mo.Check.bind(Mo),{WARN:Hd,LOG:zS,DEBUG:LA,VERBOSE:qS,ERROR:si}=Se.setup(Se.INFO);function Wd(e,{ts:t,threadForPv:r}={}){let n=Xd(e,t??tu()),i=Yd(n,r),s=ta(i).toString();e.cid&&e.cid!==s&&Hd("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(!nu(o))throw si(`Bogus Applog ${JSON.stringify(o)}`,Gd(o));return Object.freeze(o)}function Jd(e){return!!e.ts}function Xd(e,t){return Jd(e)?e:{...e,ts:t}}function Yd(e,t){if(t){let{en:r,at:n}=e,i=Tr(t,{en:r,at:n});if(i.size>1)throw si("[withPvFrom] unexpected previous count:",i.size,{log:e,prevLogs:i,thread:t});let s=i.isEmpty?null:i.applogs[0],o=s?.cid===e.pv;if(Md(e,s,["en","at","vl","ts","ag"]))throw si("[withPvFrom] Same as previous:",{log:e,pv:s,thread:t});e.pv&&!o&&Hd("[withPvFrom] different than pre-set pv:",{queriedPv:s,logPv:e.pv});let a=(e.pv!==void 0?e.pv:s?.cid)??null;return{...e,pv:a}}else{if(e.pv===void 0)throw si("[withPvFrom] no thread and no pv:",e);return e}}function Do(e){let t=()=>(Be(()=>e.length<2&&LA(`joinThreads with count=${e.length}`)),Jr(Za(e.flatMap(i=>{let s=i.applogs;if(!s)throw si("falsy applogs of thread",i),new Error("falsy applogs of thread");return s})))),r=Be(()=>t()),n=Ot(function(i,s){return rr(i)?{init:Be(()=>t())}:{added:i.added.filter(o=>!this.hasApplog(o,!0)),removed:i.added.filter(o=>!this.parents.some(a=>a===s?!1:a.hasApplog(o,!0)))}});return new rs(Be(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:hl,LOG:GS,DEBUG:ml,VERBOSE:Lr,ERROR:FA}=Se.setup(Se.INFO),rs=class extends qa{constructor(e,t,r,n,i){super(e,t,r,ke.array([...n],{deep:!1,name:`${e}.array`})),this.name=e,this._initialLogs=n,this._eventMapper=i,xn(this,{onParentUpdate:Ot}),this.subscribeToParents()}_parentSubscriptions=new Map;subscribeToParents(){let e=qt(()=>{this.parents.length||hl("MappedThread has no parents",this),Lr(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(r=>r.name));let t=new Set([...this._parentSubscriptions.keys()]);for(let r of this.parents){t.delete(r)&&Lr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),Lr(`[MappedThread: ${this.name}] sub to new parent`,r.nameAndSizeUntracked);let i=this.onParentUpdate.bind(this,r),s=r.subscribe(i);this._parentSubscriptions.set(r,s)}for(let r of t)Lr(`[MappedThread: ${this.name}] un-subscribing from old parent`,r.nameAndSizeUntracked),this._parentSubscriptions.get(r)(),this._parentSubscriptions.delete(r)})}triggerRemap(){ml(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&hl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(e=>{this.onParentUpdate(e,{init:Be(()=>_n(e.applogs))})})}onParentUpdate(e,t){Lr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,t);let r=this._eventMapper(t,e);if(Lr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),rr(r))this._applogs.replace([...r.init]);else{for(let n of r.added)this._applogs.splice(RA(this._applogs,n,"ts"),0,n);if(r.removed){for(let n of r.removed)if(!this._applogs.remove(n))if(!rr(t)&&t.removed?.includes(n))ml("Ignoring remove event for non-existent because it was part of parent event's removed",n,t);else throw FA(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,n,{thread:this,event:t,mapResult:r})}}Lr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Xo(this._applogs)),this.notifySubscribers(r)}},{WARN:HS,LOG:WS,DEBUG:JS,VERBOSE:fa,ERROR:VA}=Se.setup(Se.INFO),Tr=nt("rollingFilter",function(t,r,n={}){let i=Zd(r),s=Na(i),o=ke.array(Be(()=>s(t.applogs)),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${Wr(i)}}`}`}),a=g=>{let k;return rr(g)?k={init:s(g.init)}:k={added:s(g.added),removed:g.removed},fa(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",k),k},f=new rs(`${t.name} | ${n.name||`rollingFilter{${Wr(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,a),c=Yb(()=>JSON.parse(JSON.stringify(r)),g=>{fa(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=Na(i),f.triggerRemap()}),y=Ti(o,()=>{fa(`rollingFilter<${Be(()=>t.name)}>${n.name?` '${n.name}'`:""} unobserve`,i),c(),y()});return f},{equals:Ii,argsDebugName:(e,t,r)=>Qe({caller:"rollingFilter",thread:e,pattern:t,args:r})}),Qd=nt("rollingMapper",function(t,r,n={}){let i=Be(()=>r.call(null,{init:t.applogs},t));if(!rr(i))throw VA("Initial run must return init event");let s=i.init;return new rs(`${t.name} | ${n.name||"rollingMapper"}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],s,r)},{equals:Ii,argsDebugName:(e,t,r)=>Qe({caller:"rollingMapper",thread:e,args:r})}),KA=nt("rollingAcc",function(t,r,n,i={}){return n=Ot(n),n({init:t.applogs},r),t.subscribe(s=>{n(s,r)}),r},{argsDebugName:(e,t,r,n)=>`rollingAcc{${e.nameAndSizeUntracked}${n?.name?` | ${n?.name}`:""}}`}),Zd=function(t){let r=Be(()=>Object.fromEntries(Object.entries(_n(t)).map(([n,i])=>[_n(n),_n(i)])));if(!Object.entries(r).length)throw new Error("Pattern is empty");return r};function Na(e){return t=>t.filter(r=>{for(let[n,i]of Object.entries(e)){let s=r[n.startsWith("!")?n.slice(1):n];if(!Ld(n,i,s))return!1}return!0})}var zA=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,xn(this,{threadOfTrail:Ge})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?Do([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},ep=class{constructor(e){this.nodes=e,xn(this,{threadOfAllTrails:Ge,size:Ge,isEmpty:Ge})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Be(()=>this.records.length)}get records(){return Zt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return Do(Zt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogs(){return Zt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return Do(Zt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:XS,LOG:hi,DEBUG:Or,VERBOSE:xe,ERROR:jo}=Se.setup(Se.INFO,{prefix:"[q]"}),qA=nt("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:r,tolerateAlreadyFiltered:n}={}){if(xe(`lastWriteWins${r?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(n)return Or("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw jo("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Qd(t,function(o,a){let f=rr(o),c,y=[],g=f?null:[];f?(i=new Map,c=o.init):c=o.added;let k;for(let U=r?0:c.length-1;r?U<c.length:U>=0;r?U++:U--){let j=c[U],te=Wr([j.en,j.at]);if(k&&(r?k>j.ts:k<j.ts))throw jo("lastWriteWins.mapper logs not sorted:",k,r?">":"<",j.ts,{log:j,i:U,newLogs:c,inverseToOnlyReturnFirstLogs:r});k=j.ts;let W=i.get(te);(!W||(r?W.ts>j.ts:W.ts<j.ts))&&(W&&!f&&g.push(W),y.push(j),i.set(te,j))}return Jr(y),xe.isDisabled||xe(`lastWriteWins${r?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,f?{...Object.fromEntries(Object.entries(o).map(([U,j])=>[U,j?.length])),toAdd:y.length,toRemove:g}:{...o,toAdd:y,toRemove:g}),f?{init:y}:{added:y,removed:g}},{name:`lastWriteWins${r?".inversed":""}`,extraFilterName:"lastWriteWins"});return xe.isDisabled||qt(()=>{xe(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,s.applogs.length)}),s},{equals:Ii,argsDebugName:e=>Qe({caller:"lastWriteWins",thread:e})}),YS=nt("withoutDeleted",function(t){if(xe(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw jo("thread already filtered withoutDeleted:",t.filters,{name:t.name});let r=Tr(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});xe(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Be(()=>[...r.applogs]));let n=Qe({caller:"allDeletedEntities",thread:t}),i=Zt(()=>r.map(s=>s.en),{name:n});return xe.isDisabled||qt(()=>{xe(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),Tr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Ii}),GA=nt("query",function e(t,r,n={},i={}){Or(`query<${t.nameAndSizeUntracked}>:`,r);let s=Array.isArray(r)?r:[r],o;if(s.length===1)o=null;else{let c=s.slice(0,-1);o=e(t,c,n,i)}let a=s[s.length-1],f=HA(t,o,a,i);return xe.isDisabled||qt(()=>xe("query result:",_n(f))),f},{equals:za,argsDebugName:(e,t,r)=>Qe({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),HA=nt("queryStep",function(t,r,n,i={}){if(Or(`queryStep<${t.nameAndSizeUntracked}> with`,r?.untrackedSize??"all","nodes, pattern:",n),!Object.entries(n).length)throw new Error("Pattern is empty");function s(a){let[f,c]=eu(n,a?.variables??{});xe("[queryStep.doQuery] patternWithoutVars: ",f);let y=Tr(t,f),g=tp(c),k=Zt(()=>{let U=y.map(j=>({log:j,vars:g(j)}));return xe.isEnabled&&xe("[queryStep.doQuery] step node:",a?.variables," =>",U,"from:",Be(()=>y.applogs)),U.map(({log:j,vars:te})=>{let W=Object.assign({},a?.variables,te);return new zA(ns.fromArray([j],Qe({caller:"QueryNode",thread:y,pattern:`${Wr(W)}@${Wr(f)}`}),!0),W,a)})},{name:Qe({caller:"doQuery.mapNodes",thread:y,pattern:n})});return xe.isEnabled&&qt(()=>xe("[queryStep.doQuery] resultNodes:",[...k])),i.debug&&hi("[queryStep] step result:",Be(()=>k.map(({variables:U,logsOfThisNode:j})=>({variables:U,thread:j.applogs})))),k}let o=Zt(()=>(Or(`[queryStep] Running with ${r?.nodes?.length} input nodes:`),r?[...r.nodes.flatMap(s)]:[...s(null)]),{name:Qe({caller:"queryStep",thread:t,pattern:n})});return xe.isEnabled&&qt(()=>xe("[queryStep] observableResultNodes:",[...o])),new ep(o)},{equals:za,argsDebugName:(e,t,r)=>Qe({caller:"queryStep",thread:e,pattern:r})}),QS=nt("queryNot",function(t,r,n,i={}){let s=r.nodes;Or(`queryNot<${t.nameAndSizeUntracked}> from: ${s.length} nodes`);let o=Array.isArray(n)?n:[n];for(let a of o){if(!Object.entries(n).length)throw new Error("Pattern is empty");s=s.filter(({variables:f})=>{let[c,y]=eu(a,f??{});xe("[queryNot] patternWithoutVars: ",c);let g=Tr(t,c);return xe("[queryNot] step node:",f," =>",g.size,"applogs"),xe.isDisabled||xe("[queryNot] step node:",f," => empty?",Be(()=>g.applogs)),i.debug&&hi("[queryNot] node result:",f,"=>",g.applogs),g.isEmpty})}return new ep(s)},{equals:za,argsDebugName:(e,t,r)=>Qe({caller:"queryNot",thread:e,pattern:r})}),ZS=nt("filterAndMap",function(t,r,n){Or(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=Tr(t,r);xe("[filterAndMap] filtered:",i.untrackedSize),xe.isDisabled||qt(()=>xe("[filterAndMap] filtered:",i.applogs));let s=function(){return typeof n=="function"?i.map(n):typeof n=="string"?i.map(c=>c[n]):i.map(tp(n))},o=Qe({thread:t,pattern:r,caller:"filterAndMap"}),a=Zt(s,{name:o});return xe.isDisabled||qt(()=>xe("[filterAndMap] mapped:",a)),a},{equals:rt.structural,argsDebugName:(e,t)=>Qe({caller:"filterAndMap",thread:e,pattern:t})}),ex=nt("queryAndMap",function(t,r,n,i={}){Or(`queryAndMap<${t.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let s=Qe({thread:t,caller:"queryAndMap"}),o=GA(t,r);xe("[queryAndMap] filtered count:",o.untrackedSize);let a=Zt(()=>{if(typeof n=="function")return o.records.map(n);if(typeof n=="string")return o.records.map(f=>f[n]);throw new Error("what's this map param about?")},{name:s});return xe.isDisabled||qt(()=>xe("[queryAndMap] result:",_n(a))),a},{equals:rt.structural,argsDebugName:(e,t)=>Qe({caller:"queryAndMap",thread:e,pattern:t})}),tx=nt("queryEntity",function(t,r,n,i){Or(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let s=Tr(t,{en:n,at:JA(r,i)});return xe("queryEntity applogs:",s.applogs),Ge(()=>s.isEmpty?null:Object.fromEntries(s.map(({at:o,vl:a})=>[o.slice(r.length+1),a])))},{equals:xv,argsDebugName:(e,t,r)=>Qe({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),rx=nt("agentsOfThread",function(t){hi(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=ke.map(),n=Ot(s=>{for(let o of rr(s)?s.init:s.added){let a=r.get(o.ag)??0;r.set(o.ag,a+1)}for(let o of!rr(s)&&s.removed||[]){let a=r.get(o.ag);if(!a||a<1)throw jo("[agentsOfThread] number is now negative",{log:o,event:s,mapped:r,prev:a});r.set(o.ag,a-1)}hi(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:s,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return Ql(r,i),r}),WA=nt("entityOverlap",function(t,r){return hi(`entityOverlap<${t.nameAndSizeUntracked}, ${r.nameAndSizeUntracked}>`),Ge(()=>{let n=new Set(t.map(s=>s.en)),i=new Set(r.map(s=>s.en));return[...n].filter(s=>i.has(s))})});var nx=nt("entityOverlapCount",function(t,r){return Ge(()=>WA(t,r).get().length)});function tp(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function JA(e,t){return t.map(r=>XA(e,r))}function XA(e,t){return`${e}/${t}`}var{WARN:YA,LOG:QA,DEBUG:ix,VERBOSE:ZA,ERROR:Oo}=Se.setup(Se.INFO),rp=class extends qa{constructor(e,t=[],r){super(e,null,r,t),xn(this,{})}insert(e){let t=tu(),r=qA(this),n=e.map(i=>Wd(i,{ts:t,threadForPv:r}));return this.insertRaw(n)}insertRaw(e){let t=Za(e);if(t.length!==e.length)throw Oo(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let r=e.filter(s=>!nu(s));if(r.length)throw Oo(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});let n=e.filter(s=>this.hasApplog(s,!1));if(n.length)throw Oo(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(!e.length){YA("[insertRaw] skipping empty insert empty logs array");return}QA("Inserting:",e.length===1?e[0]:e,{ds:this}),Jr(e);let i=this._applogs.length&&kd(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&Jr(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},ns=class $a extends rp{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,xn(this,{_applogs:ke.shallow})}static empty(t){return $a.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new $a(r??"in-memory",t,[],n)}get readOnly(){return this._readOnly}persist(t){if(ZA("[InMem.persist] no persist for",t),this.readOnly)throw Oo("[persist] called for readOnly thread")}};var e1=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=o;var r=128,n=127,i=~n,s=Math.pow(2,31);function o(a,f,c){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw o.bytes=0,new RangeError("Could not encode varint");f=f||[],c=c||0;for(var y=c;a>=s;)f[c++]=a&255|r,a/=128;for(;a&i;)f[c++]=a&255|r,a>>>=7;return f[c]=a|0,o.bytes=c-y+1,f}}}),t1=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var r=128,n=127;function i(s,f){var a=0,f=f||0,c=0,y=f,g,k=s.length;do{if(y>=k||c>49)throw i.bytes=0,new RangeError("Could not decode varint");g=s[y++],a+=c<28?(g&n)<<c:(g&n)*Math.pow(2,c),c+=7}while(g>=r);return i.bytes=y-f,a}}}),r1=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),s=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),f=Math.pow(2,49),c=Math.pow(2,56),y=Math.pow(2,63);t.exports=function(g){return g<r?1:g<n?2:g<i?3:g<s?4:g<o?5:g<a?6:g<f?7:g<c?8:g<y?9:10}}}),uu=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:e1(),decode:t1(),encodingLength:r1()}}}),n1=42;function i1(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ut.decode(e.subarray(1))}var op={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};op.tags[n1]=i1;var o1=e=>Ys(e,op),tn=jt(uu(),1),iu={SHA2_256:18,LENGTH:32,DAG_PB:112},s1=40;function is(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=tn.default.decode(e);return t.seek(tn.default.decode.bytes),r}function a1(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}function u1(e){tn.default.decode(e);let t=tn.default.decode.bytes,r=tn.default.decode(e.subarray(tn.default.decode.bytes)),n=tn.default.decode.bytes;return t+n+r}var Ir={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},Si={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ir.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ir.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Si["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=Si["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:Ir.Int,CarV1HeaderOrV2Pragma:e=>{if(Ir.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=Si["CarV1HeaderOrV2Pragma > roots (anon)"](e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=Si.Int(e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},xi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ir.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ir.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=xi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=xi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:Ir.Int,CarV1HeaderOrV2Pragma:e=>{if(Ir.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=xi["CarV1HeaderOrV2Pragma > roots (anon)"](o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.roots=a}}break;case"version":{n--;let a=xi.Int(o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let f=0;f<i;f++)r[t[f][0]]=t[f][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},c1={toTyped:Si.CarV1HeaderOrV2Pragma,toRepresentation:xi.CarV1HeaderOrV2Pragma},Wx=Xs(),Jx=jt(uu(),1),Xx=[new Z(C.map,2),new Z(C.string,"version"),new Z(C.uint,1),new Z(C.string,"roots")],Yx=new Z(C.tag,42);async function sp(e,t){let r=is(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=o1(n);if(c1.toTyped(i)===void 0)throw new Error("Invalid CAR header format");if(i.version!==1&&i.version!==2||t!==void 0&&i.version!==t)throw new Error(`Invalid CAR version: ${i.version}${t!==void 0?` (expected ${t})`:""}`);if(i.version===1){if(!Array.isArray(i.roots))throw new Error("Invalid CAR header format");return i}if(i.roots!==void 0)throw new Error("Invalid CAR header format");let s=a1(await e.exactly(s1,!0));e.seek(s.dataOffset-e.pos);let o=await sp(e,1);return Object.assign(o,s)}async function f1(e){let t=await e.exactly(2,!1);if(t[0]===iu.SHA2_256&&t[1]===iu.LENGTH){let o=await e.exactly(34,!0),a=ti(o);return Ut.create(0,iu.DAG_PB,a)}let r=is(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=is(await e.upTo(8),e),i=await e.exactly(u1(await e.upTo(8)),!0),s=ti(i);return Ut.create(r,n,s)}async function ap(e){let t=e.pos,r=is(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await f1(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function l1(e){let{cid:t,blockLength:r}=await ap(e);return{bytes:await e.exactly(r,!0),cid:t}}async function d1(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await ap(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function up(e){let t=(async()=>{let r=await sp(e);if(r.version===2){let n=e.pos-r.dataOffset;e=y1(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await l1(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await d1(e)}}}function cp(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let i=e.subarray(t,t+r);return n&&(t+=r),i},seek(r){t+=r},get pos(){return t}}}function p1(e){let t=0,r=0,n=0,i=new Uint8Array(0),s=async o=>{r=i.length-n;let a=[i.subarray(n)];for(;r<o;){let c=await e();if(c==null)break;r<0?c.length>r&&a.push(c.subarray(-r)):a.push(c),r+=c.length}i=new Uint8Array(a.reduce((c,y)=>c+y.length,0));let f=0;for(let c of a)i.set(c,f),f+=c.length;n=0};return{async upTo(o){return i.length-n<o&&await s(o),i.subarray(n,n+Math.min(i.length-n,o))},async exactly(o,a=!1){if(i.length-n<o&&await s(o),i.length-n<o)throw new Error("Unexpected end of data");let f=i.subarray(n,n+o);return a&&(t+=o,n+=o),f},seek(o){t+=o,n+=o},get pos(){return t}}}function fp(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return p1(r)}function y1(e,t){let r=0;return{async upTo(n){let i=await e.upTo(n);return i.length+r>t&&(i=i.subarray(0,t-r)),i},async exactly(n,i=!1){let s=await e.exactly(n,i);if(s.length+r>t)throw new Error("Unexpected end of data");return i&&(r+=n),s},seek(n){r+=n,e.seek(n)},get pos(){return e.pos}}}var h1=class{constructor(e,t,r){this._version=e,this._roots=t,this._iterator=r}get version(){return this._version}async getRoots(){return this._roots}[Symbol.asyncIterator](){return this._iterator}static async fromBytes(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return np(cp(e))}static async fromIterable(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return np(fp(e))}};async function np(e){let t=up(e),{version:r,roots:n}=await t.header();return new h1(r,n,t.blocksIndex())}var lp=class{constructor(e,t,r){this._version=e,this._roots=t,this._iterable=r,this._decoded=!1}get version(){return this._version}async getRoots(){return this._roots}},Qx=class su extends lp{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");return this._decoded=!0,this._iterable[Symbol.asyncIterator]()}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await dp(t);return new su(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await pp(t);return new su(r,n,i)}},Zx=class au extends lp{[Symbol.asyncIterator](){if(this._decoded)throw new Error("Cannot decode more than once");if(!this._iterable)throw new Error("Block iterable not found");this._decoded=!0;let t=this._iterable[Symbol.asyncIterator]();return{async next(){let r=await t.next();return r.done?r:{done:!1,value:r.value.cid}}}}static async fromBytes(t){let{version:r,roots:n,iterator:i}=await dp(t);return new au(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await pp(t);return new au(r,n,i)}};async function dp(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return yp(cp(e))}async function pp(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return yp(fp(e))}async function yp(e){let t=up(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var eN=jt(uu(),1);var tN=class{constructor(e){this._iterator=e}[Symbol.asyncIterator](){if(this._iterating)throw new Error("Multiple iterator not supported");return this._iterating=!0,this._iterator}};var{WARN:m1,LOG:rN,DEBUG:ou,VERBOSE:nN,ERROR:ip}=Se.setup(Se.INFO);async function cu(e){let{roots:t,blocks:r}=await hp(e);if(!t||!r)throw ip("decodeCar is funky",{roots:t,blocks:r});t.length!==1&&m1("Unexpected roots count:",t);let n=r.get(t[0]),i;ou("root:",n,{blocks:r}),n.info?(i=r.get(n.applogs.toString()).logs,ou("new format - infoLogs",r.get(n.info.toString()))):i=n.applogs;let s;return s=i.map(o=>{let a=o.toV1?o.toV1().toString():o["/"],f=r.get(a);if(!f)throw ip("Could not find applog CID in Car file:",a,{root:n,blocks:r}),new Error(`Could not find applog CID in Car file: ${a.toString()}`);return f.pv instanceof Ut&&(f.pv=f.pv.toV1().toString()),{...f,cid:a}}),ou("Decoded car logs:",n,{roots:t,blocks:r,applogs:s}),{applogs:s}}async function hp(e){let t=(await e.getRoots()).map(n=>n.toV1().toString()),r=new Map;for await(let{cid:n,bytes:i}of e.blocks())r.set(n.toV1().toString(),lo(i));return{roots:t,blocks:r}}function fu(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}()}var{WARN:os,LOG:MN,DEBUG:Ni,VERBOSE:DN,ERROR:$i}=ls.setup(ls.DEBUG),g1=["https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all","https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all"];async function jN(e,{readOnly:t=!0,pinnedCID:r}={}){let{cid:n,errors:i,isIpns:s}=na(e);if(!n)throw $i("Failed to parse pubID",e,i);Ni("[retrieveThread] parsedPubID",n);let o;if(!s)Ni("[retrieveThread] pubID is not IPNS - using as CID"),o=n;else if(r)Ni("[retrieveThread] using pinnedCID"),o=xt.parse(r);else{if(!e)throw $i("[retrieveThread] neither pubID nor pinnedCID provided");try{o=await b1(e),Ni("Resolved pub to CID",o.toString())}catch(k){throw $i(`Failed to resolve IPNS ${e}:`,k)}}let a=await v1(o),{applogs:f}=await cu(a),c=f.filter(k=>k instanceof Uint8Array);c.length&&os(`Found ${c.length} encrypted logs - skipping`);let y=f.filter(k=>!(k instanceof Uint8Array));Jr(y);let g=ns.fromArray(y,`preview${e&&e!==o.toString()?"-"+e:""}@${o.toString()}`,t);return{cid:o,thread:g,encryptedCount:c.length}}async function b1(e){let r=await(await fetch(`https://name.web3.storage/name/${e}`)).json();return r.value.startsWith("/ipfs/")||os("IPNS value is not '/ipfs/..':",r),xt.parse(r.value.replace("/ipfs/",""))}async function v1(e){Ni("Retrieving:",e);let t;for(let r of g1){let n=r.replaceAll("CID",e.toString()),i=await fetch(n);(!i?.ok||!i?.body)&&(t=$i(`[retrieveCar] unexpected response ${i?.statusText}`,{url:n}),os("Gateway failed:",n,t)),t=fu(i.body.getReader())}if(t instanceof Error)throw t;return(await _1(t)).car}async function _1(e){let t=cr(fr(e)),r=await t.header(),n=[],i=!1;try{for await(let s of t.blocks())n.push(s);i=!0}catch(s){if($i("Failed to read car:",s,{blocks:n,header:r}),n.length===0)throw s;os(`Returning half-baked car with ${n.length} blocks`)}return{complete:i,car:new Pr(r,n)}}export{jN as a,b1 as b,v1 as c};
60
+ /*! Bundled license information:
61
+
62
+ @noble/hashes/esm/utils.js:
63
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
64
+ */
65
+ /*! Bundled license information:
66
+
67
+ lodash-es/lodash.js:
68
+ (**
69
+ * @license
70
+ * Lodash (Custom Build) <https://lodash.com/>
71
+ * Build: `lodash modularize exports="es" -o ./`
72
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
73
+ * Released under MIT license <https://lodash.com/license>
74
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
75
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
76
+ *)
77
+ */
78
+ //# sourceMappingURL=chunk-DEC6G2QE.min.js.map