@wovin/connect-nftstorage 0.0.7 → 0.0.9-RC1

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 Bi,d as us,e as cs,f as ki,g as ht}from"./chunk-SOBCOB7T.min.js";var hc=Bi((II,yc)=>{"use strict";yc.exports=vs;var pc=128,ty=127,ry=~ty,ny=Math.pow(2,31);function vs(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw vs.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=ny;)t[r++]=e&255|pc,e/=128;for(;e&ry;)t[r++]=e&255|pc,e>>>=7;return t[r]=e|0,vs.bytes=r-n+1,t}});var bc=Bi((EI,gc)=>{"use strict";gc.exports=_s;var iy=128,mc=127;function _s(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a||i>49)throw _s.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&mc)<<i:(o&mc)*Math.pow(2,i),i+=7}while(o>=iy);return _s.bytes=s-n,r}});var _c=Bi((SI,vc)=>{"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);vc.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 Ji=Bi((xI,wc)=>{"use strict";wc.exports={encode:hc(),decode:bc(),encodingLength:_c()}});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 cu(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 Mi(e){return sn&&globalThis.Buffer.isBuffer(e)}function pu(e){return e instanceof Uint8Array?Mi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var yu=sn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):lu(e,t,r):(e,t,r)=>r-t>64?xp.decode(e.subarray(t,r)):lu(e,t,r),hu=sn?e=>e.length>64?globalThis.Buffer.from(e):fu(e):e=>e.length>64?Np.encode(e):fu(e);var an=sn?(e,t,r)=>Mi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),mu=sn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),pu(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},gu=sn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function bu(e,t){if(Mi(e)&&Mi(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 fu(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 lu(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 du=4096;function $p(e){let t=e.length;if(t<=du)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=du));return r}var Cp=256,Di=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=gu(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=mu(this.chunks,this.cursor);return t&&this.reset(),r}};var ve="CBOR decode error:",fs="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 ot(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 st(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 at(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 ut(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 vu(e,t,r,n){return new ce(L.uint,ot(e,t+1,n),2)}function _u(e,t,r,n){return new ce(L.uint,st(e,t+1,n),3)}function wu(e,t,r,n){return new ce(L.uint,at(e,t+1,n),5)}function Tu(e,t,r,n){return new ce(L.uint,ut(e,t+1,n),9)}function mt(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`)}}mt.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};mt.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Ou(e,t,r,n){return new ce(L.negint,-1-ot(e,t+1,n),2)}function Au(e,t,r,n){return new ce(L.negint,-1-st(e,t+1,n),3)}function Iu(e,t,r,n){return new ce(L.negint,-1-at(e,t+1,n),5)}var ls=BigInt(-1),Eu=BigInt(1);function Su(e,t,r,n){let i=ut(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,ls-BigInt(i),9)}function ji(e,t){let r=t.value,n=typeof r=="bigint"?r*ls-Eu:r*-1-1;ze(e,t.type.majorEncoded,n)}ji.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*ls-Eu:r*-1-1;return n<Ke[0]?1:n<Ke[1]?2:n<Ke[2]?3:n<Ke[3]?5:9};ji.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 xu(e,t,r,n){return jn(e,t,1,r)}function Nu(e,t,r,n){return jn(e,t,2,ot(e,t+1,n))}function $u(e,t,r,n){return jn(e,t,3,st(e,t+1,n))}function Cu(e,t,r,n){return jn(e,t,5,at(e,t+1,n))}function Pu(e,t,r,n){let i=ut(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 Li(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===L.string?hu(e.value):e.value),e.encodedBytes}function un(e,t){let r=Li(t);ze(e,t.type.majorEncoded,r.length),e.push(r)}un.encodedSize=function(t){let r=Li(t);return ze.encodedSize(r.length)+r.length};un.compareTokens=function(t,r){return Rp(Li(t),Li(r))};function Rp(e,t){return e.length<t.length?-1:e.length>t.length?1:bu(e,t)}function Ln(e,t,r,n,i){let s=r+n;Xt(e,t,s);let o=new ce(L.string,yu(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=an(e,t+r,t+s)),o}function Ru(e,t,r,n){return Ln(e,t,1,r,n)}function Uu(e,t,r,n){return Ln(e,t,2,ot(e,t+1,n),n)}function Bu(e,t,r,n){return Ln(e,t,3,st(e,t+1,n),n)}function ku(e,t,r,n){return Ln(e,t,5,at(e,t+1,n),n)}function Mu(e,t,r,n){let i=ut(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 Du=un;function cn(e,t,r,n){return new ce(L.array,n,r)}function ju(e,t,r,n){return cn(e,t,1,r)}function Lu(e,t,r,n){return cn(e,t,2,ot(e,t+1,n))}function Fu(e,t,r,n){return cn(e,t,3,st(e,t+1,n))}function Vu(e,t,r,n){return cn(e,t,5,at(e,t+1,n))}function Ku(e,t,r,n){let i=ut(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 zu(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 Fi(e,t){ze(e,L.array.majorEncoded,t.value)}Fi.compareTokens=mt.compareTokens;Fi.encodedSize=function(t){return ze.encodedSize(t.value)};function fn(e,t,r,n){return new ce(L.map,n,r)}function qu(e,t,r,n){return fn(e,t,1,r)}function Gu(e,t,r,n){return fn(e,t,2,ot(e,t+1,n))}function Hu(e,t,r,n){return fn(e,t,3,st(e,t+1,n))}function Wu(e,t,r,n){return fn(e,t,5,at(e,t+1,n))}function Ju(e,t,r,n){let i=ut(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 Xu(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 Vi(e,t){ze(e,L.map.majorEncoded,t.value)}Vi.compareTokens=mt.compareTokens;Vi.encodedSize=function(t){return ze.encodedSize(t.value)};function Yu(e,t,r,n){return new ce(L.tag,r,1)}function Qu(e,t,r,n){return new ce(L.tag,ot(e,t+1,n),2)}function Zu(e,t,r,n){return new ce(L.tag,st(e,t+1,n),3)}function ec(e,t,r,n){return new ce(L.tag,at(e,t+1,n),5)}function tc(e,t,r,n){return new ce(L.tag,ut(e,t+1,n),9)}function Ki(e,t){ze(e,L.tag.majorEncoded,t.value)}Ki.compareTokens=mt.compareTokens;Ki.encodedSize=function(t){return ze.encodedSize(t.value)};var jp=20,Lp=21,Fp=22,Vp=23;function rc(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 nc(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 ds(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 ic(e,t,r,n){return ds(ps(e,t+1),3,n)}function oc(e,t,r,n){return ds(ys(e,t+1),5,n)}function sc(e,t,r,n){return ds(fc(e,t+1),9,n)}function zi(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)&&(uc(n),i=ps(Nt,1),n===i||Number.isNaN(n)?(Nt[0]=249,e.push(Nt.slice(0,3)),s=!0):(cc(n),i=ys(Nt,1),n===i&&(Nt[0]=250,e.push(Nt.slice(0,5)),s=!0))),s||(Kp(n),i=fc(Nt,1),Nt[0]=251,e.push(Nt.slice(0,9)))}}zi.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){uc(n);let i=ps(Nt,1);if(n===i||Number.isNaN(n))return 3;if(cc(n),i=ys(Nt,1),n===i)return 5}return 9};var ac=new ArrayBuffer(9),gt=new DataView(ac,1),Nt=new Uint8Array(ac,0);function uc(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 ps(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 cc(e){gt.setFloat32(0,e,!1)}function ys(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){gt.setFloat64(0,e,!1)}function fc(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)}zi.compareTokens=mt.compareTokens;function Oe(e,t,r){throw new Error(`${ve} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function qi(e){return()=>{throw new Error(`${ve} ${e}`)}}var ae=[];for(let e=0;e<=23;e++)ae[e]=Oe;ae[24]=vu;ae[25]=_u;ae[26]=wu;ae[27]=Tu;ae[28]=Oe;ae[29]=Oe;ae[30]=Oe;ae[31]=Oe;for(let e=32;e<=55;e++)ae[e]=Oe;ae[56]=Ou;ae[57]=Au;ae[58]=Iu;ae[59]=Su;ae[60]=Oe;ae[61]=Oe;ae[62]=Oe;ae[63]=Oe;for(let e=64;e<=87;e++)ae[e]=xu;ae[88]=Nu;ae[89]=$u;ae[90]=Cu;ae[91]=Pu;ae[92]=Oe;ae[93]=Oe;ae[94]=Oe;ae[95]=qi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ae[e]=Ru;ae[120]=Uu;ae[121]=Bu;ae[122]=ku;ae[123]=Mu;ae[124]=Oe;ae[125]=Oe;ae[126]=Oe;ae[127]=qi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ae[e]=ju;ae[152]=Lu;ae[153]=Fu;ae[154]=Vu;ae[155]=Ku;ae[156]=Oe;ae[157]=Oe;ae[158]=Oe;ae[159]=zu;for(let e=160;e<=183;e++)ae[e]=qu;ae[184]=Gu;ae[185]=Hu;ae[186]=Wu;ae[187]=Ju;ae[188]=Oe;ae[189]=Oe;ae[190]=Oe;ae[191]=Xu;for(let e=192;e<=215;e++)ae[e]=Yu;ae[216]=Qu;ae[217]=Zu;ae[218]=ec;ae[219]=tc;ae[220]=Oe;ae[221]=Oe;ae[222]=Oe;ae[223]=Oe;for(let e=224;e<=243;e++)ae[e]=qi("simple values are not supported");ae[244]=Oe;ae[245]=Oe;ae[246]=Oe;ae[247]=rc;ae[248]=qi("simple values are not supported");ae[249]=ic;ae[250]=oc;ae[251]=sc;ae[252]=Oe;ae[253]=Oe;ae[254]=Oe;ae[255]=nc;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 hs(){let e=[];return e[L.uint.major]=mt,e[L.negint.major]=ji,e[L.bytes.major]=un,e[L.string.major]=Du,e[L.array.major]=Fi,e[L.map.major]=Vi,e[L.tag.major]=Ki,e[L.float.major]=zi,e}var yI=hs(),hI=new Di,Hi=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(`${fs} object contains circular references`);return new e(r,t)}},sr={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)},ar={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?sr.true:sr.false},null(e,t,r,n){return sr.null},undefined(e,t,r,n){return sr.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?[sr.emptyArray,new ce(L.break)]:sr.emptyArray;n=Hi.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=Gi(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?[sr.emptyMap,new ce(L.break)]:sr.emptyMap;n=Hi.createCheck(n,e);let a=[],f=0;for(let c of s)a[f++]=[Gi(c,r,n),Gi(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]}};ar.Map=ar.Object;ar.Buffer=ar.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ar[`${e}Array`]=ar.DataView;function Gi(e,t={},r){let n=cu(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||ar[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=ar[n];if(!s)throw new Error(`${fs} 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},ms=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"),Wi=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===Wi){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===Wi){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 Wi;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 lc(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 ms(e,t),n=Vn(r,t);if(n===Fn)throw new Error(`${ve} did not find any content to decode`);if(n===Wi)throw new Error(`${ve} got unexpected break`);return[n,e.subarray(r.pos())]}function gs(e,t){let[r,n]=lc(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 ht.decode(e.subarray(1))}var dc={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};dc.tags[Qp]=Zp;var bs=e=>gs(e,dc);var ur=us(Ji(),1),Kn={SHA2_256:18,LENGTH:32,DAG_PB:112},ws=40;function ln(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=ur.default.decode(e);return t.seek(ur.default.decode.bytes),r}function Ts(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 Os(e){ur.default.decode(e);let t=ur.default.decode.bytes,r=ur.default.decode(e.subarray(ur.default.decode.bytes)),n=ur.default.decode.bytes;return t+n+r}var cr={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)":cr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(cr.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:cr.Int,CarV1HeaderOrV2Pragma:e=>{if(cr.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)":cr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(cr.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:cr.Int,CarV1HeaderOrV2Pragma:e=>{if(cr.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}},As={toTyped:zn.CarV1HeaderOrV2Pragma,toRepresentation:qn.CarV1HeaderOrV2Pragma};var jI=hs();var gy=us(Ji(),1);var zI=[new ce(L.map,2),new ce(L.string,"version"),new ce(L.uint,1),new ce(L.string,"roots")],qI=new ce(L.tag,42);async function Is(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=bs(n);if(As.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=Ts(await e.exactly(ws,!0));e.seek(s.dataOffset-e.pos);let o=await Is(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=ki(o);return ht.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(Os(await e.upTo(8)),!0),s=ki(i);return ht.create(r,n,s)}async function Tc(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 Tc(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 Tc(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function fr(e){let t=(async()=>{let r=await Is(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 lr(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 Oc(Cr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Oc(lr(t))}};async function Oc(e){let t=fr(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 Ac(Cr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Ac(lr(t))}};async function Ac(e){let t=fr(e),r=await t.header(),n=[];for await(let i of t.blocks())n.push(i);return new Pr(r,n)}var Xi=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}},Es=class e extends Xi{[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 Ic(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Ec(t);return new e(r,n,i)}},Ss=class e extends Xi{[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 Ic(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Ec(t);return new e(r,n,i)}};async function Ic(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return Sc(Cr(e))}async function Ec(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Sc(lr(e))}async function Sc(e){let t=fr(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var Ay=us(Ji(),1);var xc=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,xs=Object.defineProperty,Ey=Object.getOwnPropertyDescriptor,Nc=Object.getOwnPropertyNames,Sy=Object.getPrototypeOf,xy=Object.prototype.hasOwnProperty,Le=(e,t)=>function(){return t||(0,e[Nc(e)[0]])((t={exports:{}}).exports,t),t.exports},Ns=(e,t)=>{for(var r in t)xs(e,r,{get:t[r],enumerable:!0})},Ny=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nc(t))!xy.call(e,i)&&i!==r&&xs(e,i,{get:()=>t[i],enumerable:!(n=Ey(t,i))||n.enumerable});return e},Dt=(e,t,r)=>(r=e!=null?Iy(Sy(e)):{},Ny(t||!e||!e.__esModule?xs(r,"default",{value:e,enumerable:!0}):r,e));var $y={};Ns($y,{code:()=>af,decode:()=>fo,encode:()=>Ys,format:()=>jc,name:()=>Bm,parse:()=>Mm,stringify:()=>jc});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 Ry(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(Uy(e))return"Buffer";let r=By(e);return r||"Object"}function Uy(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 Zi(e){return dn&&globalThis.Buffer.isBuffer(e)}function Ms(e){return e instanceof Uint8Array?Zi(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"):Cc(e,t,r):(e,t,r)=>r-t>64?ky.decode(e.subarray(t,r)):Cc(e,t,r),Fc=dn?e=>e.length>64?globalThis.Buffer.from(e):$c(e):e=>e.length>64?My.encode(e):$c(e);var Ds=dn?(e,t,r)=>Zi(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)),Ms(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(Zi(e)&&Zi(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 $c(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 Cc(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 Vc(n)}var Pc=4096;function Vc(e){let t=e.length;if(t<=Pc)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Pc));return r}var Vy=256,Kc=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=Ds(r,0,this.cursor)}else t=jy(this.chunks,this.cursor);return e&&this.reset(),t}},he="CBOR decode error:",Rr="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 Ur(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,Ur(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 vt(e,0,t.value)}function vt(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 vt.encodedSize(t.value)};vt.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-Ur(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 js=BigInt(-1),zc=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,js-BigInt(i),9)}function Ls(e,t){let r=t.value,n=typeof r=="bigint"?r*js-zc:r*-1-1;vt(e,t.type.majorEncoded,n)}Ls.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*js-zc:r*-1-1;return n<qe[0]?1:n<qe[1]?2:n<qe[2]?3:n<qe[3]?5:9};Ls.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=Ds(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,Ur(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 eo(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===C.string?Fc(e.value):e.value),e.encodedBytes}function so(e,t){let r=eo(t);vt(e,t.type.majorEncoded,r.length),e.push(r)}so.encodedSize=function(t){let r=eo(t);return vt.encodedSize(r.length)+r.length};so.compareTokens=function(t,r){return rh(eo(t),eo(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=Ds(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,Ur(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,Ur(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 Fs(e,t){vt(e,C.array.majorEncoded,t.value)}Fs.compareTokens=Dr.compareTokens;Fs.encodedSize=function(t){return vt.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,Ur(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 Vs(e,t){vt(e,C.map.majorEncoded,t.value)}Vs.compareTokens=Dr.compareTokens;Vs.encodedSize=function(t){return vt.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,Ur(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 Ks(e,t){vt(e,C.tag.majorEncoded,t.value)}Ks.compareTokens=Dr.compareTokens;Ks.encodedSize=function(t){return vt.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 zs(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 zs(Gs(e,t+1),3,n)}function Rh(e,t,r,n){return zs(Hs(e,t+1),5,n)}function Uh(e,t,r,n){return zs(Wc(e,t+1),9,n)}function qs(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)&&(Gc(n),i=Gs(Pt,1),n===i||Number.isNaN(n)?(Pt[0]=249,e.push(Pt.slice(0,3)),s=!0):(Hc(n),i=Hs(Pt,1),n===i&&(Pt[0]=250,e.push(Pt.slice(0,5)),s=!0))),s||(Bh(n),i=Wc(Pt,1),Pt[0]=251,e.push(Pt.slice(0,9)))}}qs.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){Gc(n);let i=Gs(Pt,1);if(n===i||Number.isNaN(n))return 3;if(Hc(n),i=Hs(Pt,1),n===i)return 5}return 9};var qc=new ArrayBuffer(9),bt=new DataView(qc,1),Pt=new Uint8Array(qc,0);function Gc(e){if(e===1/0)bt.setUint16(0,31744,!1);else if(e===-1/0)bt.setUint16(0,64512,!1);else if(Number.isNaN(e))bt.setUint16(0,32256,!1);else{bt.setFloat32(0,e);let t=bt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)bt.setUint16(0,31744,!1);else if(r===0)bt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?bt.setUint16(0,0):i<-14?bt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):bt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Gs(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 Hc(e){bt.setFloat32(0,e,!1)}function Hs(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){bt.setFloat64(0,e,!1)}function Wc(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)}qs.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]=Rh;ue[251]=Uh;ue[252]=Ae;ue[253]=Ae;ue[254]=Ae;ue[255]=Ch;var Lt=[];for(let e=0;e<24;e++)Lt[e]=new Z(C.uint,e,1);for(let e=-1;e>=-24;e--)Lt[31-e]=new Z(C.negint,e,1);Lt[64]=new Z(C.bytes,new Uint8Array(0),1);Lt[96]=new Z(C.string,"",1);Lt[128]=new Z(C.array,0,1);Lt[160]=new Z(C.map,0,1);Lt[244]=new Z(C.false,!1,1);Lt[245]=new Z(C.true,!0,1);Lt[246]=new Z(C.null,null,1);function Ws(){let e=[];return e[C.uint.major]=Dr,e[C.negint.major]=Ls,e[C.bytes.major]=so,e[C.string.major]=uh,e[C.array.major]=Fs,e[C.map.major]=Vs,e[C.tag.major]=Ks,e[C.float.major]=qs,e}var $E=Ws(),$s=new Kc,Rc=class Jc{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(`${Rr} object contains circular references`);return new Jc(r,t)}},dr={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)},mr={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?dr.true:dr.false},null(e,t,r,n){return dr.null},undefined(e,t,r,n){return dr.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?[dr.emptyArray,new Z(C.break)]:dr.emptyArray;n=Rc.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=Yi(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?[dr.emptyMap,new Z(C.break)]:dr.emptyMap;n=Rc.createCheck(n,e);let a=[],f=0;for(let c of s)a[f++]=[Yi(c,r,n),Yi(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]}};mr.Map=mr.Object;mr.Buffer=mr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))mr[`${e}Array`]=mr.DataView;function Yi(e,t={},r){let n=Ry(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||mr[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=mr[n];if(!s)throw new Error(`${Rr} unsupported type: ${n}`);return s(e,n,t,r)}function kh(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Xc(e,t,r,n){if(Array.isArray(t))for(let i of t)Xc(e,i,r,n);else r[t.type.major](e,t,n)}function Mh(e,t,r){let n=Yi(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 Kc(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Ms(a.chunks[0])}}return $s.reset(),Xc($s,n,t,r),$s.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=Lt[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 Js(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(`${Rr} unsupported type: Uint8Array`)}[C.string.major](e,t){this.prefix(e);let r=Fc(JSON.stringify(t.value));e.push(r.length>32?Ms(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(`${Rr} 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(`${Rr} 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(`${Rr} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Rr} 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 Yc=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,Vc(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 Yc(e,t)},t),Js(e,t)}var CE=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},Xs=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 M(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 R(j){var te=M(j);if(te)return te;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:M,decode:R}}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 Qc(this,e)}},tm=class{constructor(e){this.decoders=e}or(e){return Qc(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`)}},Qc=(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)}},Zc=({name:e,prefix:t,encode:r,decode:n})=>new rm(e,t,r,n),ef=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=Qh(r,t);return Zc({prefix:e,name:t,encode:n,decode:s=>Xs(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},ct=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Zc({prefix:t,name:e,encode(i){return im(i,n,r)},decode(i){return nm(i,n,r,e)}}),Qi=ct({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),PE=ct({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),RE=ct({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),UE=ct({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),BE=ct({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),kE=ct({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ME=ct({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),DE=ct({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),jE=ct({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),hr=ef({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),LE=ef({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),tf={};Ns(tf,{Digest:()=>co,create:()=>io,decode:()=>ti,equals:()=>nf});var om=rf,Uc=128,sm=127,am=~sm,um=Math.pow(2,31);function rf(e,t,r){t=t||[],r=r||0;for(var n=r;e>=um;)t[r++]=e&255|Uc,e/=128;for(;e&am;)t[r++]=e&255|Uc,e>>>=7;return t[r]=e|0,rf.bytes=r-n+1,t}var cm=Rs,fm=128,Bc=127;function Rs(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Rs.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&Bc)<<i:(o&Bc)*Math.pow(2,i),i+=7}while(o>=fm);return Rs.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,to=Tm,Us=(e,t=0)=>[to.decode(e,t),to.decode.bytes],ro=(e,t,r=0)=>(to.encode(e,t,r),t),no=e=>to.encodingLength(e),io=(e,t)=>{let r=t.byteLength,n=no(e),i=n+no(r),s=new Uint8Array(i+r);return ro(e,s,0),ro(r,s,n),s.set(t,i),new co(e,r,t,s)},ti=e=>{let t=Xs(e),[r,n]=Us(t),[i,s]=Us(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new co(r,i,o,t)},nf=(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)}},co=class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},kc=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return Am(r,Bs(e),t||hr.encoder);default:return Im(r,Bs(e),t||Qi.encoder)}},Mc=new WeakMap,Bs=e=>{let t=Mc.get(e);if(t==null){let r=new Map;return Mc.set(e,r),r}return t},Yt=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=io(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&&nf(t.multihash,n.multihash)}toString(t){return kc(this,t)}toJSON(){return{"/":kc(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||Dc(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=Dc(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=Xs(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 co(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,M]=Us(t.subarray(r));return r+=M,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 Bs(s).set(n,t),s}},Om=(e,t)=>{switch(e[0]){case"Q":{let r=t||hr;return[hr.prefix,r.decode(`${hr.prefix}${e}`)]}case hr.prefix:{let r=t||hr;return[hr.prefix,r.decode(e)]}case Qi.prefix:{let r=t||Qi;return[Qi.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!==hr.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,Dc=(e,t,r)=>{let n=no(e),i=n+no(t),s=new Uint8Array(i+r.byteLength);return ro(e,s,0),ro(t,s,n),s.set(r,i),s},Sm=Symbol.for("@ipld/js-cid/CID"),of=({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?io(this.code,t):t.then(r=>io(this.code,r))}else throw Error("Unknown type, must be binary type")}},sf=ct({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),FE=ct({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),VE=ct({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),KE=ct({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function Nm(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Yt.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 oo(e){let t=sf.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 oo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function $m(e){return oo(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 Rm={typeEncoders:{Object:Nm,Buffer:oo,Uint8Array:oo,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}},Um=class extends Yc{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=sf.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}},ks={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};ks.tags[42]=Yt.parse;var Bm="dag-json",af=297,Ys=e=>Gh(e,Rm),fo=e=>{let t=Object.assign(ks,{tokenizer:new Um(e,ks)});return Hh(e,t)},jc=e=>km.decode(Ys(e)),km=new TextDecoder,Mm=e=>fo(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 Lc(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,Cs=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),jt=(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 uf(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()}},zE={}.toString;function qm(e){let t=n=>e().update(uf(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=Cs(this.buffer)}update(e){Lc(this);let{view:t,buffer:r,blockLen:n}=this;e=uf(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=Cs(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){Lc(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=Cs(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]),pr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yr=new Uint32Array(64),Ym=class extends Hm{constructor(){super(64,32,8,!1),this.A=pr[0]|0,this.B=pr[1]|0,this.C=pr[2]|0,this.D=pr[3]|0,this.E=pr[4]|0,this.F=pr[5]|0,this.G=pr[6]|0,this.H=pr[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)yr[y]=e.getUint32(t,!1);for(let y=16;y<64;y++){let g=yr[y-15],M=yr[y-2],R=jt(g,7)^jt(g,18)^g>>>3,j=jt(M,17)^jt(M,19)^M>>>10;yr[y]=j+yr[y-7]+R+yr[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=jt(o,6)^jt(o,11)^jt(o,25),M=c+g+Wm(o,a,f)+Xm[y]+yr[y]|0,j=(jt(r,2)^jt(r,13)^jt(r,22))+Jm(r,n,i)|0;c=f,f=a,a=o,o=s+M|0,s=i,i=n,n=r,r=M+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(){yr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Qm=qm(()=>new Ym),Zm=Object.create,Qs=Object.defineProperty,eg=Object.getOwnPropertyDescriptor,cf=Object.getOwnPropertyNames,tg=Object.getPrototypeOf,rg=Object.prototype.hasOwnProperty,ng=(e,t,r)=>t in e?Qs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ff=(e,t)=>function(){return t||(0,e[cf(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 cf(t))!rg.call(e,i)&&i!==r&&Qs(e,i,{get:()=>t[i],enumerable:!(n=eg(t,i))||n.enumerable});return e},lf=(e,t,r)=>(r=e!=null?Zm(tg(e)):{},ig(t||!e||!e.__esModule?Qs(r,"default",{value:e,enumerable:!0}):r,e)),gr=(e,t,r)=>(ng(e,typeof t!="symbol"?t+"":t,r),r),og=ff({"../../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=ff({"../../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]},M={key:y,value:f[y]};return a(g,M)}}}(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,M=Object.keys(f).sort(s&&s(f));for(y="",c=0;c<M.length;c++){var R=M[c],j=a(f[R]);j&&(y&&(y+=","),y+=JSON.stringify(R)+":"+j)}return o.splice(g,1),"{"+y+"}"}}(r)}}}),Yn=lf(og(),1),ag=lf(sg(),1),df=!1,pf=!1;Yn.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(df=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(pf=process?.env?.LOGGER_PERF_PREFIX==="true"));var ug=Object.freeze({prefix:void 0,time:df,delta:pf,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),Ps=[],yf=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(",")}]`}},hf=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(...M){let R=M[M.length-1];return R===n?R():(i(...M.slice(0,-1)),(async()=>{try{let te=R();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 hf("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 yf(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;gr(Se,"ERROR",2);gr(Se,"WARN",4);gr(Se,"INFO",6);gr(Se,"LOG",6);gr(Se,"DEBUG",8);gr(Se,"VERBOSE",10);gr(Se,"firstLog",0);gr(Se,"lastLog",0);Yn.isBrowser?(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Ps&&Ps.length){for(let t of Ps)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof yf))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 hf?(Wn||(Wn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1})):Yn.isNode;var mf=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),cg=of({name:"sha2-256",code:18,encode:mf("SHA-256")}),qE=of({name:"sha2-512",code:19,encode:mf("SHA-512")}),{WARN:fg,LOG:GE,DEBUG:lg,VERBOSE:gf,ERROR:HE}=Se.setup(Se.INFO);function bf(e,t=["cid"]){let r={};for(let[n,i]of Object.entries(e))i===void 0&&(fg(`log.${n} is undefined, which is not allowed - encoding as null`,e),i=null),t.includes(n)?gf("excluding app log",{key:n,val:i}):r[n]=i&&n==="pv"?Yt.parse(i):i;return r}function Zs(e){return ea(vf(e).bytes)}function vf(e){return _f(bf(e))}function ea(e){let t=Qm(e),r=tf.create(cg.code,t),n=Yt.create(1,af,r);return gf("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function _f(e){lg("[encodeBlock]",e);let t=Ys(e);return{bytes:t,cid:ea(t)}}var Qt=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 or(m)&&m[e.Kind]===$e}l.TKindOf=we;function or(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}l.TKind=or;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 Pi(m){return we(m,"This")&&S(m.$id)&&i.IsString(m.$ref)}l.TThis=Pi;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 Ri(m){return we(m,"Undefined")&&m.type==="undefined"&&S(m.$id)}l.TUndefined=Ri;function is(m){return Nr(m)&&m.anyOf.every($e=>Sr($e)||T($e))}l.TUnionLiteral=is;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 os(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}l.TReadonly=os;function ss(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}l.TOptional=ss;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)||Pi(m)||Fe(m)||Ri(m)||Nr(m)||on(m)||Ye(m)||Ui(m)||Mn(m)||or(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)?as(d,p):o.TUnknown(p)?uu(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,xt)=>w(Ne(p.parameters[xt],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,xt)=>w(Ne(p.parameters[xt],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 or(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 Pi(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 Ri(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 is(d,p){return P(p)?N(d,p):o.TObject(p)&&Pi(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,xt]=[Nr(p),on(p)];return o.TLiteralString(d)&&o.TNumber(Te)&&w(Ne(d,xt))===c.True?c.True:o.TUint8Array(d)&&o.TNumber(Te)||o.TString(d)&&o.TNumber(Te)||o.TArray(d)&&o.TNumber(Te)?Ne(d,xt):o.TObject(d)?(()=>{for(let Op of Object.getOwnPropertyNames(d.properties))if(kn(xt,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 os(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 ss(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,xt)=>Ne(Te,p.items[xt])===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 as(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 uu(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)?as(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)?as(d,p):o.TUnknown(p)?uu(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)?or(d,p):o.TNull(d)?le(d,p):o.TNumber(d)?ge(d,p):o.TObject(d)?Ri(d,p):o.TRecord(d)?Ui(d,p):o.TString(d)?os(d,p):o.TSymbol(d)?ss(d,p):o.TTuple(d)?yt(d,p):o.TPromise(d)?is(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 M;(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})(M||(e.IndexedAccessor=M={}));var R;(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=[...k.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})(R||(e.Intrinsic=R={}));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[...k.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=[...k.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 U=class extends r{};e.TemplateLiteralGeneratorError=U;var k;(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 U("Unknown expression")})()}l.Generate=E})(k||(e.TemplateLiteralGenerator=k={}));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{...R.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 M.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{...R.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([...k.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{...R.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{...R.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=Dt(Qt(),1),{String:dg,Optional:pg,Boolean:yg,Object:hg,Number:mg}=mn.Type,gg=dg.bind(mn.Type),bg=mg.bind(mn.Type),hS=hg.bind(mn.Type),mS=pg.bind(mn.Type),vg=yg.bind(mn.Type),gS=gg(),bS=bg(),vS=vg();function wf(e){return Array.isArray(e)?e:[e]}var _g=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 M(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 R(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=M(B,"maximumDepth"),K=M(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}"... ${R(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}"${R(_)} 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}"... ${R(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 U(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 U(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=U(String(_),O[_],q,ne,G);E+=A!==void 0?A:"null",E+=h}let u=U(String(_),O[_],q,ne,G);if(E+=u!==void 0?u:"null",O.length-1>K){let A=O.length-K-1;E+=`${h}"... ${R(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=U(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}"...": "${R(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 k(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 k(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=k(String(I),O[I],q);ne+=N!==void 0?N:"null",ne+=","}let P=k(String(I),O[I],q);if(ne+=P!==void 0?P:"null",O.length-1>K){let N=O.length-K-1;ne+=`,"... ${R(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=k(I,O[I],q);P!==void 0&&(ne+=`${de}${s(I)}:${P}`,de=",")}if(J>K){let w=J-K;ne+=`${de}"...":"${R(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 U("",Q,[],ne,"")}return k("",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 M(F){return F===null}e.IsNull=M;function R(F){return typeof F=="boolean"}e.IsBoolean=R;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)||R(F)||M(F)||j(F)||B(F)||Y(F)||g(F)}e.IsValueType=ie}}),hl=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=jo(),n=Qt(),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(R,j){if(n.TypeRegistry.Has(R))throw new i(R);return n.TypeRegistry.Set(R,j),(te={})=>n.Type.Unsafe({...te,[n.Kind]:R})}y.Type=g;function M(R,j){if(n.FormatRegistry.Has(R))throw new s(R);return n.FormatRegistry.Set(R,j),R}y.Format=M})(o||(e.TypeSystem=o={}));var a;(function(y){let g=c;function M(){g=c}y.Reset=M;function R(te){g=te}y.Set=R;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 M(W){let B=(0,t.IsObject)(W);return y.AllowArrayObject?B:B&&!(0,t.IsArray)(W)}y.IsObjectLike=M;function R(W){return M(W)&&!(W instanceof Date)&&!(W instanceof Uint8Array)}y.IsRecordLike=R;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}}),Do=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=Qt(),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}}),xa=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(U){super("Unable to hash value"),this.value=U}};e.ValueHashError=r;var n;(function(U){U[U.Undefined=0]="Undefined",U[U.Null=1]="Null",U[U.Boolean=2]="Boolean",U[U.Number=3]="Number",U[U.String=4]="String",U[U.Object=5]="Object",U[U.Array=6]="Array",U[U.Date=7]="Date",U[U.Uint8Array=8]="Uint8Array",U[U.Symbol=9]="Symbol",U[U.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((U,k)=>BigInt(k)),f=new Float64Array(1),c=new DataView(f.buffer),y=new Uint8Array(f.buffer);function*g(U){let k=U===0?1:Math.ceil(Math.floor(Math.log2(U)+1)/8);for(let ee=0;ee<k;ee++)yield U>>8*(k-1-ee)&255}function M(U){ye(n.Array);for(let k of U)K(k)}function R(U){ye(n.Boolean),ye(U?1:0)}function j(U){ye(n.BigInt),c.setBigInt64(0,U);for(let k of y)ye(k)}function te(U){ye(n.Date),K(U.getTime())}function W(U){ye(n.Null)}function B(U){ye(n.Number),c.setFloat64(0,U);for(let k of y)ye(k)}function z(U){ye(n.Object);for(let k of globalThis.Object.keys(U).sort())K(k),K(U[k])}function Y(U){ye(n.String);for(let k=0;k<U.length;k++)for(let ee of g(U.charCodeAt(k)))ye(ee)}function ie(U){ye(n.Symbol),K(U.description)}function F(U){ye(n.Uint8Array);for(let k=0;k<U.length;k++)ye(U[k])}function se(U){return ye(n.Undefined)}function K(U){if((0,t.IsArray)(U))return M(U);if((0,t.IsBoolean)(U))return R(U);if((0,t.IsBigInt)(U))return j(U);if((0,t.IsDate)(U))return te(U);if((0,t.IsNull)(U))return W(U);if((0,t.IsNumber)(U))return B(U);if((0,t.IsPlainObject)(U))return z(U);if((0,t.IsString)(U))return Y(U);if((0,t.IsSymbol)(U))return ie(U);if((0,t.IsUint8Array)(U))return F(U);if((0,t.IsUndefined)(U))return se(U);throw new r(U)}function ye(U){i=i^a[U],i=i*s%o}function D(U){return i=BigInt("14695981039346656037"),K(U),i}e.Hash=D}}),jo=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=hl(),n=Do(),i=xa(),s=Qt(),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*M(u,A,v,b){}function*R(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*U(u,A,v,b){(0,t.IsNull)(b)||(yield g(o.Null,u,v,b))}function*k(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*M(V,$,v,b);case"Array":return yield*R(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*U(V,$,v,b);case"Number":return yield*k(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=_}}),wg=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(jo(),e)}}),ml=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=jo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(hl(),e)}}),Tg=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=ml(),n=Do(),i=xa(),s=Qt(),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 M(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 R(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 U(h,S,_){return(0,t.IsPromise)(_)}function k(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 M(A,u,_);case"Boolean":return R(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 U(A,u,_);case"Record":return k(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}}),Og=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=Do(),n=Tg(),i=Qt(),s=class extends i.TypeBoxError{constructor(M,R,j){super("Unable to decode due to invalid value"),this.schema=M,this.value=R,this.error=j}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(M,R,j){super("Unable to encode due to invalid value"),this.schema=M,this.value=R,this.error=j}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(M,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=M,this.value=R}};e.TransformDecodeError=a;var f=class extends i.TypeBoxError{constructor(M,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=M,this.value=R}};e.TransformEncodeError=f;var c;(function(M){function R(O,q){return i.TypeGuard.TTransform(O)||k(O.items,q)}function j(O,q){return i.TypeGuard.TTransform(O)||k(O.items,q)}function te(O,q){return i.TypeGuard.TTransform(O)||k(O.returns,q)||O.parameters.some(ne=>k(ne,q))}function W(O,q){return i.TypeGuard.TTransform(O)||k(O.returns,q)||O.parameters.some(ne=>k(ne,q))}function B(O,q){return i.TypeGuard.TTransform(O)||i.TypeGuard.TTransform(O.unevaluatedProperties)||O.allOf.some(ne=>k(ne,q))}function z(O,q){return i.TypeGuard.TTransform(O)||k(O.items,q)}function Y(O,q){return i.TypeGuard.TTransform(O)||k(O.not,q)}function ie(O,q){return i.TypeGuard.TTransform(O)||Object.values(O.properties).some(ne=>k(ne,q))||i.TypeGuard.TSchema(O.additionalProperties)&&k(O.additionalProperties,q)}function F(O,q){return i.TypeGuard.TTransform(O)||k(O.item,q)}function se(O,q){let ne=Object.getOwnPropertyNames(O.patternProperties)[0],G=O.patternProperties[ne];return i.TypeGuard.TTransform(O)||k(G,q)||i.TypeGuard.TSchema(O.additionalProperties)&&i.TypeGuard.TTransform(O.additionalProperties)}function K(O,q){return i.TypeGuard.TTransform(O)?!0:k((0,r.Deref)(O,q),q)}function ye(O,q){return i.TypeGuard.TTransform(O)?!0:k((0,r.Deref)(O,q),q)}function D(O,q){return i.TypeGuard.TTransform(O)||!(0,t.IsUndefined)(O.items)&&O.items.some(ne=>k(ne,q))}function U(O,q){return i.TypeGuard.TTransform(O)||O.anyOf.some(ne=>k(ne,q))}function k(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 R(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 U(G,ne);default:return i.TypeGuard.TTransform(O)}}let ee=new Set;function Q(O,q){return ee.clear(),k(O,q)}M.Has=Q})(c||(e.HasTransform=c={}));var y;(function(M){function R(D,U){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Decode(U):U}catch(k){throw new a(D,U,k)}}function j(D,U,k){return(0,t.IsArray)(k)?R(D,k.map(ee=>K(D.items,U,ee))):R(D,k)}function te(D,U,k){if(!(0,t.IsPlainObject)(k)||(0,t.IsValueType)(k))return R(D,k);let ee=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(i.IndexedAccessor.Resolve(D,[J]),U,G[J])}:G,k);if(!i.TypeGuard.TTransform(D.unevaluatedProperties))return R(D,Q);let O=Object.getOwnPropertyNames(Q),q=D.unevaluatedProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:R(q,G[J])},Q);return R(D,ne)}function W(D,U,k){return R(D,K(D.not,U,k))}function B(D,U,k){if(!(0,t.IsPlainObject)(k))return R(D,k);let ee=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(D.properties[J],U,G[J])}:G,k);if(!i.TypeGuard.TSchema(D.additionalProperties))return R(D,Q);let O=Object.getOwnPropertyNames(Q),q=D.additionalProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:R(q,G[J])},Q);return R(D,ne)}function z(D,U,k){if(!(0,t.IsPlainObject)(k))return R(D,k);let ee=Object.getOwnPropertyNames(D.patternProperties)[0],Q=new RegExp(ee),O=Object.getOwnPropertyNames(k).reduce((J,de)=>Q.test(de)?{...J,[de]:K(D.patternProperties[ee],U,J[de])}:J,k);if(!i.TypeGuard.TSchema(D.additionalProperties))return R(D,O);let q=Object.getOwnPropertyNames(O),ne=D.additionalProperties,G=q.reduce((J,de)=>Q.test(de)?J:{...J,[de]:R(ne,J[de])},O);return R(D,G)}function Y(D,U,k){let ee=(0,r.Deref)(D,U);return R(D,K(ee,U,k))}function ie(D,U,k){let ee=(0,r.Deref)(D,U);return R(D,K(ee,U,k))}function F(D,U,k){return(0,t.IsArray)(k)&&(0,t.IsArray)(D.items)?R(D,D.items.map((ee,Q)=>K(ee,U,k[Q]))):R(D,k)}function se(D,U,k){let ee=R(D,k);for(let Q of D.anyOf)if((0,n.Check)(Q,U,ee))return K(Q,U,ee);return ee}function K(D,U,k){let ee=typeof D.$id=="string"?[...U,D]:U,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,k);case"Intersect":return te(Q,ee,k);case"Not":return W(Q,ee,k);case"Object":return B(Q,ee,k);case"Record":return z(Q,ee,k);case"Ref":return Y(Q,ee,k);case"Symbol":return R(Q,k);case"This":return ie(Q,ee,k);case"Tuple":return F(Q,ee,k);case"Union":return se(Q,ee,k);default:return R(Q,k)}}function ye(D,U,k){return K(D,U,k)}M.Decode=ye})(y||(e.DecodeTransform=y={}));var g;(function(M){function R(D,U){try{return i.TypeGuard.TTransform(D)?D[i.Transform].Encode(U):U}catch(k){throw new f(D,U,k)}}function j(D,U,k){let ee=R(D,k);return(0,t.IsArray)(ee)?ee.map(Q=>K(D.items,U,Q)):ee}function te(D,U,k){let ee=R(D,k);if(!(0,t.IsPlainObject)(k)||(0,t.IsValueType)(k))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]),U,G[J])}:G,ee);if(!i.TypeGuard.TTransform(D.unevaluatedProperties))return R(D,O);let q=Object.getOwnPropertyNames(O),ne=D.unevaluatedProperties;return q.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:R(ne,G[J])},O)}function W(D,U,k){return R(D.not,R(D,k))}function B(D,U,k){let ee=R(D,k);if(!(0,t.IsPlainObject)(k))return ee;let Q=i.KeyResolver.ResolveKeys(D,{includePatterns:!1}),O=Q.reduce((G,J)=>J in G?{...G,[J]:K(D.properties[J],U,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]:R(ne,G[J])},O)}function z(D,U,k){let ee=R(D,k);if(!(0,t.IsPlainObject)(k))return ee;let Q=Object.getOwnPropertyNames(D.patternProperties)[0],O=new RegExp(Q),q=Object.getOwnPropertyNames(k).reduce((J,de)=>O.test(de)?{...J,[de]:K(D.patternProperties[Q],U,J[de])}:J,ee);if(!i.TypeGuard.TSchema(D.additionalProperties))return R(D,q);let ne=Object.getOwnPropertyNames(q),G=D.additionalProperties;return ne.reduce((J,de)=>O.test(de)?J:{...J,[de]:R(G,J[de])},q)}function Y(D,U,k){let ee=(0,r.Deref)(D,U),Q=K(ee,U,k);return R(D,Q)}function ie(D,U,k){let ee=(0,r.Deref)(D,U),Q=K(ee,U,k);return R(D,Q)}function F(D,U,k){let ee=R(D,k);return(0,t.IsArray)(D.items)?D.items.map((Q,O)=>K(Q,U,ee[O])):[]}function se(D,U,k){for(let ee of D.anyOf){if(!(0,n.Check)(ee,U,k))continue;let Q=K(ee,U,k);return R(D,Q)}for(let ee of D.anyOf){let Q=K(ee,U,k);if((0,n.Check)(D,U,Q))return R(D,Q)}return R(D,k)}function K(D,U,k){let ee=typeof D.$id=="string"?[...U,D]:U,Q=D;switch(D[i.Kind]){case"Array":return j(Q,ee,k);case"Intersect":return te(Q,ee,k);case"Not":return W(Q,ee,k);case"Object":return B(Q,ee,k);case"Record":return z(Q,ee,k);case"Ref":return Y(Q,ee,k);case"This":return ie(Q,ee,k);case"Tuple":return F(Q,ee,k);case"Union":return se(Q,ee,k);default:return R(Q,k)}}function ye(D,U,k){return K(D,U,k)}M.Encode=ye})(g||(e.EncodeTransform=g={}))}}),Ag=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=Og(),r=An(),n=jo(),i=ml(),s=Do(),o=xa(),a=Qt(),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 M;(function(B){function z(Y){return Y.replace(/'/g,"\\'")}B.Escape=z})(M||(M={}));var R=class extends a.TypeBoxError{constructor(B){super("Unknown type"),this.schema=B}};e.TypeCompilerUnknownTypeError=R;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*U(T,le,x){yield`(typeof ${x} === 'function')`}function*k(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} === '${M.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*U(pe,oe,x);case"Integer":return yield*k(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 R(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 or(...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=or;function Sr(T,le=[]){let x=or(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={}))}}),Ig=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=wg();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(Ag(),e)}}),Eg={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"},Sg=Eg;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:Sg[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var xg={};function Na(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:xg}var gl=Object.assign,Oo=Object.getOwnPropertyDescriptor,Vt=Object.defineProperty,gi=Object.prototype,Ao=[];Object.freeze(Ao);var $a={};Object.freeze($a);var Ng=typeof Proxy<"u",$g=Object.toString();function bl(){Ng||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 St(){return++H.mobxGuid}function Ca(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 Lo(e){return e!==null&&typeof e=="object"}function kt(e){if(!Lo(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()===$g}function vl(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Fo(e,t,r){Vt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function _l(e,t,r){Vt(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 Lo(n)&&n[r]===!0}}function In(e){return e instanceof Map}function bi(e){return e instanceof Set}var wl=typeof Object.getOwnPropertySymbols<"u";function Cg(e){var t=Object.keys(e);if(!wl)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return gi.propertyIsEnumerable.call(e,n)})):t}var Vo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:wl?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function ua(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Tl(e){return e===null?null:typeof e=="object"?""+e:e}function It(e,t){return gi.hasOwnProperty.call(e,t)}var Pg=Object.getOwnPropertyDescriptors||function(t){var r={};return Vo(t).forEach(function(n){r[n]=Oo(t,n)}),r};function Tf(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,Bg(n.key),n)}}function Pa(e,t,r){return t&&Tf(e.prototype,t),r&&Tf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rr(){return rr=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},rr.apply(this,arguments)}function Ol(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ca(e,t)}function ca(e,t){return ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ca(e,t)}function go(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 Of(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 Of(e,t)}}function Of(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 Ug(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 Bg(e){var t=Ug(e,"string");return typeof t=="symbol"?t:String(t)}var rt=Symbol("mobx-stored-annotations");function Kt(e){function t(r,n){if(vi(n))return e.decorate_20223_(r,n);En(r,n,e)}return Object.assign(t,e)}function En(e,t,r){if(It(e,rt)||Fo(e,rt,rr({},e[rt])),Io(r)&&!It(e[rt],t)){var n=e.constructor.name+".prototype."+t.toString();fe("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}kg(e,r,t),Io(r)||(e[rt][t]=r)}function kg(e,t,r){if(!Io(t)&&It(e[rt],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[rt][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 Mg(e){return It(e,rt)||Fo(e,rt,rr({},e[rt])),e[rt]}function vi(e){return typeof e=="object"&&typeof e.kind=="string"}function Ko(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"),_i=function(){function e(r){r===void 0&&(r="Atom@"+St()),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 Fl(this)},t.reportChanged=function(){Tt(),Vl(this),Ot()},t.toString=function(){return this.name_},e}(),Ra=Ar("Atom",_i);function Al(e,t,r){t===void 0&&(t=bn),r===void 0&&(r=bn);var n=new _i(e);return t!==bn&&Yl(n,t),r!==bn&&Oi(n,r),n}function Dg(e,t){return e===t}function jg(e,t){return La(e,t)}function Lg(e,t){return La(e,t,1)}function Fg(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var nt={identity:Dg,structural:jg,default:Fg,shallow:Lg};function Kr(e,t,r){return Tn(e)?e:Array.isArray(e)?ke.array(e,{name:r}):kt(e)?ke.object(e,void 0,{name:r}):In(e)?ke.map(e,{name:r}):bi(e)?ke.set(e,{name:r}):typeof e=="function"&&!Sn(e)&&!ci(e)?vl(e)?wn(e):ui(r,e):e}function Vg(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(kt(e))return ke.object(e,void 0,{name:r,deep:!1});if(In(e))return ke.map(e,{name:r,deep:!1});if(bi(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 zo(e){return e}function Kg(e,t){return Tn(e)&&fe("observable.struct should not be used with observable values"),La(e,t)?t:e}var zg="override";function Io(e){return e.annotationType_===zg}function wi(e,t){return{annotationType_:e,options_:t,make_:qg,extend_:Gg,decorate_20223_:Hg}}function qg(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=Il(e,this,t,r,!1);return Vt(n,t,s),2}function Gg(e,t,r,n){var i=Il(e,this,t,r);return e.defineProperty_(t,i,n)}function Hg(e,t){Ko(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,s=this,o=function(c){var y,g,M,R;return zr((y=(g=s.options_)==null?void 0:g.name)!=null?y:n.toString(),c,(M=(R=s.options_)==null?void 0:R.autoAction)!=null?M:!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 Wg(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 Il(e,t,r,n,i){var s,o,a,f,c,y,g;i===void 0&&(i=H.safeDescriptors),Wg(e,t,r,n);var M=n.value;if((s=t.options_)!=null&&s.bound){var R;M=M.bind((R=e.proxy_)!=null?R:e.target_)}return{value:zr((o=(a=t.options_)==null?void 0:a.name)!=null?o:r.toString(),M,(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 El(e,t){return{annotationType_:e,options_:t,make_:Jg,extend_:Xg,decorate_20223_:Yg}}function Jg(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&&(!It(e.target_,t)||!ci(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(ci(r.value))return 1;var s=Sl(e,this,t,r,!1,!1);return Vt(n,t,s),2}function Xg(e,t,r,n){var i,s=Sl(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,s,n)}function Yg(e,t){var r;Ko(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 Qg(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 Sl(e,t,r,n,i,s){s===void 0&&(s=H.safeDescriptors),Qg(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 Ua(e,t){return{annotationType_:e,options_:t,make_:Zg,extend_:eb,decorate_20223_:tb}}function Zg(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function eb(e,t,r,n){return rb(e,this,t,r),e.defineComputedProperty_(t,rr({},this.options_,{get:r.get,set:r.set}),n)}function tb(e,t){Ko(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var s=$n(this)[be],o=rr({},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 rb(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 qo(e,t){return{annotationType_:e,options_:t,make_:nb,extend_:ib,decorate_20223_:ob}}function nb(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function ib(e,t,r,n){var i,s;return sb(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:Kr,n)}function ob(e,t){if(t.kind==="field")throw fe("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");Ko(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],M=new wr(f,(c=(y=r.options_)==null?void 0:y.enhancer)!=null?c:Kr,g.name_+"."+i.toString(),!1);g.values_.set(i,M),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 sb(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 ab="true",ub=xl();function xl(e){return{annotationType_:ab,options_:e,make_:cb,extend_:fb,decorate_20223_:lb}}function cb(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:(Vt(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(vl(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 M;r.value=r.value.bind((M=e.proxy_)!=null?M:e.target_)}return g.make_(e,t,r,n)}function fb(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 lb(e,t){fe("'"+this.annotationType_+"' cannot be used as a decorator")}var db="observable",pb="observable.ref",yb="observable.shallow",hb="observable.struct",Nl={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Nl);function lo(e){return e||Nl}var fa=qo(db),mb=qo(pb,{enhancer:zo}),gb=qo(yb,{enhancer:Vg}),bb=qo(hb,{enhancer:Kg}),$l=Kt(fa);function po(e){return e.deep===!0?Kr:e.deep===!1?zo:_b(e.defaultDecorator)}function vb(e){var t;return e?(t=e.defaultDecorator)!=null?t:xl(e):void 0}function _b(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Kr}function Cl(e,t,r){if(vi(t))return fa.decorate_20223_(e,t);if(Vr(t)){En(e,t,fa);return}return Tn(e)?e:kt(e)?ke.object(e,t,r):Array.isArray(e)?ke.array(e,t):In(e)?ke.map(e,t):bi(e)?ke.set(e,t):typeof e=="object"&&e!==null?e:ke.box(e,t)}gl(Cl,$l);var wb={box:function(t,r){var n=lo(r);return new wr(t,po(n),n.name,!0,n.equals)},array:function(t,r){var n=lo(r);return(H.useProxies===!1||n.proxy===!1?Ev:mv)(t,po(n),n.name)},map:function(t,r){var n=lo(r);return new sd(t,po(n),n.name)},set:function(t,r){var n=lo(r);return new cd(t,po(n),n.name)},object:function(t,r,n){return Qr(function(){return iv(H.useProxies===!1||n?.proxy===!1?$n({},n):pv({},n),t,r)})},ref:Kt(mb),shallow:Kt(gb),deep:$l,struct:Kt(bb)},ke=gl(Cl,wb),Pl="computed",Tb="computed.struct",la=Ua(Pl),Ob=Ua(Tb,{equals:nt.structural}),Ge=function(t,r){if(vi(r))return la.decorate_20223_(t,r);if(Vr(r))return En(t,r,la);if(kt(t))return Kt(Ua(Pl,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=kt(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new qr(n)};Object.assign(Ge,la);Ge.struct=Kt(Ob);var Af,If,Eo=0,Ab=1,Ib=(Af=(If=Oo(function(){},"name"))==null?void 0:If.configurable)!=null?Af:!1,Ef={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 Rl(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Ib&&(Ef.value=e,Vt(i,"name",Ef)),i}function Rl(e,t,r,n,i){var s=Eb(e,t,n,i);try{return r.apply(n,i)}catch(o){throw s.error_=o,o}finally{Sb(s)}}function Eb(e,t,r,n){var i=He()&&!!e,s=0;if(i){s=Date.now();var o=n?Array.from(n):Ao;lt({type:ka,name:e,object:r,arguments:o})}var a=H.trackingDerivation,f=!t||!a;Tt();var c=H.allowStateChanges;f&&(Xr(),c=Go(!0));var y=Ba(!0),g={runAsAction_:f,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:y,notifySpy_:i,startTime_:s,actionId_:Ab++,parentActionId_:Eo};return Eo=g.actionId_,g}function Sb(e){Eo!==e.actionId_&&fe(30),Eo=e.parentActionId_,e.error_!==void 0&&(H.suppressReactionErrors=!0),Ho(e.prevAllowStateChanges_),ii(e.prevAllowStateReads_),Ot(),e.runAsAction_&&tr(e.prevDerivation_),e.notifySpy_&&dt({time:Date.now()-e.startTime_}),H.suppressReactionErrors=!1}function xb(e,t){var r=Go(e);try{return t()}finally{Ho(r)}}function Go(e){var t=H.allowStateChanges;return H.allowStateChanges=e,t}function Ho(e){H.allowStateChanges=e}var Ul,Nb="create";Ul=Symbol.toPrimitive;var wr=function(e){Ol(t,e);function t(n,i,s,o,a){var f;return s===void 0&&(s="ObservableValue@"+St()),o===void 0&&(o=!0),a===void 0&&(a=nt.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:Nb,object:go(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(Ft(this),_t(this)){var s=wt(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(),Ut(this)&&Bt(this,{type:Rt,object:this,newValue:i,oldValue:s})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Ii(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}),Ei(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 Tl(this.get())},r[Ul]=function(){return this.valueOf()},t}(_i),$b=Ar("ObservableValue",wr),Bl;Bl=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 So(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_=Et.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@"+St(),r.set&&(this.setter_=zr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?nt.structural:nt.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Fb(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_)da(this)&&(this.warnAboutUntrackedRead_(),Tt(),this.value_=this.computeValue_(!1),Ot());else if(Fl(this),da(this)){var n=H.trackingContext;this.keepAlive_&&!n&&(H.trackingContext=this),this.trackAndCompute()&&Lb(this),H.trackingContext=n}var i=this.value_;if(bo(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||bo(n)||bo(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=Go(!1),s;if(n)s=kl(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 So(o)}return Ho(i),this.isComputing_=!1,s},t.suspend_=function(){this.keepAlive_||(pa(this),this.value_=void 0,this.isTracing_!==Et.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 zt(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}),tr(c)}o=!1,a=f})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==Et.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 Tl(this.get())},t[Bl]=function(){return this.valueOf()},e}(),Ti=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 Et;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Et||(Et={}));var So=function(t){this.cause=void 0,this.cause=t};function bo(e){return e instanceof So}function da(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=Ba(!0),r=Xr(),n=e.observing_,i=n.length,s=0;s<i;s++){var o=n[s];if(Ti(o)){if(H.disableErrorBoundaries)o.get();else try{o.get()}catch{return tr(r),ii(t),!0}if(e.dependenciesState_===Ie.STALE_)return tr(r),ii(t),!0}}return Ml(e),tr(r),ii(t),!1}}}function Cb(){return H.trackingDerivation!==null}function Ft(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 Pb(e){!H.allowStateReads&&H.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function kl(e,t,r){var n=Ba(!0);Ml(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 So(o)}return H.inBatch--,H.trackingDerivation=i,Ub(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 Ub(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&&jl(f,e),f.diffValue_=0}for(;i--;){var c=r[i];c.diffValue_===1&&(c.diffValue_=0,jb(c,e))}n!==Ie.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function pa(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)jl(t[r],e);e.dependenciesState_=Ie.NOT_TRACKING_}function Be(e){var t=Xr();try{return e()}finally{tr(t)}}function Xr(){var e=H.trackingDerivation;return H.trackingDerivation=null,e}function tr(e){H.trackingDerivation=e}function Ba(e){var t=H.allowStateReads;return H.allowStateReads=e,t}function ii(e){H.allowStateReads=e}function Ml(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 vo=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},_o=!0,Dl=!1,H=function(){var e=Na();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(_o=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new vo().version&&(_o=!1),_o?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new vo):(setTimeout(function(){Dl||fe(35)},1),new vo)}();function Bb(){if((H.pendingReactions.length||H.inBatch||H.isRunningReactions)&&fe(36),Dl=!0,_o){var e=Na();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),H=new vo}}function kb(){return H}function Mb(e){return e.observers_&&e.observers_.size>0}function Db(e){return e.observers_}function jb(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function jl(e,t){e.observers_.delete(t),e.observers_.size===0&&Ll(e)}function Ll(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,H.pendingUnobservations.push(e))}function Tt(){H.inBatch++}function Ot(){if(--H.inBatch===0){ql();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 Fl(e){Pb(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&&Ll(e),!1)}function Vl(e){e.lowestObserverState_!==Ie.STALE_&&(e.lowestObserverState_=Ie.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.UP_TO_DATE_&&(t.isTracing_!==Et.NONE&&Kl(t,e),t.onBecomeStale_()),t.dependenciesState_=Ie.STALE_}))}function Lb(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_!==Et.NONE&&Kl(t,e)):t.dependenciesState_===Ie.UP_TO_DATE_&&(e.lowestObserverState_=Ie.UP_TO_DATE_)}))}function Fb(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 Kl(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===Et.BREAK){var r=[];zl(Ai(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 zl(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 zl(n,t,r+1)})}var ai=function(){function e(r,n,i,s){r===void 0&&(r="Reaction@"+St()),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_=Et.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),ql())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){Tt(),this.isScheduled_=!1;var n=H.trackingContext;if(H.trackingContext=this,da(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,Ot()}},t.track=function(n){if(!this.isDisposed_){Tt();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=kl(this,n,void 0);H.trackingContext=o,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&pa(this),bo(a)&&this.reportExceptionInDerivation_(a.cause),i&&dt({time:Date.now()-s}),Ot()}},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_||(Tt(),pa(this),Ot()))},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}(),Sf=100,ya=function(t){return t()};function ql(){H.inBatch>0||H.isRunningReactions||ya(Vb)}function Vb(){H.isRunningReactions=!0;for(var e=H.pendingReactions,t=0;e.length>0;){++t===Sf&&(console.error("Reaction doesn't converge to a stable state after "+Sf+" 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 xo=Ar("Reaction",ai);function Kb(e){var t=ya;ya=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=rr({},e,{spyReportStart:!0});Gr(t)}var zb={type:"report-end",spyReportEnd:!0};function dt(e){Gr(e?rr({},e,{type:"report-end",spyReportEnd:!0}):zb)}function Gl(e){return H.spyListeners.push(e),Ca(function(){H.spyListeners=H.spyListeners.filter(function(t){return t!==e})})}var ka="action",qb="action.bound",Hl="autoAction",Gb="autoAction.bound",Wl="<unnamed action>",ha=wi(ka),Hb=wi(qb,{bound:!0}),ma=wi(Hl,{autoAction:!0}),Wb=wi(Gb,{autoAction:!0,bound:!0});function Jl(e){var t=function(n,i){if(De(n))return zr(n.name||Wl,n,e);if(De(i))return zr(n,i,e);if(vi(i))return(e?ma:ha).decorate_20223_(n,i);if(Vr(i))return En(n,i,e?ma:ha);if(Vr(n))return Kt(wi(e?Hl:ka,{name:n,autoAction:e}));fe("Invalid arguments for `action`")};return t}var At=Jl(!1);Object.assign(At,ha);var ui=Jl(!0);Object.assign(ui,ma);At.bound=Kt(Hb);ui.bound=Kt(Wb);function Jb(e){return Rl(e.name||Wl,!1,e,this,void 0)}function Sn(e){return De(e)&&e.isMobxAction===!0}function zt(e,t){var r,n,i,s,o;t===void 0&&(t=$a),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@"+St(),f=!t.scheduler&&!t.delay,c;if(f)c=new ai(a,function(){this.track(M)},t.onError,t.requiresObservable);else{var y=Xl(t),g=!1;c=new ai(a,function(){g||(g=!0,y(function(){g=!1,c.isDisposed_||c.track(M)}))},t.onError,t.requiresObservable)}function M(){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 Xl(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=$a),(!De(e)||!De(t))&&fe("First and second argument to reaction should be functions"),kt(r)||fe("Third argument of reactions should be an object");var a=(n=r.name)!=null?n:"Reaction@"+St(),f=At(a,r.onError?Qb(r.onError,t):t),c=!r.scheduler&&!r.delay,y=Xl(r),g=!0,M=!1,R,j,te=r.compareStructural?nt.structural:r.equals||nt.default,W=new ai(a,function(){g||c?B():M||(M=!0,y(B))},r.onError,r.requiresObservable);function B(){if(M=!1,!W.isDisposed_){var z=!1;W.track(function(){var Y=xb(!1,function(){return e(W)});z=g||!te(R,Y),j=R,R=Y}),(g&&r.fireImmediately||!g&&z)&&f(R,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 Yl(e,t,r){return Ql(Zb,e,t,r)}function Oi(e,t,r){return Ql(ev,e,t,r)}function Ql(e,t,r,n){var i=typeof n=="function"?qt(t,r):qt(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",yo="always",rv="observed";function nv(e){e.isolateGlobalState===!0&&Bb();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(H.useProxies=t===yo?!0:t===tv?!1:typeof Proxy<"u"),t==="ifavailable"&&(H.verifyProxies=!0),r!==void 0){var n=r===yo?yo:r===rv;H.enforceActions=n,H.allowStateChanges=!(n===!0||n===yo)}["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&&Kb(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"),kt(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=Pg(t);return Qr(function(){var s=$n(e,n)[be];Vo(i).forEach(function(o){s.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function Ai(e,t){return Zl(qt(e,t))}function Zl(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=sv(e.observing_).map(Zl)),t}function ov(e,t){return ed(qt(e,t))}function ed(e){var t={name:e.name_};return Mb(e)&&(t.observers=Array.from(Db(e)).map(ed)),t}function sv(e){return Array.from(new Set(e))}var av=0;function td(){this.message="FLOW_CANCELLED"}td.prototype=Object.create(Error.prototype);var ta=El("flow"),uv=El("flow.bound",{bound:!0}),wn=Object.assign(function(t,r){if(vi(r))return ta.decorate_20223_(t,r);if(Vr(r))return En(t,r,ta);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=++av,y=At(i+" - runid: "+c+" - init",n).apply(a,f),g,M=void 0,R=new Promise(function(j,te){var W=0;g=te;function B(ie){M=void 0;var F;try{F=At(i+" - runid: "+c+" - yield "+W++,y.next).call(y,ie)}catch(se){return te(se)}Y(F)}function z(ie){M=void 0;var F;try{F=At(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):(M=Promise.resolve(ie.value),M.then(B,z))}B(void 0)});return R.cancel=At(i+" - runid: "+c+" - cancel",function(){try{M&&xf(M);var j=y.return(void 0),te=Promise.resolve(j.value);te.then(bn,bn),xf(te),g(new td)}catch(W){g(W)}}),R};return s.isMobXFlow=!0,s},ta);wn.bound=Kt(uv);function xf(e){De(e.cancel)&&e.cancel()}function ci(e){return e?.isMobXFlow===!0}function cv(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]||Ra(e)||xo(e)||Ti(e):!1}function Tn(e){return arguments.length!==1&&fe("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),cv(e)}function fv(e){if(Hr(e))return e[be].ownKeys_();fe(38)}function ho(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($b(e)||Ti(e))return gn(e.get(),t);if(t.has(e))return t.get(e);if(Nn(e)){var r=ho(t,e,new Array(e.length));return e.forEach(function(o,a){r[a]=gn(o,t)}),r}if(Yr(e)){var n=ho(t,e,new Set);return e.forEach(function(o){n.add(gn(o,t))}),n}if(Wt(e)){var i=ho(t,e,new Map);return e.forEach(function(o,a){i.set(a,gn(o,t))}),i}else{var s=ho(t,e,{});return fv(e).forEach(function(o){gi.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=lv(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_===Et.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?Et.BREAK:Et.LOG}function lv(e){switch(e.length){case 0:return H.trackingDerivation;case 1:return qt(e[0]);case 2:return qt(e[0],e[1])}}function Zt(e,t){t===void 0&&(t=void 0),Tt();try{return e.apply(t)}finally{Ot()}}function jr(e){return e[be]}var dv={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 pv(e,t){var r,n;return bl(),e=$n(e,t),(n=(r=e[be]).proxy_)!=null?n:r.proxy_=new Proxy(e,dv)}function _t(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ii(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Ca(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function wt(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{tr(r)}}function Ut(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Ei(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Ca(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Bt(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);tr(r)}}function xn(e,t,r){return Qr(function(){var n,i=$n(e,r)[be];t&&e[rt]&&fe("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=Mg(e)),Vo(t).forEach(function(s){return i.make_(s,t[s])})}),e}var Nf="splice",Rt="update",yv=1e4,hv={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)):It(No,r)?No[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)}},Ma=function(){function e(r,n,i,s){r===void 0&&(r="ObservableArray@"+St()),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 _i(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 Ii(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}),Ei(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;Ft(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=Ao),_t(this)){var f=wt(this,{object:this.proxy_,type:Nf,index:n,removedCount:i,added:s});if(!f)return Ao;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<yv){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=Ut(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&&Bt(this,f),o&&dt()},t.notifyArraySplice_=function(n,i,s){var o=!this.owned_&&He(),a=Ut(this),f=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Nf,index:n,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&lt(f),this.atom_.reportChanged(),a&&Bt(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){Ft(this.atom_);var o=s[n];if(_t(this)){var a=wt(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 mv(e,t,r,n){return r===void 0&&(r="ObservableArray@"+St()),n===void 0&&(n=!1),bl(),Qr(function(){var i=new Ma(r,t,n,!1);_l(i.values_,be,i);var s=new Proxy(i.values_,hv);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var No={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",Mt);Ce("filter",Mt);Ce("find",Mt);Ce("findIndex",Mt);Ce("findLast",Mt);Ce("findLastIndex",Mt);Ce("flatMap",Mt);Ce("forEach",Mt);Ce("map",Mt);Ce("some",Mt);Ce("toReversed",Mt);Ce("reduce",nd);Ce("reduceRight",nd);function Ce(e,t){typeof Array.prototype[e]=="function"&&(No[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 Mt(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 gv=Ar("ObservableArrayAdministration",Ma);function Nn(e){return Lo(e)&&gv(e[be])}var id,od,bv={},_r="add",$o="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@"+St()),this.enhancer_=void 0,this.name_=void 0,this[be]=bv,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_=Al(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 wr(this.has_(n),zo,this.name_+"."+ua(n)+"?",!1);this.hasMap_.set(n,o),Oi(o,function(){return i.hasMap_.delete(n)})}return s.get()},t.set=function(n,i){var s=this.has_(n);if(_t(this)){var o=wt(this,{type:s?Rt:_r,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(Ft(this.keysAtom_),_t(this)){var s=wt(this,{type:$o,object:this,name:n});if(!s)return!1}if(this.has_(n)){var o=He(),a=Ut(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:$o,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return o&&lt(f),Zt(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&&Bt(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=Ut(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&&Bt(this,f),o&&dt()}},t.addValue_=function(n,i){var s=this;Ft(this.keysAtom_),Zt(function(){var c,y=new wr(i,s.enhancer_,s.name_+"."+ua(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=Ut(this),f=a||o?{observableKind:"map",debugObjectName:this.name_,type:_r,object:this,name:n,newValue:i}:null;o&&lt(f),a&&Bt(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 li({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 li({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)),Zt(function(){kt(n)?Cg(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;Zt(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 Zt(function(){for(var s=vv(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 M=i.data_.get(y);o.set(y,M)}}}for(var R=vn(s.entries()),j;!(j=R()).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."),Ei(this,n)},t.intercept_=function(n){return Ii(this,n)},Pa(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:od,get:function(){return"Map"}}]),e}(),Wt=Ar("ObservableMap",sd);function vv(e){if(In(e)||Wt(e))return e;if(Array.isArray(e))return new Map(e);if(kt(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,_v={};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@"+St()),this.name_=void 0,this[be]=_v,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_=Al(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;Zt(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(Ft(this.atom_),_t(this)){var s=wt(this,{type:_r,object:this,newValue:n});if(!s)return this}if(!this.has(n)){Zt(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=He(),a=Ut(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:_r,object:this,newValue:n}:null;o&&lt(f),a&&Bt(this,f),o&&dt()}return this},t.delete=function(n){var i=this;if(_t(this)){var s=wt(this,{type:$o,object:this,oldValue:n});if(!s)return!1}if(this.has(n)){var o=He(),a=Ut(this),f=a||o?{observableKind:"set",debugObjectName:this.name_,type:$o,object:this,oldValue:n}:null;return o&&lt(f),Zt(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&Bt(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 li({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 li({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)),Zt(function(){Array.isArray(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):bi(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."),Ei(this,n)},t.intercept_=function(n){return Ii(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[ad]=function(){return this.values()},Pa(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:ud,get:function(){return"Set"}}]),e}(),Yr=Ar("ObservableSet",cd),$f=Object.create(null),Cf="remove",ga=function(){function e(r,n,i,s){n===void 0&&(n=new Map),s===void 0&&(s=ub),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 _i(this.name_+".keys"),this.isPlainObject_=kt(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(_t(this)){var o=wt(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=Ut(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&&Bt(this,c),f&&dt()}return!0},t.get_=function(n){return H.trackingDerivation&&!It(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,s){return s===void 0&&(s=!1),It(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 wr(n in this.target_,zo,this.name_+"."+ua(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Uf(this,i,n),!(n in this.target_)){var s;if((s=this.target_[rt])!=null&&s[n])return;fe(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==gi;){var a=Oo(o,n);if(a){var f=i.make_(this,n,a,o);if(f===0)return;if(f===1)break}o=Object.getPrototypeOf(o)}Rf(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);Uf(this,s,n);var a=s.extend_(this,n,i,o);return a&&Rf(this,s,n),a},t.defineProperty_=function(n,i,s){s===void 0&&(s=!1),Ft(this.keysAtom_);try{Tt();var o=this.delete_(n);if(!o)return o;if(_t(this)){var a=wt(this,{object:this.proxy_||this.target_,name:n,type:_r,newValue:i.value});if(!a)return null;var f=a.newValue;i.value!==f&&(i=rr({},i,{value:f}))}if(s){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Vt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{Ot()}return!0},t.defineObservableProperty_=function(n,i,s,o){o===void 0&&(o=!1),Ft(this.keysAtom_);try{Tt();var a=this.delete_(n);if(!a)return a;if(_t(this)){var f=wt(this,{object:this.proxy_||this.target_,name:n,type:_r,newValue:i});if(!f)return null;i=f.newValue}var c=Pf(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 Vt(this.target_,n,y);var g=new wr(i,s,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{Ot()}return!0},t.defineComputedProperty_=function(n,i,s){s===void 0&&(s=!1),Ft(this.keysAtom_);try{Tt();var o=this.delete_(n);if(!o)return o;if(_t(this)){var a=wt(this,{object:this.proxy_||this.target_,name:n,type:_r,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var f=Pf(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 Vt(this.target_,n,c);this.values_.set(n,new qr(i)),this.notifyPropertyAddition_(n,void 0)}finally{Ot()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),Ft(this.keysAtom_),!It(this.target_,n))return!0;if(_t(this)){var s=wt(this,{object:this.proxy_||this.target_,name:n,type:Cf});if(!s)return null}try{var o,a;Tt();var f=Ut(this),c=He(),y=this.values_.get(n),g=void 0;if(!y&&(f||c)){var M;g=(M=Oo(this.target_,n))==null?void 0:M.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 wr&&(g=y.value_),Vl(y)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(a=o.get(n))==null||a.set(n in this.target_),f||c){var R={type:Cf,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:g,name:n};c&&lt(R),f&&Bt(this,R),c&&dt()}}finally{Ot()}return!0},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support the fire immediately property for observable objects."),Ei(this,n)},t.intercept_=function(n){return Ii(this,n)},t.notifyPropertyAddition_=function(n,i){var s,o,a=Ut(this),f=He();if(a||f){var c=a||f?{type:_r,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;f&&lt(c),a&&Bt(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(),Vo(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."),It(e,be))return ja(e)instanceof ga||fe("Cannot convert '"+fi(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:(kt(e)?"ObservableObject":e.constructor.name)+"@"+St(),i=new ga(e,new Map,String(n),vb(t));return Fo(e,be,i),e}var wv=Ar("ObservableObjectAdministration",ga);function Pf(e){return $f[e]||($f[e]={get:function(){return this[be].getObservablePropValue_(e)},set:function(r){return this[be].setObservablePropValue_(e,r)}})}function Hr(e){return Lo(e)?wv(e[be]):!1}function Rf(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[rt])==null||delete n[r]}function Uf(e,t,r){if(pd(t)||fe("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!Io(t)&&It(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 Tv=ld(0),Ov=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),ra=0,fd=function(){};function Av(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Av(fd,Array.prototype);var Da=function(e,t,r){Ol(n,e);function n(s,o,a,f){var c;return a===void 0&&(a="ObservableArray@"+St()),f===void 0&&(f=!1),c=e.call(this)||this,Qr(function(){var y=new Ma(a,o,f,!0);y.proxy_=go(c),_l(go(c),be,y),s&&s.length&&c.spliceWithArray(0,0,s),Ov&&Object.defineProperty(go(c),"0",Tv)}),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 li({next:function(){return o<s.length?{value:s[o++],done:!1}:{done:!0,value:void 0}}})},Pa(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(No).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Fo(Da.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 Iv(e){Vt(Da.prototype,""+e,ld(e))}function dd(e){if(e>ra){for(var t=ra;t<e+100;t++)Iv(t);ra=e}}dd(1e3);function Ev(e,t,r){return new Da(e,t,r)}function qt(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,fi(e)),r}if(Hr(e)){if(!t)return fe(26);var n=e[be].values_.get(t);return n||fe(27,t,fi(e)),n}if(Ra(e)||Ti(e)||xo(e))return e}else if(De(e)&&xo(e[be]))return e[be];fe(28)}function ja(e,t){if(e||fe(29),t!==void 0)return ja(qt(e,t));if(Ra(e)||Ti(e)||xo(e)||Wt(e)||Yr(e))return e;if(e[be])return e[be];fe(24,e)}function fi(e,t){var r;if(t!==void 0)r=qt(e,t);else{if(Sn(e))return e.name;Hr(e)||Wt(e)||Yr(e)?r=ja(e):r=qt(e)}return r.name_}function Qr(e){var t=Xr(),r=Go(!0);Tt();try{return e()}finally{Ot(),Ho(r),tr(t)}}var Bf=gi.toString;function La(e,t,r){return r===void 0&&(r=-1),ba(e,t,r)}function ba(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=Bf.call(e);if(o!==Bf.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=kf(e),t=kf(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(!ba(e[y],t[y],r-1,n,i))return!1}else{var g=Object.keys(e),M;if(y=g.length,Object.keys(t).length!==y)return!1;for(;y--;)if(M=g[y],!(It(t,M)&&ba(e[M],t[M],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function kf(e){return Nn(e)?e.slice():In(e)||Wt(e)||bi(e)||Yr(e)?Array.from(e.entries()):e}function li(e){return e[Symbol.iterator]=Sv,e}function Sv(){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=Na();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:Gl,extras:{getDebugName:fi},$mobx:be});var yd=Dt(_g(),1),DS=yd.default.configure,Wr=yd.default,na=100,{WARN:xv,LOG:jS,DEBUG:vr,VERBOSE:tt,ERROR:LS}=Se.setup(Se.INFO);nv({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Nv=()=>window.disableSpy=Gl(e=>{tt("[mobx]",e)});typeof window=="object"&&(window.getDependencyTree=Ai,window.getObserverTree=ov,window.getAtom=qt,window.getDebugName=fi,window.enableSpy=Nv);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 $v(e,t){return Be(()=>nt.structural(e.get(),t.get()))}function Si(e,t){return nt.shallow(e.applogs,t.applogs)}function Fa(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(tt("queryNodesComparer",r,n,i),!nt.structural(n.variables,i.variables))return tt("[queryNodesComparer] changed vars:",r,n,i),!1;if(!Si(n.logsOfThisNode,i.logsOfThisNode))return tt("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return tt("[queryNodesComparer] equal:",{a:e,b:t}),!0}var Cv=0;function er(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++Cv}{${t}}`;tt(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,s=Pv(e,a=>i=ke.array(a,{deep:!1,name:t,equals:r}),a=>{Be(()=>(r??nt.structural)(i,a))?vr(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),vr(`[${n}] updated`,{updatedItems:a,observableArr:i}))},{name:n}),o=Oi(i,()=>{tt(`[${n}] dispose`),o(),s()});return i}function Pv(e,t,r,{name:n}={}){vr("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let i=`${n}.autorunImm`,s,o=new ai(i,(...c)=>{vr(`[${i}] reaction.invalidate`,c),a(),Jb(()=>{r(s)})});function a(){o.track(()=>{let c=na&&performance.now();vr(`[${i}] runAndTrack:`,{name:n??e.name,fn:e}),s=e(),vr(`[${i}] runAndTrack =>`,s),na&&performance.now()-c>na&&xv(`[${i}] took ${performance.now()-c}ms`)})}return a(),t(s),vr.isEnabled&&vr(`[${i}] deps of reaction`,{reaction:o,result:s,deps:Ai(o)}),()=>{tt(`[${i}] dispose`),setTimeout(()=>o.dispose())}}function it(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[R,j]of o.entries())if(nt.structural(R,c)){f=j;break}if(f){let R=f.get();return tt(`[${y}] cache hit`,{untrackedArgs:c,cachedResult:R}),R}if(!s.keepAlive&&!Cb())return!n&&kb().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);tt(`[${y}] new computation`,{untrackedArgs:c});let g,M=Ge(()=>(tt(`[${y}] update->rerun`,Be(()=>({args:a})),t),tt.isDisabled||rd(),g=t.apply(this,a)),{...s,name:y});if(tt(`[${y}] deps`,Ai(M),{untrackedArgs:c}),o.set(c,M),!s.keepAlive){let R=Oi(M,()=>{tt(`[${y}] dispose`,M),R(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return M.get()}}function Rv(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:Mf,LOG:FS,DEBUG:Uv,VERBOSE:VS,ERROR:br}=Se.setup(Se.INFO,{prefix:"[thread]"});function nr(e){return e.init!==void 0}var Va=class{constructor(e,t,r,n=[]){this.name=e,this._applogs=n,this.parents=t===null?null:wf(t),this.filters=r,Be(()=>this.parents?.length===0)&&Mf("[Thread] empty parents array",e),xn(this,{applogsCids:Ge,insert:At,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 br("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw br("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw br("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw br("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw br("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw br("[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):Mf("unsubscribe called for non-existent",e)}notifySubscribers(e){Uv(`[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||br("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 br("[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 Rv(this.name)}};function va(e){"@babel/helpers - typeof";return va=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},va(e)}function hd(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Df(e){hd(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||va(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 Bv(e,t){hd(2,arguments);var r=Df(e),n=Df(t);return r.getTime()<n.getTime()}var kv=typeof global=="object"&&global&&global.Object===Object&&global,md=kv,Mv=typeof self=="object"&&self&&self.Object===Object&&self,Dv=md||Mv||Function("return this")(),ir=Dv,jv=ir.Symbol,Gt=jv,gd=Object.prototype,Lv=gd.hasOwnProperty,Fv=gd.toString,ni=Gt?Gt.toStringTag:void 0;function Vv(e){var t=Lv.call(e,ni),r=e[ni];try{e[ni]=void 0;var n=!0}catch{}var i=Fv.call(e);return n&&(t?e[ni]=r:delete e[ni]),i}var Kv=Vv,zv=Object.prototype,qv=zv.toString;function Gv(e){return qv.call(e)}var Hv=Gv,Wv="[object Null]",Jv="[object Undefined]",jf=Gt?Gt.toStringTag:void 0;function Xv(e){return e==null?e===void 0?Jv:Wv:jf&&jf in Object(e)?Kv(e):Hv(e)}var Cn=Xv;function Yv(e){return e!=null&&typeof e=="object"}var On=Yv,Qv="[object Symbol]";function Zv(e){return typeof e=="symbol"||On(e)&&Cn(e)==Qv}var di=Zv;function e_(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 t_=e_,r_=Array.isArray,Ht=r_,n_=1/0,Lf=Gt?Gt.prototype:void 0,Ff=Lf?Lf.toString:void 0;function bd(e){if(typeof e=="string")return e;if(Ht(e))return t_(e,bd)+"";if(di(e))return Ff?Ff.call(e):"";var t=e+"";return t=="0"&&1/e==-n_?"-0":t}var i_=bd;function o_(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pi=o_;function s_(e){return e}var vd=s_,a_="[object AsyncFunction]",u_="[object Function]",c_="[object GeneratorFunction]",f_="[object Proxy]";function l_(e){if(!pi(e))return!1;var t=Cn(e);return t==u_||t==c_||t==a_||t==f_}var _d=l_,d_=ir["__core-js_shared__"],ia=d_,Vf=function(){var e=/[^.]+$/.exec(ia&&ia.keys&&ia.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function p_(e){return!!Vf&&Vf in e}var y_=p_,h_=Function.prototype,m_=h_.toString;function g_(e){if(e!=null){try{return m_.call(e)}catch{}try{return e+""}catch{}}return""}var Zr=g_,b_=/[\\^$.*+?()[\]{}|]/g,v_=/^\[object .+?Constructor\]$/,__=Function.prototype,w_=Object.prototype,T_=__.toString,O_=w_.hasOwnProperty,A_=RegExp("^"+T_.call(O_).replace(b_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function I_(e){if(!pi(e)||y_(e))return!1;var t=_d(e)?A_:v_;return t.test(Zr(e))}var E_=I_;function S_(e,t){return e?.[t]}var x_=S_;function N_(e,t){var r=x_(e,t);return E_(r)?r:void 0}var en=N_,$_=en(ir,"WeakMap"),_a=$_;function C_(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 P_=C_,R_=800,U_=16,B_=Date.now;function k_(e){var t=0,r=0;return function(){var n=B_(),i=U_-(n-r);if(r=n,i>0){if(++t>=R_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var M_=k_;function D_(e){return function(){return e}}var j_=D_,L_=function(){try{var e=en(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Co=L_,F_=Co?function(e,t){return Co(e,"toString",{configurable:!0,enumerable:!1,value:j_(t),writable:!0})}:vd,V_=F_,K_=M_(V_),z_=K_,q_=9007199254740991,G_=/^(?:0|[1-9]\d*)$/;function H_(e,t){var r=typeof e;return t=t??q_,!!t&&(r=="number"||r!="symbol"&&G_.test(e))&&e>-1&&e%1==0&&e<t}var Ka=H_;function W_(e,t,r){t=="__proto__"&&Co?Co(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var J_=W_;function X_(e,t){return e===t||e!==e&&t!==t}var za=X_,Y_=Object.prototype,Q_=Y_.hasOwnProperty;function Z_(e,t,r){var n=e[t];(!(Q_.call(e,t)&&za(n,r))||r===void 0&&!(t in e))&&J_(e,t,r)}var ew=Z_,Kf=Math.max;function tw(e,t,r){return t=Kf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Kf(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),P_(e,this,a)}}var rw=tw,nw=9007199254740991;function iw(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=nw}var qa=iw;function ow(e){return e!=null&&qa(e.length)&&!_d(e)}var sw=ow,aw=Object.prototype;function uw(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||aw;return e===r}var cw=uw;function fw(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var lw=fw,dw="[object Arguments]";function pw(e){return On(e)&&Cn(e)==dw}var zf=pw,wd=Object.prototype,yw=wd.hasOwnProperty,hw=wd.propertyIsEnumerable,mw=zf(function(){return arguments}())?zf:function(e){return On(e)&&yw.call(e,"callee")&&!hw.call(e,"callee")},Ga=mw;function gw(){return!1}var bw=gw,Td=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qf=Td&&typeof module=="object"&&module&&!module.nodeType&&module,vw=qf&&qf.exports===Td,Gf=vw?ir.Buffer:void 0,_w=Gf?Gf.isBuffer:void 0,ww=_w||bw,wa=ww,Tw="[object Arguments]",Ow="[object Array]",Aw="[object Boolean]",Iw="[object Date]",Ew="[object Error]",Sw="[object Function]",xw="[object Map]",Nw="[object Number]",$w="[object Object]",Cw="[object RegExp]",Pw="[object Set]",Rw="[object String]",Uw="[object WeakMap]",Bw="[object ArrayBuffer]",kw="[object DataView]",Mw="[object Float32Array]",Dw="[object Float64Array]",jw="[object Int8Array]",Lw="[object Int16Array]",Fw="[object Int32Array]",Vw="[object Uint8Array]",Kw="[object Uint8ClampedArray]",zw="[object Uint16Array]",qw="[object Uint32Array]",Re={};Re[Mw]=Re[Dw]=Re[jw]=Re[Lw]=Re[Fw]=Re[Vw]=Re[Kw]=Re[zw]=Re[qw]=!0;Re[Tw]=Re[Ow]=Re[Bw]=Re[Aw]=Re[kw]=Re[Iw]=Re[Ew]=Re[Sw]=Re[xw]=Re[Nw]=Re[$w]=Re[Cw]=Re[Pw]=Re[Rw]=Re[Uw]=!1;function Gw(e){return On(e)&&qa(e.length)&&!!Re[Cn(e)]}var Hw=Gw;function Ww(e){return function(t){return e(t)}}var Jw=Ww,Od=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oi=Od&&typeof module=="object"&&module&&!module.nodeType&&module,Xw=oi&&oi.exports===Od,oa=Xw&&md.process,Yw=function(){try{var e=oi&&oi.require&&oi.require("util").types;return e||oa&&oa.binding&&oa.binding("util")}catch{}}(),Hf=Yw,Wf=Hf&&Hf.isTypedArray,Qw=Wf?Jw(Wf):Hw,Ad=Qw,Zw=Object.prototype,e0=Zw.hasOwnProperty;function t0(e,t){var r=Ht(e),n=!r&&Ga(e),i=!r&&!n&&wa(e),s=!r&&!n&&!i&&Ad(e),o=r||n||i||s,a=o?lw(e.length,String):[],f=a.length;for(var c in e)(t||e0.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ka(c,f)))&&a.push(c);return a}var r0=t0;function n0(e,t){return function(r){return e(t(r))}}var i0=n0,o0=i0(Object.keys,Object),s0=o0,a0=Object.prototype,u0=a0.hasOwnProperty;function c0(e){if(!cw(e))return s0(e);var t=[];for(var r in Object(e))u0.call(e,r)&&r!="constructor"&&t.push(r);return t}var f0=c0;function l0(e){return sw(e)?r0(e):f0(e)}var Id=l0,d0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,p0=/^\w*$/;function y0(e,t){if(Ht(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||di(e)?!0:p0.test(e)||!d0.test(e)||t!=null&&e in Object(t)}var Ha=y0,h0=en(Object,"create"),yi=h0;function m0(){this.__data__=yi?yi(null):{},this.size=0}var g0=m0;function b0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var v0=b0,_0="__lodash_hash_undefined__",w0=Object.prototype,T0=w0.hasOwnProperty;function O0(e){var t=this.__data__;if(yi){var r=t[e];return r===_0?void 0:r}return T0.call(t,e)?t[e]:void 0}var A0=O0,I0=Object.prototype,E0=I0.hasOwnProperty;function S0(e){var t=this.__data__;return yi?t[e]!==void 0:E0.call(t,e)}var x0=S0,N0="__lodash_hash_undefined__";function $0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yi&&t===void 0?N0:t,this}var C0=$0;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=g0;Pn.prototype.delete=v0;Pn.prototype.get=A0;Pn.prototype.has=x0;Pn.prototype.set=C0;var Jf=Pn;function P0(){this.__data__=[],this.size=0}var R0=P0;function U0(e,t){for(var r=e.length;r--;)if(za(e[r][0],t))return r;return-1}var Wo=U0,B0=Array.prototype,k0=B0.splice;function M0(e){var t=this.__data__,r=Wo(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():k0.call(t,r,1),--this.size,!0}var D0=M0;function j0(e){var t=this.__data__,r=Wo(t,e);return r<0?void 0:t[r][1]}var L0=j0;function F0(e){return Wo(this.__data__,e)>-1}var V0=F0;function K0(e,t){var r=this.__data__,n=Wo(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var z0=K0;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=R0;Rn.prototype.delete=D0;Rn.prototype.get=L0;Rn.prototype.has=V0;Rn.prototype.set=z0;var Jo=Rn,q0=en(ir,"Map"),hi=q0;function G0(){this.size=0,this.__data__={hash:new Jf,map:new(hi||Jo),string:new Jf}}var H0=G0;function W0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var J0=W0;function X0(e,t){var r=e.__data__;return J0(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Xo=X0;function Y0(e){var t=Xo(this,e).delete(e);return this.size-=t?1:0,t}var Q0=Y0;function Z0(e){return Xo(this,e).get(e)}var eT=Z0;function tT(e){return Xo(this,e).has(e)}var rT=tT;function nT(e,t){var r=Xo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var iT=nT;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=H0;Un.prototype.delete=Q0;Un.prototype.get=eT;Un.prototype.has=rT;Un.prototype.set=iT;var Yo=Un,oT="Expected a function";function Wa(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(oT);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(Wa.Cache||Yo),r}Wa.Cache=Yo;var sT=Wa,aT=500;function uT(e){var t=sT(e,function(n){return r.size===aT&&r.clear(),n}),r=t.cache;return t}var cT=uT,fT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lT=/\\(\\)?/g,dT=cT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(fT,function(r,n,i,s){t.push(i?s.replace(lT,"$1"):n||r)}),t}),pT=dT;function yT(e){return e==null?"":i_(e)}var hT=yT;function mT(e,t){return Ht(e)?e:Ha(e,t)?[e]:pT(hT(e))}var Qo=mT,gT=1/0;function bT(e){if(typeof e=="string"||di(e))return e;var t=e+"";return t=="0"&&1/e==-gT?"-0":t}var xi=bT;function vT(e,t){t=Qo(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[xi(t[r++])];return r&&r==n?e:void 0}var Ja=vT;function _T(e,t,r){var n=e==null?void 0:Ja(e,t);return n===void 0?r:n}var wT=_T;function TT(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Ed=TT,Xf=Gt?Gt.isConcatSpreadable:void 0;function OT(e){return Ht(e)||Ga(e)||!!(Xf&&e&&e[Xf])}var AT=OT;function Sd(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=AT),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 IT=Sd;function ET(e){var t=e==null?0:e.length;return t?IT(e,1):[]}var ST=ET;function xT(e){return z_(rw(e,void 0,ST),e+"")}var NT=xT;function $T(){this.__data__=new Jo,this.size=0}var CT=$T;function PT(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var RT=PT;function UT(e){return this.__data__.get(e)}var BT=UT;function kT(e){return this.__data__.has(e)}var MT=kT,DT=200;function jT(e,t){var r=this.__data__;if(r instanceof Jo){var n=r.__data__;if(!hi||n.length<DT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Yo(n)}return r.set(e,t),this.size=r.size,this}var LT=jT;function Bn(e){var t=this.__data__=new Jo(e);this.size=t.size}Bn.prototype.clear=CT;Bn.prototype.delete=RT;Bn.prototype.get=BT;Bn.prototype.has=MT;Bn.prototype.set=LT;var wo=Bn;function FT(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 VT=FT;function KT(){return[]}var zT=KT,qT=Object.prototype,GT=qT.propertyIsEnumerable,Yf=Object.getOwnPropertySymbols,HT=Yf?function(e){return e==null?[]:(e=Object(e),VT(Yf(e),function(t){return GT.call(e,t)}))}:zT,WT=HT;function JT(e,t,r){var n=t(e);return Ht(e)?n:Ed(n,r(e))}var XT=JT;function YT(e){return XT(e,Id,WT)}var Qf=YT,QT=en(ir,"DataView"),Ta=QT,ZT=en(ir,"Promise"),Oa=ZT,eO=en(ir,"Set"),Aa=eO,Zf="[object Map]",tO="[object Object]",el="[object Promise]",tl="[object Set]",rl="[object WeakMap]",nl="[object DataView]",rO=Zr(Ta),nO=Zr(hi),iO=Zr(Oa),oO=Zr(Aa),sO=Zr(_a),Fr=Cn;(Ta&&Fr(new Ta(new ArrayBuffer(1)))!=nl||hi&&Fr(new hi)!=Zf||Oa&&Fr(Oa.resolve())!=el||Aa&&Fr(new Aa)!=tl||_a&&Fr(new _a)!=rl)&&(Fr=function(e){var t=Cn(e),r=t==tO?e.constructor:void 0,n=r?Zr(r):"";if(n)switch(n){case rO:return nl;case nO:return Zf;case iO:return el;case oO:return tl;case sO:return rl}return t});var il=Fr,aO=ir.Uint8Array,ol=aO,uO="__lodash_hash_undefined__";function cO(e){return this.__data__.set(e,uO),this}var fO=cO;function lO(e){return this.__data__.has(e)}var dO=lO;function Po(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Yo;++t<r;)this.add(e[t])}Po.prototype.add=Po.prototype.push=fO;Po.prototype.has=dO;var pO=Po;function yO(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 hO=yO;function mO(e,t){return e.has(t)}var gO=mO,bO=1,vO=2;function _O(e,t,r,n,i,s){var o=r&bO,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,M=!0,R=r&vO?new pO: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;M=!1;break}if(R){if(!hO(t,function(B,z){if(!gO(R,z)&&(j===B||i(j,B,r,n,s)))return R.push(z)})){M=!1;break}}else if(!(j===te||i(j,te,r,n,s))){M=!1;break}}return s.delete(e),s.delete(t),M}var xd=_O;function wO(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var TO=wO;function OO(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var AO=OO,IO=1,EO=2,SO="[object Boolean]",xO="[object Date]",NO="[object Error]",$O="[object Map]",CO="[object Number]",PO="[object RegExp]",RO="[object Set]",UO="[object String]",BO="[object Symbol]",kO="[object ArrayBuffer]",MO="[object DataView]",sl=Gt?Gt.prototype:void 0,sa=sl?sl.valueOf:void 0;function DO(e,t,r,n,i,s,o){switch(r){case MO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case kO:return!(e.byteLength!=t.byteLength||!s(new ol(e),new ol(t)));case SO:case xO:case CO:return za(+e,+t);case NO:return e.name==t.name&&e.message==t.message;case PO:case UO:return e==t+"";case $O:var a=TO;case RO:var f=n&IO;if(a||(a=AO),e.size!=t.size&&!f)return!1;var c=o.get(e);if(c)return c==t;n|=EO,o.set(e,t);var y=xd(a(e),a(t),n,i,s,o);return o.delete(e),y;case BO:if(sa)return sa.call(e)==sa.call(t)}return!1}var jO=DO,LO=1,FO=Object.prototype,VO=FO.hasOwnProperty;function KO(e,t,r,n,i,s){var o=r&LO,a=Qf(e),f=a.length,c=Qf(t),y=c.length;if(f!=y&&!o)return!1;for(var g=f;g--;){var M=a[g];if(!(o?M in t:VO.call(t,M)))return!1}var R=s.get(e),j=s.get(t);if(R&&j)return R==t&&j==e;var te=!0;s.set(e,t),s.set(t,e);for(var W=o;++g<f;){M=a[g];var B=e[M],z=t[M];if(n)var Y=o?n(z,B,M,t,e,s):n(B,z,M,e,t,s);if(!(Y===void 0?B===z||i(B,z,r,n,s):Y)){te=!1;break}W||(W=M=="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 zO=KO,qO=1,al="[object Arguments]",ul="[object Array]",mo="[object Object]",GO=Object.prototype,cl=GO.hasOwnProperty;function HO(e,t,r,n,i,s){var o=Ht(e),a=Ht(t),f=o?ul:il(e),c=a?ul:il(t);f=f==al?mo:f,c=c==al?mo:c;var y=f==mo,g=c==mo,M=f==c;if(M&&wa(e)){if(!wa(t))return!1;o=!0,y=!1}if(M&&!y)return s||(s=new wo),o||Ad(e)?xd(e,t,r,n,i,s):jO(e,t,f,r,n,i,s);if(!(r&qO)){var R=y&&cl.call(e,"__wrapped__"),j=g&&cl.call(t,"__wrapped__");if(R||j){var te=R?e.value():e,W=j?t.value():t;return s||(s=new wo),i(te,W,r,n,s)}}return M?(s||(s=new wo),zO(e,t,r,n,i,s)):!1}var WO=HO;function Nd(e,t,r,n,i){return e===t?!0:e==null||t==null||!On(e)&&!On(t)?e!==e&&t!==t:WO(e,t,r,n,Nd,i)}var $d=Nd,JO=1,XO=2;function YO(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 wo;if(n)var M=n(c,y,f,e,t,g);if(!(M===void 0?$d(y,c,JO|XO,n,g):M))return!1}}return!0}var QO=YO;function ZO(e){return e===e&&!pi(e)}var Cd=ZO;function eA(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 tA=eA;function rA(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Pd=rA;function nA(e){var t=tA(e);return t.length==1&&t[0][2]?Pd(t[0][0],t[0][1]):function(r){return r===e||QO(r,e,t)}}var iA=nA;function oA(e,t){return e!=null&&t in Object(e)}var sA=oA;function aA(e,t,r){t=Qo(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=xi(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&&qa(i)&&Ka(o,i)&&(Ht(e)||Ga(e)))}var uA=aA;function cA(e,t){return e!=null&&uA(e,t,sA)}var Rd=cA,fA=1,lA=2;function dA(e,t){return Ha(e)&&Cd(t)?Pd(xi(e),t):function(r){var n=wT(r,e);return n===void 0&&n===t?Rd(r,e):$d(t,n,fA|lA)}}var pA=dA;function yA(e){return function(t){return t?.[e]}}var hA=yA;function mA(e){return function(t){return Ja(t,e)}}var gA=mA;function bA(e){return Ha(e)?hA(xi(e)):gA(e)}var vA=bA;function _A(e){return typeof e=="function"?e:e==null?vd:typeof e=="object"?Ht(e)?pA(e[0],e[1]):iA(e):vA(e)}var wA=_A;function TA(e,t,r,n){if(!pi(e))return e;t=Qo(t,e);for(var i=-1,s=t.length,o=s-1,a=e;a!=null&&++i<s;){var f=xi(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=pi(y)?y:Ka(t[i+1])?[]:{})}ew(a,f,c),a=a[f]}return e}var OA=TA;function AA(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Ja(e,o);r(a,o)&&OA(s,Qo(o,e),a)}return s}var IA=AA;function EA(e,t){return IA(e,t,function(r,n){return Rd(e,n)})}var SA=EA,xA=NT(function(e,t){return e==null?{}:SA(e,t)}),fl=xA,NA=4294967295,$A=NA-1,CA=Math.floor,PA=Math.min;function RA(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=di(t),c=t===void 0;i<s;){var y=CA((i+s)/2),g=r(e[y]),M=g!==void 0,R=g===null,j=g===g,te=di(g);if(o)var W=n||j;else c?W=j&&(n||M):a?W=j&&M&&(n||!R):f?W=j&&M&&!R&&(n||!te):R||te?W=!1:W=n?g<=t:g<t;W?i=y+1:s=y}return PA(s,$A)}var UA=RA;function BA(e,t,r){return UA(e,t,wA(r,2))}var kA=BA,{WARN:KS,LOG:zS,DEBUG:qS,VERBOSE:ll,ERROR:MA}=Se.setup(Se.INFO),Ud=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Bd=(e,t,r="asc")=>Ud(e.ts,t.ts,r);function Jr(e,t="asc"){return e.sort((r,n)=>Bd(r,n,t))}var kd=(e,t)=>Bv(new Date(e.ts),new Date(t.ts));var Md=(e,t,r)=>nt.structural(fl(e,r),fl(t,r)),Xa=e=>{let t=new Map;for(let r of e){if(!r)throw MA("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 Ya(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){ll("[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 ll("[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},dl=function(t){return Fd(t)/t.length},ft={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return ft.max(e)-ft.min(e)},midrange:function(e){return ft.range(e)/2},sum:Fd,mean:dl,average:dl,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=ft.mean(e);return ft.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(ft.variance(e))},meanAbsoluteDeviation:function(e){var t=ft.mean(e);return ft.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=ft.mean(e),r=ft.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};ft.average=ft.mean;function Qa(){return new Date().toISOString()}var Ue=Dt(Qt(),1),Vd=Dt(Ig(),1),Ro=e=>Ue.Type.Union([e,Ue.Type.Null()]);var Kd=/^(k51qz|baguq)[0-9a-z]{56,57}$/,DA=/^[0-9A-Fa-f]{7,8}$/g;Ue.FormatRegistry.Set("EntityID",e=>!!e.match(DA)||!!e.match(Kd));var Za=Ue.Type.String();Ue.FormatRegistry.Set("CID",e=>!!e.match(Kd));var Uo=Ue.Type.String({format:"CID"}),jA=/^http([s]?):\/\/.*\..*/;Ue.FormatRegistry.Set("URL",e=>!!e.match(jA));var LA=Ue.Type.String({format:"URL"}),zd=Ue.Type.Object({en:Za,at:Ue.Type.String(),vl:Ro(Ue.Type.Union([Ue.Type.String(),Ue.Type.Boolean(),Ue.Type.Number()])),ts:Ue.Type.String(),ag:Ue.Type.String(),pv:Uo}),Ia=Vd.TypeCompiler.Compile(zd);var FA=Ia.Check.bind(Ia),qd=Ue.Type.Object({cid:Uo,en:Za,at:Ue.Type.String(),vl:Ro(Ue.Type.Union([Ue.Type.String(),Ue.Type.Boolean(),Ue.Type.Number()])),ts:Ue.Type.String(),ag:Ue.Type.String(),pv:Ro(Uo)}),Bo=Vd.TypeCompiler.Compile(qd),Gd=e=>Array.from(Bo.Errors(e)),eu=Bo.Check.bind(Bo),{WARN:Hd,LOG:GS,DEBUG:VA,VERBOSE:HS,ERROR:si}=Se.setup(Se.INFO);function Wd(e,{ts:t,threadForPv:r}={}){let n=Xd(e,t??Qa()),i=Yd(n,r),s=Zs(i).toString();e.cid&&e.cid!==s&&Hd("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(!eu(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 ko(e){let t=()=>(Be(()=>e.length<2&&VA(`joinThreads with count=${e.length}`)),Jr(Xa(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=At(function(i,s){return nr(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 Zo(Be(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:pl,LOG:WS,DEBUG:yl,VERBOSE:Lr,ERROR:KA}=Se.setup(Se.INFO),Zo=class extends Va{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:At}),this.subscribeToParents()}_parentSubscriptions=new Map;subscribeToParents(){let e=zt(()=>{this.parents.length||pl("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(){yl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&pl(`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),nr(r))this._applogs.replace([...r.init]);else{for(let n of r.added)this._applogs.splice(kA(this._applogs,n,"ts"),0,n);if(r.removed){for(let n of r.removed)if(!this._applogs.remove(n))if(!nr(t)&&t.removed?.includes(n))yl("Ignoring remove event for non-existent because it was part of parent event's removed",n,t);else throw KA(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,n,{thread:this,event:t,mapResult:r})}}Lr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Ai(this._applogs)),this.notifySubscribers(r)}},{WARN:JS,LOG:XS,DEBUG:YS,VERBOSE:aa,ERROR:zA}=Se.setup(Se.INFO),Tr=it("rollingFilter",function(t,r,n={}){let i=Zd(r),s=Ea(i),o=ke.array(Be(()=>s(t.applogs)),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${Wr(i)}}`}`}),a=g=>{let M;return nr(g)?M={init:s(g.init)}:M={added:s(g.added),removed:g.removed},aa(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",M),M},f=new Zo(`${t.name} | ${n.name||`rollingFilter{${Wr(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,a),c=Yb(()=>JSON.parse(JSON.stringify(r)),g=>{aa(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=Ea(i),f.triggerRemap()}),y=Oi(o,()=>{aa(`rollingFilter<${Be(()=>t.name)}>${n.name?` '${n.name}'`:""} unobserve`,i),c(),y()});return f},{equals:Si,argsDebugName:(e,t,r)=>Qe({caller:"rollingFilter",thread:e,pattern:t,args:r})}),Qd=it("rollingMapper",function(t,r,n={}){let i=Be(()=>r.call(null,{init:t.applogs},t));if(!nr(i))throw zA("Initial run must return init event");let s=i.init;return new Zo(`${t.name} | ${n.name||"rollingMapper"}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],s,r)},{equals:Si,argsDebugName:(e,t,r)=>Qe({caller:"rollingMapper",thread:e,args:r})}),qA=it("rollingAcc",function(t,r,n,i={}){return n=At(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 Ea(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 GA=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?ko([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 er(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return ko(er(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogs(){return er(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return ko(er(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:QS,LOG:mi,DEBUG:Or,VERBOSE:xe,ERROR:Mo}=Se.setup(Se.INFO,{prefix:"[q]"}),HA=it("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 Mo("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Qd(t,function(o,a){let f=nr(o),c,y=[],g=f?null:[];f?(i=new Map,c=o.init):c=o.added;let M;for(let R=r?0:c.length-1;r?R<c.length:R>=0;r?R++:R--){let j=c[R],te=Wr([j.en,j.at]);if(M&&(r?M>j.ts:M<j.ts))throw Mo("lastWriteWins.mapper logs not sorted:",M,r?">":"<",j.ts,{log:j,i:R,newLogs:c,inverseToOnlyReturnFirstLogs:r});M=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(([R,j])=>[R,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||zt(()=>{xe(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,s.applogs.length)}),s},{equals:Si,argsDebugName:e=>Qe({caller:"lastWriteWins",thread:e})}),ZS=it("withoutDeleted",function(t){if(xe(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw Mo("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=er(()=>r.map(s=>s.en),{name:n});return xe.isDisabled||zt(()=>{xe(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),Tr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Si}),WA=it("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=JA(t,o,a,i);return xe.isDisabled||zt(()=>xe("query result:",_n(f))),f},{equals:Fa,argsDebugName:(e,t,r)=>Qe({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),JA=it("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]=Ya(n,a?.variables??{});xe("[queryStep.doQuery] patternWithoutVars: ",f);let y=Tr(t,f),g=tp(c),M=er(()=>{let R=y.map(j=>({log:j,vars:g(j)}));return xe.isEnabled&&xe("[queryStep.doQuery] step node:",a?.variables," =>",R,"from:",Be(()=>y.applogs)),R.map(({log:j,vars:te})=>{let W=Object.assign({},a?.variables,te);return new GA(es.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&&zt(()=>xe("[queryStep.doQuery] resultNodes:",[...M])),i.debug&&mi("[queryStep] step result:",Be(()=>M.map(({variables:R,logsOfThisNode:j})=>({variables:R,thread:j.applogs})))),M}let o=er(()=>(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&&zt(()=>xe("[queryStep] observableResultNodes:",[...o])),new ep(o)},{equals:Fa,argsDebugName:(e,t,r)=>Qe({caller:"queryStep",thread:e,pattern:r})}),ex=it("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]=Ya(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&&mi("[queryNot] node result:",f,"=>",g.applogs),g.isEmpty})}return new ep(s)},{equals:Fa,argsDebugName:(e,t,r)=>Qe({caller:"queryNot",thread:e,pattern:r})}),tx=it("filterAndMap",function(t,r,n){Or(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=Tr(t,r);xe("[filterAndMap] filtered:",i.untrackedSize),xe.isDisabled||zt(()=>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=er(s,{name:o});return xe.isDisabled||zt(()=>xe("[filterAndMap] mapped:",a)),a},{equals:nt.structural,argsDebugName:(e,t)=>Qe({caller:"filterAndMap",thread:e,pattern:t})}),rx=it("queryAndMap",function(t,r,n,i={}){Or(`queryAndMap<${t.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let s=Qe({thread:t,caller:"queryAndMap"}),o=WA(t,r);xe("[queryAndMap] filtered count:",o.untrackedSize);let a=er(()=>{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||zt(()=>xe("[queryAndMap] result:",_n(a))),a},{equals:nt.structural,argsDebugName:(e,t)=>Qe({caller:"queryAndMap",thread:e,pattern:t})}),nx=it("queryEntity",function(t,r,n,i){Or(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let s=Tr(t,{en:n,at:YA(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:$v,argsDebugName:(e,t,r)=>Qe({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),ix=it("agentsOfThread",function(t){mi(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=ke.map(),n=At(s=>{for(let o of nr(s)?s.init:s.added){let a=r.get(o.ag)??0;r.set(o.ag,a+1)}for(let o of!nr(s)&&s.removed||[]){let a=r.get(o.ag);if(!a||a<1)throw Mo("[agentsOfThread] number is now negative",{log:o,event:s,mapped:r,prev:a});r.set(o.ag,a-1)}mi(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:s,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return Yl(r,i),r}),XA=it("entityOverlap",function(t,r){return mi(`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 ox=it("entityOverlapCount",function(t,r){return Ge(()=>XA(t,r).get().length)});function tp(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function YA(e,t){return t.map(r=>QA(e,r))}function QA(e,t){return`${e}/${t}`}var{WARN:ZA,LOG:e1,DEBUG:sx,VERBOSE:t1,ERROR:To}=Se.setup(Se.INFO),rp=class extends Va{constructor(e,t=[],r){super(e,null,r,t),xn(this,{})}insert(e){let t=Qa(),r=HA(this),n=e.map(i=>Wd(i,{ts:t,threadForPv:r}));return this.insertRaw(n)}insertRaw(e){let t=Xa(e);if(t.length!==e.length)throw To(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let r=e.filter(s=>!eu(s));if(r.length)throw To(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});let n=e.filter(s=>this.hasApplog(s,!1));if(n.length)throw To(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(!e.length){ZA("[insertRaw] skipping empty insert empty logs array");return}e1("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}},es=class Sa extends rp{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,xn(this,{_applogs:ke.shallow})}static empty(t){return Sa.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new Sa(r??"in-memory",t,[],n)}get readOnly(){return this._readOnly}persist(t){if(t1("[InMem.persist] no persist for",t),this.readOnly)throw To("[persist] called for readOnly thread")}};var r1=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}}}),n1=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,M=s.length;do{if(y>=M||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}}}),i1=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}}}),ou=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:r1(),decode:n1(),encodingLength:i1()}}}),o1=42;function s1(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Yt.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[o1]=s1;var a1=e=>Js(e,op),tn=Dt(ou(),1),tu={SHA2_256:18,LENGTH:32,DAG_PB:112},u1=40;function ts(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 c1(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 f1(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},Ni={"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=Ni["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=Ni["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=Ni["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=Ni.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}},$i={"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=$i["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=$i["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=$i["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=$i.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}},l1={toTyped:Ni.CarV1HeaderOrV2Pragma,toRepresentation:$i.CarV1HeaderOrV2Pragma},Xx=Ws(),Yx=Dt(ou(),1),Qx=[new Z(C.map,2),new Z(C.string,"version"),new Z(C.uint,1),new Z(C.string,"roots")],Zx=new Z(C.tag,42);async function sp(e,t){let r=ts(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=a1(n);if(l1.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=c1(await e.exactly(u1,!0));e.seek(s.dataOffset-e.pos);let o=await sp(e,1);return Object.assign(o,s)}async function d1(e){let t=await e.exactly(2,!1);if(t[0]===tu.SHA2_256&&t[1]===tu.LENGTH){let o=await e.exactly(34,!0),a=ti(o);return Yt.create(0,tu.DAG_PB,a)}let r=ts(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=ts(await e.upTo(8),e),i=await e.exactly(f1(await e.upTo(8)),!0),s=ti(i);return Yt.create(r,n,s)}async function ap(e){let t=e.pos,r=ts(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await d1(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function p1(e){let{cid:t,blockLength:r}=await ap(e);return{bytes:await e.exactly(r,!0),cid:t}}async function y1(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=m1(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await p1(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await y1(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 h1(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 h1(r)}function m1(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 g1=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 g1(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}},eN=class nu 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 nu(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await pp(t);return new nu(r,n,i)}},tN=class iu 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 iu(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await pp(t);return new iu(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 rN=Dt(ou(),1);var nN=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:b1,LOG:iN,DEBUG:ru,VERBOSE:oN,ERROR:ip}=Se.setup(Se.INFO);async function su(e){let{roots:t,blocks:r}=await hp(e);if(!t||!r)throw ip("decodeCar is funky",{roots:t,blocks:r});t.length!==1&&b1("Unexpected roots count:",t);let n=r.get(t[0]),i;ru("root:",n,{blocks:r}),n.info?(i=r.get(n.applogs.toString()).logs,ru("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 Yt&&(f.pv=f.pv.toV1().toString()),{...f,cid:a}}),ru("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(),fo(i));return{roots:t,blocks:r}}function au(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}()}var{WARN:ns,LOG:DN,DEBUG:Ci,VERBOSE:jN,ERROR:rs}=cs.setup(cs.DEBUG),v1=114,_1=["https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all","https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all"];async function LN(e,{readOnly:t=!0,pinnedCID:r}={}){let n=ht.parse(e);Ci("[retrieveThread] parsedPubID",n);let i;if(n.code!==v1)Ci("[retrieveThread] pubID is not IPNS - using as CID"),i=n;else if(r)Ci("[retrieveThread] using pinnedCID"),i=ht.parse(r);else{if(!e)throw rs("[retrieveThread] neither pubID nor pinnedCID provided");try{i=await w1(e),Ci("Resolved pub to CID",i.toString())}catch(y){throw rs(`Failed to resolve IPNS ${e}:`,y)}}let s=await T1(i),{applogs:o}=await su(s),a=o.filter(y=>y instanceof Uint8Array);a.length&&ns(`Found ${a.length} encrypted logs - skipping`);let f=o.filter(y=>!(y instanceof Uint8Array));Jr(f);let c=es.fromArray(f,`preview${e&&e!==i.toString()?"-"+e:""}@${i.toString()}`,t);return{cid:i,thread:c,encryptedCount:a.length}}async function w1(e){let r=await(await fetch(`https://name.web3.storage/name/${e}`)).json();return r.value.startsWith("/ipfs/")||ns("IPNS value is not '/ipfs/..':",r),ht.parse(r.value.replace("/ipfs/",""))}async function T1(e){Ci("Retrieving:",e);let t;for(let r of _1){let n=r.replaceAll("CID",e.toString()),i=await fetch(n);(!i?.ok||!i?.body)&&(t=rs(`[retrieveCar] unexpected response ${i?.statusText}`,{url:n}),ns("Gateway failed:",n,t)),t=au(i.body.getReader())}if(t instanceof Error)throw t;return(await O1(t)).car}async function O1(e){let t=fr(lr(e)),r=await t.header(),n=[],i=!1;try{for await(let s of t.blocks())n.push(s);i=!0}catch(s){if(rs("Failed to read car:",s,{blocks:n,header:r}),n.length===0)throw s;ns(`Returning half-baked car with ${n.length} blocks`)}return{complete:i,car:new Pr(r,n)}}export{LN as a,w1 as b,T1 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-4NAXCY5L.min.js.map