@wovin/connect-nftstorage 0.0.6 → 0.0.8

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 as,e as us,f as ki,g as ht}from"./chunk-SOBCOB7T.min.js";var yc=Bi((AI,pc)=>{"use strict";pc.exports=bs;var dc=128,Zp=127,ey=~Zp,ty=Math.pow(2,31);function bs(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw bs.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=ty;)t[r++]=e&255|dc,e/=128;for(;e&ey;)t[r++]=e&255|dc,e>>>=7;return t[r]=e|0,bs.bytes=r-n+1,t}});var gc=Bi((II,mc)=>{"use strict";mc.exports=vs;var ry=128,hc=127;function vs(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a||i>49)throw vs.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&hc)<<i:(o&hc)*Math.pow(2,i),i+=7}while(o>=ry);return vs.bytes=s-n,r}});var vc=Bi((EI,bc)=>{"use strict";var ny=Math.pow(2,7),iy=Math.pow(2,14),oy=Math.pow(2,21),sy=Math.pow(2,28),ay=Math.pow(2,35),uy=Math.pow(2,42),cy=Math.pow(2,49),fy=Math.pow(2,56),ly=Math.pow(2,63);bc.exports=function(e){return e<ny?1:e<iy?2:e<oy?3:e<sy?4:e<ay?5:e<uy?6:e<cy?7:e<fy?8:e<ly?9:10}});var Ji=Bi((SI,_c)=>{"use strict";_c.exports={encode:yc(),decode:gc(),encodingLength:vc()}});var Tp=["string","number","bigint","symbol"],Op=["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 uu(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Tp.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Ap(e))return"Buffer";let r=Ip(e);return r||"Object"}function Ap(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Ip(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Op.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",Ep=new TextDecoder,Sp=new TextEncoder;function Di(e){return sn&&globalThis.Buffer.isBuffer(e)}function du(e){return e instanceof Uint8Array?Di(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var pu=sn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):fu(e,t,r):(e,t,r)=>r-t>64?Ep.decode(e.subarray(t,r)):fu(e,t,r),yu=sn?e=>e.length>64?globalThis.Buffer.from(e):cu(e):e=>e.length>64?Sp.encode(e):cu(e);var an=sn?(e,t,r)=>Di(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),hu=sn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),du(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},mu=sn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function gu(e,t){if(Di(e)&&Di(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 cu(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 fu(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 xp(n)}var lu=4096;function xp(e){let t=e.length;if(t<=lu)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=lu));return r}var Np=256,Mi=class{constructor(t=Np){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=mu(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=hu(this.chunks,this.cursor);return t&&this.reset(),r}};var ve="CBOR decode error:",cs="CBOR encode error:",Mn=[];Mn[23]=1;Mn[24]=2;Mn[25]=3;Mn[26]=5;Mn[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 bu(e,t,r,n){return new ce(L.uint,ot(e,t+1,n),2)}function vu(e,t,r,n){return new ce(L.uint,st(e,t+1,n),3)}function _u(e,t,r,n){return new ce(L.uint,at(e,t+1,n),5)}function wu(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 Tu(e,t,r,n){return new ce(L.negint,-1-ot(e,t+1,n),2)}function Ou(e,t,r,n){return new ce(L.negint,-1-st(e,t+1,n),3)}function Au(e,t,r,n){return new ce(L.negint,-1-at(e,t+1,n),5)}var fs=BigInt(-1),Iu=BigInt(1);function Eu(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,fs-BigInt(i),9)}function ji(e,t){let r=t.value,n=typeof r=="bigint"?r*fs-Iu:r*-1-1;ze(e,t.type.majorEncoded,n)}ji.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*fs-Iu: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 Su(e,t,r,n){return jn(e,t,1,r)}function xu(e,t,r,n){return jn(e,t,2,ot(e,t+1,n))}function Nu(e,t,r,n){return jn(e,t,3,st(e,t+1,n))}function $u(e,t,r,n){return jn(e,t,5,at(e,t+1,n))}function Cu(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?yu(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 Cp(Li(t),Li(r))};function Cp(e,t){return e.length<t.length?-1:e.length>t.length?1:gu(e,t)}function Ln(e,t,r,n,i){let s=r+n;Xt(e,t,s);let o=new ce(L.string,pu(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=an(e,t+r,t+s)),o}function Pu(e,t,r,n){return Ln(e,t,1,r,n)}function Ru(e,t,r,n){return Ln(e,t,2,ot(e,t+1,n),n)}function Uu(e,t,r,n){return Ln(e,t,3,st(e,t+1,n),n)}function Bu(e,t,r,n){return Ln(e,t,5,at(e,t+1,n),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 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 Mu(e,t,r,n){return cn(e,t,1,r)}function ju(e,t,r,n){return cn(e,t,2,ot(e,t+1,n))}function Lu(e,t,r,n){return cn(e,t,3,st(e,t+1,n))}function Fu(e,t,r,n){return cn(e,t,5,at(e,t+1,n))}function Vu(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 Ku(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 zu(e,t,r,n){return fn(e,t,1,r)}function qu(e,t,r,n){return fn(e,t,2,ot(e,t+1,n))}function Gu(e,t,r,n){return fn(e,t,3,st(e,t+1,n))}function Hu(e,t,r,n){return fn(e,t,5,at(e,t+1,n))}function Wu(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 Ju(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 Xu(e,t,r,n){return new ce(L.tag,r,1)}function Yu(e,t,r,n){return new ce(L.tag,ot(e,t+1,n),2)}function Qu(e,t,r,n){return new ce(L.tag,st(e,t+1,n),3)}function Zu(e,t,r,n){return new ce(L.tag,at(e,t+1,n),5)}function ec(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 Dp=20,Mp=21,jp=22,Lp=23;function tc(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 rc(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 ls(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 nc(e,t,r,n){return ls(ds(e,t+1),3,n)}function ic(e,t,r,n){return ls(ps(e,t+1),5,n)}function oc(e,t,r,n){return ls(cc(e,t+1),9,n)}function zi(e,t,r){let n=t.value;if(n===!1)e.push([L.float.majorEncoded|Dp]);else if(n===!0)e.push([L.float.majorEncoded|Mp]);else if(n===null)e.push([L.float.majorEncoded|jp]);else if(n===void 0)e.push([L.float.majorEncoded|Lp]);else{let i,s=!1;(!r||r.float64!==!0)&&(ac(n),i=ds(Nt,1),n===i||Number.isNaN(n)?(Nt[0]=249,e.push(Nt.slice(0,3)),s=!0):(uc(n),i=ps(Nt,1),n===i&&(Nt[0]=250,e.push(Nt.slice(0,5)),s=!0))),s||(Fp(n),i=cc(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){ac(n);let i=ds(Nt,1);if(n===i||Number.isNaN(n))return 3;if(uc(n),i=ps(Nt,1),n===i)return 5}return 9};var sc=new ArrayBuffer(9),gt=new DataView(sc,1),Nt=new Uint8Array(sc,0);function ac(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 ds(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 uc(e){gt.setFloat32(0,e,!1)}function ps(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 Fp(e){gt.setFloat64(0,e,!1)}function cc(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]=bu;ae[25]=vu;ae[26]=_u;ae[27]=wu;ae[28]=Oe;ae[29]=Oe;ae[30]=Oe;ae[31]=Oe;for(let e=32;e<=55;e++)ae[e]=Oe;ae[56]=Tu;ae[57]=Ou;ae[58]=Au;ae[59]=Eu;ae[60]=Oe;ae[61]=Oe;ae[62]=Oe;ae[63]=Oe;for(let e=64;e<=87;e++)ae[e]=Su;ae[88]=xu;ae[89]=Nu;ae[90]=$u;ae[91]=Cu;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]=Pu;ae[120]=Ru;ae[121]=Uu;ae[122]=Bu;ae[123]=ku;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]=Mu;ae[152]=ju;ae[153]=Lu;ae[154]=Fu;ae[155]=Vu;ae[156]=Oe;ae[157]=Oe;ae[158]=Oe;ae[159]=Ku;for(let e=160;e<=183;e++)ae[e]=zu;ae[184]=qu;ae[185]=Gu;ae[186]=Hu;ae[187]=Wu;ae[188]=Oe;ae[189]=Oe;ae[190]=Oe;ae[191]=Ju;for(let e=192;e<=215;e++)ae[e]=Xu;ae[216]=Yu;ae[217]=Qu;ae[218]=Zu;ae[219]=ec;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]=tc;ae[248]=qi("simple values are not supported");ae[249]=nc;ae[250]=ic;ae[251]=oc;ae[252]=Oe;ae[253]=Oe;ae[254]=Oe;ae[255]=rc;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 ys(){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 pI=ys(),yI=new Mi,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(`${cs} 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 zp(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=uu(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(`${cs} unsupported type: ${n}`);return s(e,n,t,r)}function zp(e,t){t.mapSorter&&e.sort(t.mapSorter)}var qp={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},hs=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 Gp(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 Hp(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 Gp(r,e,t);if(r.type===L.map)return Hp(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 fc(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ve} data to decode must be a Uint8Array`);t=Object.assign({},qp,t);let r=t.tokenizer||new hs(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 ms(e,t){let[r,n]=fc(e,t);if(n.length>0)throw new Error(`${ve} too many terminals, data makes no sense`);return r}var Xp=42;function Yp(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return ht.decode(e.subarray(1))}var lc={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};lc.tags[Xp]=Yp;var gs=e=>ms(e,lc);var ur=as(Ji(),1),Kn={SHA2_256:18,LENGTH:32,DAG_PB:112},_s=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 ws(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 Ts(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}},Os={toTyped:zn.CarV1HeaderOrV2Pragma,toRepresentation:qn.CarV1HeaderOrV2Pragma};var MI=ys();var hy=as(Ji(),1);var KI=[new ce(L.map,2),new ce(L.string,"version"),new ce(L.uint,1),new ce(L.string,"roots")],zI=new ce(L.tag,42);async function As(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=gs(n);if(Os.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=ws(await e.exactly(_s,!0));e.seek(s.dataOffset-e.pos);let o=await As(e,1);return Object.assign(o,s)}async function gy(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(Ts(await e.upTo(8)),!0),s=ki(i);return ht.create(r,n,s)}async function wc(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 gy(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function by(e){let{cid:t,blockLength:r}=await wc(e);return{bytes:await e.exactly(r,!0),cid:t}}async function vy(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await wc(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 As(e);if(r.version===2){let n=e.pos-r.dataOffset;e=wy(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await by(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await vy(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 _y(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 _y(r)}function wy(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 Tc(Cr(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Tc(lr(t))}};async function Tc(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 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),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}},Is=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 Ac(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Ic(t);return new e(r,n,i)}},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");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 Ac(t);return new e(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await Ic(t);return new e(r,n,i)}};async function Ac(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return Ec(Cr(e))}async function Ic(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Ec(lr(e))}async function Ec(e){let t=fr(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var Ty=as(Ji(),1);var Sc=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 Oy=Object.create,Ss=Object.defineProperty,Ay=Object.getOwnPropertyDescriptor,xc=Object.getOwnPropertyNames,Iy=Object.getPrototypeOf,Ey=Object.prototype.hasOwnProperty,Le=(e,t)=>function(){return t||(0,e[xc(e)[0]])((t={exports:{}}).exports,t),t.exports},xs=(e,t)=>{for(var r in t)Ss(e,r,{get:t[r],enumerable:!0})},Sy=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xc(t))!Ey.call(e,i)&&i!==r&&Ss(e,i,{get:()=>t[i],enumerable:!(n=Ay(t,i))||n.enumerable});return e},Mt=(e,t,r)=>(r=e!=null?Oy(Iy(e)):{},Sy(t||!e||!e.__esModule?Ss(r,"default",{value:e,enumerable:!0}):r,e));var xy={};xs(xy,{code:()=>sf,decode:()=>fo,encode:()=>Xs,format:()=>Mc,name:()=>Rm,parse:()=>Bm,stringify:()=>Mc});var Ny=["string","number","bigint","symbol"],$y=["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 Cy(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Ny.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Py(e))return"Buffer";let r=Ry(e);return r||"Object"}function Py(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Ry(e){let t=Object.prototype.toString.call(e).slice(8,-1);if($y.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",Uy=new TextDecoder,By=new TextEncoder;function Zi(e){return dn&&globalThis.Buffer.isBuffer(e)}function ks(e){return e instanceof Uint8Array?Zi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var ky=dn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):$c(e,t,r):(e,t,r)=>r-t>64?Uy.decode(e.subarray(t,r)):$c(e,t,r),Lc=dn?e=>e.length>64?globalThis.Buffer.from(e):Nc(e):e=>e.length>64?By.encode(e):Nc(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),Dy=dn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),ks(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},My=dn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function jy(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 Nc(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 $c(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 Fc(n)}var Cc=4096;function Fc(e){let t=e.length;if(t<=Cc)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Cc));return r}var Ly=256,Vc=class{constructor(e=Ly){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=My(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=Dy(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 Dr(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 Fy(e,t,r,n){return new Z(C.uint,Ur(e,t+1,n),2)}function Vy(e,t,r,n){return new Z(C.uint,Br(e,t+1,n),3)}function Ky(e,t,r,n){return new Z(C.uint,kr(e,t+1,n),5)}function zy(e,t,r,n){return new Z(C.uint,Dr(e,t+1,n),9)}function Mr(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`)}}Mr.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};Mr.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function qy(e,t,r,n){return new Z(C.negint,-1-Ur(e,t+1,n),2)}function Gy(e,t,r,n){return new Z(C.negint,-1-Br(e,t+1,n),3)}function Hy(e,t,r,n){return new Z(C.negint,-1-kr(e,t+1,n),5)}var Ms=BigInt(-1),Kc=BigInt(1);function Wy(e,t,r,n){let i=Dr(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,Ms-BigInt(i),9)}function js(e,t){let r=t.value,n=typeof r=="bigint"?r*Ms-Kc:r*-1-1;vt(e,t.type.majorEncoded,n)}js.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Ms-Kc:r*-1-1;return n<qe[0]?1:n<qe[1]?2:n<qe[2]?3:n<qe[3]?5:9};js.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 Jy(e,t,r,n){return Zn(e,t,1,r)}function Xy(e,t,r,n){return Zn(e,t,2,Ur(e,t+1,n))}function Yy(e,t,r,n){return Zn(e,t,3,Br(e,t+1,n))}function Qy(e,t,r,n){return Zn(e,t,5,kr(e,t+1,n))}function Zy(e,t,r,n){let i=Dr(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?Lc(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 eh(eo(t),eo(r))};function eh(e,t){return e.length<t.length?-1:e.length>t.length?1:jy(e,t)}function ei(e,t,r,n,i){let s=r+n;pn(e,t,s);let o=new Z(C.string,ky(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=Ds(e,t+r,t+s)),o}function th(e,t,r,n){return ei(e,t,1,r,n)}function rh(e,t,r,n){return ei(e,t,2,Ur(e,t+1,n),n)}function nh(e,t,r,n){return ei(e,t,3,Br(e,t+1,n),n)}function ih(e,t,r,n){return ei(e,t,5,kr(e,t+1,n),n)}function oh(e,t,r,n){let i=Dr(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 sh=so;function yn(e,t,r,n){return new Z(C.array,n,r)}function ah(e,t,r,n){return yn(e,t,1,r)}function uh(e,t,r,n){return yn(e,t,2,Ur(e,t+1,n))}function ch(e,t,r,n){return yn(e,t,3,Br(e,t+1,n))}function fh(e,t,r,n){return yn(e,t,5,kr(e,t+1,n))}function lh(e,t,r,n){let i=Dr(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 dh(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 Ls(e,t){vt(e,C.array.majorEncoded,t.value)}Ls.compareTokens=Mr.compareTokens;Ls.encodedSize=function(t){return vt.encodedSize(t.value)};function hn(e,t,r,n){return new Z(C.map,n,r)}function ph(e,t,r,n){return hn(e,t,1,r)}function yh(e,t,r,n){return hn(e,t,2,Ur(e,t+1,n))}function hh(e,t,r,n){return hn(e,t,3,Br(e,t+1,n))}function mh(e,t,r,n){return hn(e,t,5,kr(e,t+1,n))}function gh(e,t,r,n){let i=Dr(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 bh(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 Fs(e,t){vt(e,C.map.majorEncoded,t.value)}Fs.compareTokens=Mr.compareTokens;Fs.encodedSize=function(t){return vt.encodedSize(t.value)};function vh(e,t,r,n){return new Z(C.tag,r,1)}function _h(e,t,r,n){return new Z(C.tag,Ur(e,t+1,n),2)}function wh(e,t,r,n){return new Z(C.tag,Br(e,t+1,n),3)}function Th(e,t,r,n){return new Z(C.tag,kr(e,t+1,n),5)}function Oh(e,t,r,n){return new Z(C.tag,Dr(e,t+1,n),9)}function Vs(e,t){vt(e,C.tag.majorEncoded,t.value)}Vs.compareTokens=Mr.compareTokens;Vs.encodedSize=function(t){return vt.encodedSize(t.value)};var Ah=20,Ih=21,Eh=22,Sh=23;function xh(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 Nh(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 Ks(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 $h(e,t,r,n){return Ks(qs(e,t+1),3,n)}function Ch(e,t,r,n){return Ks(Gs(e,t+1),5,n)}function Ph(e,t,r,n){return Ks(Hc(e,t+1),9,n)}function zs(e,t,r){let n=t.value;if(n===!1)e.push([C.float.majorEncoded|Ah]);else if(n===!0)e.push([C.float.majorEncoded|Ih]);else if(n===null)e.push([C.float.majorEncoded|Eh]);else if(n===void 0)e.push([C.float.majorEncoded|Sh]);else{let i,s=!1;(!r||r.float64!==!0)&&(qc(n),i=qs(Pt,1),n===i||Number.isNaN(n)?(Pt[0]=249,e.push(Pt.slice(0,3)),s=!0):(Gc(n),i=Gs(Pt,1),n===i&&(Pt[0]=250,e.push(Pt.slice(0,5)),s=!0))),s||(Rh(n),i=Hc(Pt,1),Pt[0]=251,e.push(Pt.slice(0,9)))}}zs.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){qc(n);let i=qs(Pt,1);if(n===i||Number.isNaN(n))return 3;if(Gc(n),i=Gs(Pt,1),n===i)return 5}return 9};var zc=new ArrayBuffer(9),bt=new DataView(zc,1),Pt=new Uint8Array(zc,0);function qc(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 qs(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 Gc(e){bt.setFloat32(0,e,!1)}function Gs(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 Rh(e){bt.setFloat64(0,e,!1)}function Hc(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)}zs.compareTokens=Mr.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]=Fy;ue[25]=Vy;ue[26]=Ky;ue[27]=zy;ue[28]=Ae;ue[29]=Ae;ue[30]=Ae;ue[31]=Ae;for(let e=32;e<=55;e++)ue[e]=Ae;ue[56]=qy;ue[57]=Gy;ue[58]=Hy;ue[59]=Wy;ue[60]=Ae;ue[61]=Ae;ue[62]=Ae;ue[63]=Ae;for(let e=64;e<=87;e++)ue[e]=Jy;ue[88]=Xy;ue[89]=Yy;ue[90]=Qy;ue[91]=Zy;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]=th;ue[120]=rh;ue[121]=nh;ue[122]=ih;ue[123]=oh;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]=ah;ue[152]=uh;ue[153]=ch;ue[154]=fh;ue[155]=lh;ue[156]=Ae;ue[157]=Ae;ue[158]=Ae;ue[159]=dh;for(let e=160;e<=183;e++)ue[e]=ph;ue[184]=yh;ue[185]=hh;ue[186]=mh;ue[187]=gh;ue[188]=Ae;ue[189]=Ae;ue[190]=Ae;ue[191]=bh;for(let e=192;e<=215;e++)ue[e]=vh;ue[216]=_h;ue[217]=wh;ue[218]=Th;ue[219]=Oh;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]=xh;ue[248]=ao("simple values are not supported");ue[249]=$h;ue[250]=Ch;ue[251]=Ph;ue[252]=Ae;ue[253]=Ae;ue[254]=Ae;ue[255]=Nh;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 Hs(){let e=[];return e[C.uint.major]=Mr,e[C.negint.major]=js,e[C.bytes.major]=so,e[C.string.major]=sh,e[C.array.major]=Ls,e[C.map.major]=Fs,e[C.tag.major]=Vs,e[C.float.major]=zs,e}var NE=Hs(),Ns=new Vc,Pc=class Wc{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 Wc(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=Pc.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=Pc.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 Uh(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=Cy(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 Uh(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Jc(e,t,r,n){if(Array.isArray(t))for(let i of t)Jc(e,i,r,n);else r[t.type.major](e,t,n)}function Bh(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 Vc(o);if(s(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return ks(a.chunks[0])}}return Ns.reset(),Jc(Ns,n,t,r),Ns.toBytes(!0)}var kh={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Dh=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 Mh(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 jh(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 Mh(r,e,t);if(r.type===C.map)return jh(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 Lh(e,t){if(!(e instanceof Uint8Array))throw new Error(`${he} data to decode must be a Uint8Array`);t=Object.assign({},kh,t);let r=t.tokenizer||new Dh(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 Ws(e,t){let[r,n]=Lh(e,t);if(n.length>0)throw new Error(`${he} too many terminals, data makes no sense`);return r}var Fh=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=Lc(JSON.stringify(t.value));e.push(r.length>32?ks(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 Vh(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 Kh={addBreakTokens:!0,mapSorter:Vh};function zh(e,t){return t=Object.assign({},Kh,t),Bh(e,new Fh,t)}var Xc=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,Fc(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 qh(e,t){return t=Object.assign({tokenizer:new Xc(e,t)},t),Ws(e,t)}var $E=new Uint8Array(0),Gh=(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},Js=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 Hh(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 M=f.repeat(te);ye<Y;++ye)M+=e.charAt(ie[ye]);return M}function D(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)),M=W;K!==z;)ye[M++]=Y[K++];return ye}}}function R(j){var te=D(j);if(te)return te;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:D,decode:R}}var Wh=Hh,Jh=Wh,Xh=Jh,Yh=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")}},Qh=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 Yc(this,e)}},Zh=class{constructor(e){this.decoders=e}or(e){return Yc(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`)}},Yc=(e,t)=>new Zh({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),em=class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Yh(e,t,r),this.decoder=new Qh(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Qc=({name:e,prefix:t,encode:r,decode:n})=>new em(e,t,r,n),Zc=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=Xh(r,t);return Qc({prefix:e,name:t,encode:n,decode:s=>Js(i(s))})},tm=(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},rm=(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})=>Qc({prefix:t,name:e,encode(i){return rm(i,n,r)},decode(i){return tm(i,n,r,e)}}),Qi=ct({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),CE=ct({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),PE=ct({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),RE=ct({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),UE=ct({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),BE=ct({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),kE=ct({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),DE=ct({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ME=ct({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),hr=Zc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),jE=Zc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ef={};xs(ef,{Digest:()=>co,create:()=>io,decode:()=>ti,equals:()=>rf});var nm=tf,Rc=128,im=127,om=~im,sm=Math.pow(2,31);function tf(e,t,r){t=t||[],r=r||0;for(var n=r;e>=sm;)t[r++]=e&255|Rc,e/=128;for(;e&om;)t[r++]=e&255|Rc,e>>>=7;return t[r]=e|0,tf.bytes=r-n+1,t}var am=Ps,um=128,Uc=127;function Ps(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Ps.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&Uc)<<i:(o&Uc)*Math.pow(2,i),i+=7}while(o>=um);return Ps.bytes=s-n,r}var cm=Math.pow(2,7),fm=Math.pow(2,14),lm=Math.pow(2,21),dm=Math.pow(2,28),pm=Math.pow(2,35),ym=Math.pow(2,42),hm=Math.pow(2,49),mm=Math.pow(2,56),gm=Math.pow(2,63),bm=function(e){return e<cm?1:e<fm?2:e<lm?3:e<dm?4:e<pm?5:e<ym?6:e<hm?7:e<mm?8:e<gm?9:10},vm={encode:nm,decode:am,encodingLength:bm},_m=vm,to=_m,Rs=(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=Js(e),[r,n]=Rs(t),[i,s]=Rs(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new co(r,i,o,t)},rf=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Gh(e.bytes,r.bytes)}},co=class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},Bc=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return Tm(r,Us(e),t||hr.encoder);default:return Om(r,Us(e),t||Qi.encoder)}},kc=new WeakMap,Us=e=>{let t=kc.get(e);if(t==null){let r=new Map;return kc.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!==Am)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&&rf(t.multihash,n.multihash)}toString(t){return Bc(this,t)}toJSON(){return{"/":Bc(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[Im]===!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=Js(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,D]=Rs(t.subarray(r));return r+=D,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]=wm(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 Us(s).set(n,t),s}},wm=(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)]}}},Tm=(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},Om=(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,Am=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},Im=Symbol.for("@ipld/js-cid/CID"),nf=({name:e,code:t,encode:r})=>new Em(e,t,r),Em=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")}},of=ct({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),LE=ct({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),FE=ct({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),VE=ct({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function Sm(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=of.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 xm(e){return oo(new Uint8Array(e))}function Nm(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function $m(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 Cm={typeEncoders:{Object:Sm,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:xm,undefined:Nm,number:$m}},Pm=class extends Xc{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=of.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}},Bs={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Bs.tags[42]=Yt.parse;var Rm="dag-json",sf=297,Xs=e=>zh(e,Cm),fo=e=>{let t=Object.assign(Bs,{tokenizer:new Pm(e,Bs)});return qh(e,t)},Mc=e=>Um.decode(Xs(e)),Um=new TextDecoder,Bm=e=>fo(km.encode(e)),km=new TextEncoder;function Dm(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 jc(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 Mm(e,t){Dm(e);let r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var jm=e=>e instanceof Uint8Array,$s=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),jt=(e,t)=>e<<32-t|e>>>t,Lm=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Lm)throw new Error("Non little-endian hardware is not supported");function Fm(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function af(e){if(typeof e=="string"&&(e=Fm(e)),!jm(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Vm=class{clone(){return this._cloneInto()}},KE={}.toString;function Km(e){let t=n=>e().update(af(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function zm(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 qm=class extends Vm{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=$s(this.buffer)}update(e){jc(this);let{view:t,buffer:r,blockLen:n}=this;e=af(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=$s(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){jc(this),Mm(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;zm(r,n-8,BigInt(this.length*8),i),this.process(r,0);let o=$s(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}},Gm=(e,t,r)=>e&t^~e&r,Hm=(e,t,r)=>e&t^e&r^t&r,Wm=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),Jm=class extends qm{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],D=yr[y-2],R=jt(g,7)^jt(g,18)^g>>>3,j=jt(D,17)^jt(D,19)^D>>>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),D=c+g+Gm(o,a,f)+Wm[y]+yr[y]|0,j=(jt(r,2)^jt(r,13)^jt(r,22))+Hm(r,n,i)|0;c=f,f=a,a=o,o=s+D|0,s=i,i=n,n=r,r=D+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)}},Xm=Km(()=>new Jm),Ym=Object.create,Ys=Object.defineProperty,Qm=Object.getOwnPropertyDescriptor,uf=Object.getOwnPropertyNames,Zm=Object.getPrototypeOf,eg=Object.prototype.hasOwnProperty,tg=(e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cf=(e,t)=>function(){return t||(0,e[uf(e)[0]])((t={exports:{}}).exports,t),t.exports},rg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uf(t))!eg.call(e,i)&&i!==r&&Ys(e,i,{get:()=>t[i],enumerable:!(n=Qm(t,i))||n.enumerable});return e},ff=(e,t,r)=>(r=e!=null?Ym(Zm(e)):{},rg(t||!e||!e.__esModule?Ys(r,"default",{value:e,enumerable:!0}):r,e)),gr=(e,t,r)=>(tg(e,typeof t!="symbol"?t+"":t,r),r),ng=cf({"../../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}}),ig=cf({"../../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]},D={key:y,value:f[y]};return a(g,D)}}}(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,D=Object.keys(f).sort(s&&s(f));for(y="",c=0;c<D.length;c++){var R=D[c],j=a(f[R]);j&&(y&&(y+=","),y+=JSON.stringify(R)+":"+j)}return o.splice(g,1),"{"+y+"}"}}(r)}}}),Yn=ff(ng(),1),og=ff(ig(),1),lf=!1,df=!1;Yn.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(lf=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(df=process?.env?.LOGGER_PERF_PREFIX==="true"));var sg=Object.freeze({prefix:void 0,time:lf,delta:df,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0}),Cs=[],pf=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(",")}]`}},yf=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Wn=!1,et=class{static setup(e=et.INFO,t={}){t=Object.assign({},sg,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(...D){let R=D[D.length-1];return R===n?R():(i(...D.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,og.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 yf("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 pf(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(Cs&&Cs.length){for(let t of Cs)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof pf))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 yf?(Wn||(Wn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1})):Yn.isNode;var hf=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ag=nf({name:"sha2-256",code:18,encode:hf("SHA-256")}),zE=nf({name:"sha2-512",code:19,encode:hf("SHA-512")}),{WARN:ug,LOG:qE,DEBUG:cg,VERBOSE:mf,ERROR:GE}=Se.setup(Se.INFO);function gf(e,t=["cid"]){let r={};for(let[n,i]of Object.entries(e))i===void 0&&(ug(`log.${n} is undefined, which is not allowed - encoding as null`,e),i=null),t.includes(n)?mf("excluding app log",{key:n,val:i}):r[n]=i&&n==="pv"?Yt.parse(i):i;return r}function Qs(e){return Zs(bf(e).bytes)}function bf(e){return vf(gf(e))}function Zs(e){let t=Xm(e),r=ef.create(ag.code,t),n=Yt.create(1,sf,r);return mf("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function vf(e){cg("[encodeBlock]",e);let t=Xs(e);return{bytes:t,cid:Zs(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 De(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=De;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 ns(m){return Nr(m)&&m.anyOf.every($e=>Sr($e)||T($e))}l.TUnionLiteral=ns;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 Dn(m){return we(m,"Void")&&m.type==="void"&&S(m.$id)}l.TVoid=Dn;function is(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}l.TReadonly=is;function os(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}l.TOptional=os;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)||De(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)||Dn(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)?ss(d,p):o.TUnknown(p)?au(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)?Dn(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 De(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)&&De(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)&&De(p)||o.TInteger(d)&&De(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 ns(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 wp of Object.getOwnPropertyNames(d.properties))if(kn(xt,d.properties[wp])===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 Dn(d,p){return o.TLiteral(d)&&i.IsString(d.const)||o.TString(d)?c.True:c.False}function is(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 os(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 yp(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 hp(d,p){return P(p)?N(d,p):o.TObject(p)?Fe(d,p):o.TRecord(p)?Ye(d,p):o.TVoid(p)?bp(d,p):o.TUndefined(p)?c.True:c.False}function ss(d,p){return p.anyOf.some(Te=>Ne(d,Te)===c.True)?c.True:c.False}function mp(d,p){return d.anyOf.every(Te=>Ne(Te,p)===c.True)?c.True:c.False}function au(d,p){return c.True}function gp(d,p){return o.TNever(p)?we(d,p):o.TIntersect(p)?_e(d,p):o.TUnion(p)?ss(d,p):o.TAny(p)?E(d,p):o.TString(p)?Dn(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 bp(d,p){return o.TUndefined(d)||o.TUndefined(d)?c.True:c.False}function vp(d,p){return o.TIntersect(p)?_e(d,p):o.TUnion(p)?ss(d,p):o.TUnknown(p)?au(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)?is(d,p):o.TSymbol(d)?os(d,p):o.TTuple(d)?yt(d,p):o.TPromise(d)?ns(d,p):o.TUint8Array(d)?yp(d,p):o.TUndefined(d)?hp(d,p):o.TUnion(d)?mp(d,p):o.TUnknown(d)?gp(d,p):o.TVoid(d)?vp(d,p):I(`Unknown left type operand '${d[e.Kind]}'`)}function _p(d,p){return Ne(d,p)}l.Extends=_p})(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 D;(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})(D||(e.IndexedAccessor=D={}));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(!M.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(!M.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(!M.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 M;(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})(M||(e.TemplateLiteralFinite=M={}));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 D.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 M.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=Mt(Qt(),1),{String:fg,Optional:lg,Boolean:dg,Object:pg,Number:yg}=mn.Type,hg=fg.bind(mn.Type),mg=yg.bind(mn.Type),yS=pg.bind(mn.Type),hS=lg.bind(mn.Type),gg=dg.bind(mn.Type),mS=hg(),gS=mg(),bS=gg();function _f(e){return Array.isArray(e)?e:[e]}var bg=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 D(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=D(B,"maximumDepth"),K=D(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 M(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=M(String(E),O[E],q,ne,G,J);l+=S!==void 0?S:"null",l+=w}let h=M(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=M(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 M("",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 D(F){return F===null}e.IsNull=D;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)||D(F)||j(F)||B(F)||Y(F)||g(F)}e.IsValueType=ie}}),yl=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=Mo(),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 D(R,j){if(n.FormatRegistry.Has(R))throw new s(R);return n.FormatRegistry.Set(R,j),R}y.Format=D})(o||(e.TypeSystem=o={}));var a;(function(y){let g=c;function D(){g=c}y.Reset=D;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 D(W){let B=(0,t.IsObject)(W);return y.AllowArrayObject?B:B&&!(0,t.IsArray)(W)}y.IsObjectLike=D;function R(W){return D(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}}),Na=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 D(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 D(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 M(U){return i=BigInt("14695981039346656037"),K(U),i}e.Hash=M}}),Mo=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=yl(),n=Do(),i=Na(),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*D(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*M(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*D(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*M(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=_}}),vg=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(Mo(),e)}}),hl=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=Mo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(yl(),e)}}),_g=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=hl(),n=Do(),i=Na(),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 D(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 M(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 D(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 M(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}}),wg=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=_g(),i=Qt(),s=class extends i.TypeBoxError{constructor(D,R,j){super("Unable to decode due to invalid value"),this.schema=D,this.value=R,this.error=j}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(D,R,j){super("Unable to encode due to invalid value"),this.schema=D,this.value=R,this.error=j}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(D,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=D,this.value=R}};e.TransformDecodeError=a;var f=class extends i.TypeBoxError{constructor(D,R,j){super(`${j instanceof Error?j.message:"Unknown error"}`),this.schema=D,this.value=R}};e.TransformEncodeError=f;var c;(function(D){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 M(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 M(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)}D.Has=Q})(c||(e.HasTransform=c={}));var y;(function(D){function R(M,U){try{return i.TypeGuard.TTransform(M)?M[i.Transform].Decode(U):U}catch(k){throw new a(M,U,k)}}function j(M,U,k){return(0,t.IsArray)(k)?R(M,k.map(ee=>K(M.items,U,ee))):R(M,k)}function te(M,U,k){if(!(0,t.IsPlainObject)(k)||(0,t.IsValueType)(k))return R(M,k);let ee=i.KeyResolver.ResolveKeys(M,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(i.IndexedAccessor.Resolve(M,[J]),U,G[J])}:G,k);if(!i.TypeGuard.TTransform(M.unevaluatedProperties))return R(M,Q);let O=Object.getOwnPropertyNames(Q),q=M.unevaluatedProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:R(q,G[J])},Q);return R(M,ne)}function W(M,U,k){return R(M,K(M.not,U,k))}function B(M,U,k){if(!(0,t.IsPlainObject)(k))return R(M,k);let ee=i.KeyResolver.ResolveKeys(M,{includePatterns:!1}),Q=ee.reduce((G,J)=>J in G?{...G,[J]:K(M.properties[J],U,G[J])}:G,k);if(!i.TypeGuard.TSchema(M.additionalProperties))return R(M,Q);let O=Object.getOwnPropertyNames(Q),q=M.additionalProperties,ne=O.reduce((G,J)=>ee.includes(J)?G:{...G,[J]:R(q,G[J])},Q);return R(M,ne)}function z(M,U,k){if(!(0,t.IsPlainObject)(k))return R(M,k);let ee=Object.getOwnPropertyNames(M.patternProperties)[0],Q=new RegExp(ee),O=Object.getOwnPropertyNames(k).reduce((J,de)=>Q.test(de)?{...J,[de]:K(M.patternProperties[ee],U,J[de])}:J,k);if(!i.TypeGuard.TSchema(M.additionalProperties))return R(M,O);let q=Object.getOwnPropertyNames(O),ne=M.additionalProperties,G=q.reduce((J,de)=>Q.test(de)?J:{...J,[de]:R(ne,J[de])},O);return R(M,G)}function Y(M,U,k){let ee=(0,r.Deref)(M,U);return R(M,K(ee,U,k))}function ie(M,U,k){let ee=(0,r.Deref)(M,U);return R(M,K(ee,U,k))}function F(M,U,k){return(0,t.IsArray)(k)&&(0,t.IsArray)(M.items)?R(M,M.items.map((ee,Q)=>K(ee,U,k[Q]))):R(M,k)}function se(M,U,k){let ee=R(M,k);for(let Q of M.anyOf)if((0,n.Check)(Q,U,ee))return K(Q,U,ee);return ee}function K(M,U,k){let ee=typeof M.$id=="string"?[...U,M]:U,Q=M;switch(M[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(M,U,k){return K(M,U,k)}D.Decode=ye})(y||(e.DecodeTransform=y={}));var g;(function(D){function R(M,U){try{return i.TypeGuard.TTransform(M)?M[i.Transform].Encode(U):U}catch(k){throw new f(M,U,k)}}function j(M,U,k){let ee=R(M,k);return(0,t.IsArray)(ee)?ee.map(Q=>K(M.items,U,Q)):ee}function te(M,U,k){let ee=R(M,k);if(!(0,t.IsPlainObject)(k)||(0,t.IsValueType)(k))return ee;let Q=i.KeyResolver.ResolveKeys(M,{includePatterns:!1}),O=Q.reduce((G,J)=>J in ee?{...G,[J]:K(i.IndexedAccessor.Resolve(M,[J]),U,G[J])}:G,ee);if(!i.TypeGuard.TTransform(M.unevaluatedProperties))return R(M,O);let q=Object.getOwnPropertyNames(O),ne=M.unevaluatedProperties;return q.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:R(ne,G[J])},O)}function W(M,U,k){return R(M.not,R(M,k))}function B(M,U,k){let ee=R(M,k);if(!(0,t.IsPlainObject)(k))return ee;let Q=i.KeyResolver.ResolveKeys(M,{includePatterns:!1}),O=Q.reduce((G,J)=>J in G?{...G,[J]:K(M.properties[J],U,G[J])}:G,ee);if(!i.TypeGuard.TSchema(M.additionalProperties))return O;let q=Object.getOwnPropertyNames(O),ne=M.additionalProperties;return q.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:R(ne,G[J])},O)}function z(M,U,k){let ee=R(M,k);if(!(0,t.IsPlainObject)(k))return ee;let Q=Object.getOwnPropertyNames(M.patternProperties)[0],O=new RegExp(Q),q=Object.getOwnPropertyNames(k).reduce((J,de)=>O.test(de)?{...J,[de]:K(M.patternProperties[Q],U,J[de])}:J,ee);if(!i.TypeGuard.TSchema(M.additionalProperties))return R(M,q);let ne=Object.getOwnPropertyNames(q),G=M.additionalProperties;return ne.reduce((J,de)=>O.test(de)?J:{...J,[de]:R(G,J[de])},q)}function Y(M,U,k){let ee=(0,r.Deref)(M,U),Q=K(ee,U,k);return R(M,Q)}function ie(M,U,k){let ee=(0,r.Deref)(M,U),Q=K(ee,U,k);return R(M,Q)}function F(M,U,k){let ee=R(M,k);return(0,t.IsArray)(M.items)?M.items.map((Q,O)=>K(Q,U,ee[O])):[]}function se(M,U,k){for(let ee of M.anyOf){if(!(0,n.Check)(ee,U,k))continue;let Q=K(ee,U,k);return R(M,Q)}for(let ee of M.anyOf){let Q=K(ee,U,k);if((0,n.Check)(M,U,Q))return R(M,Q)}return R(M,k)}function K(M,U,k){let ee=typeof M.$id=="string"?[...U,M]:U,Q=M;switch(M[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(M,U,k){return K(M,U,k)}D.Encode=ye})(g||(e.EncodeTransform=g={}))}}),Tg=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=wg(),r=An(),n=Mo(),i=hl(),s=Do(),o=Na(),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 D;(function(B){function z(Y){return Y.replace(/'/g,"\\'")}B.Escape=z})(D||(D={}));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,M){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${ye}' in ${K} ? ${M} : true)`:`(${y.Encode(K,ye)} !== undefined ? ${M} : 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(),De=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}) => ${De} ? 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*M(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} === '${D.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 De=re(Ee,le,pe);yield te.IsExactOptionalProperty(x,oe,De)}}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"),De=a.TypeGuard.TSchema(T.additionalProperties)?re(T.additionalProperties,le,x):T.additionalProperties===!1?"false":"true",Xe=`(${pe}.test(key) ? ${Ee} : ${De})`;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 De=Pe(Ee,T,le,"value",!1);return X.functions.set(Ee,De),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*M(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," ")],De=je("value","any"),Xe=Er("boolean"),We=[...V(le,x,ge,oe)].map(Ze=>`${Ee(4)}${Ze}`).join(` &&${pe}`);return`function ${T}(${De})${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()],De=[...X.variables.values()],Xe=(0,r.IsString)(T.$id)?`return function check(${oe})${pe} {
23
+ return ${me(T.$id)}(value)
24
+ }`:`return ${ge}`;return[...De,...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 De(We){return(0,o.Hash)(We)}let Xe=ge(pe,Ee,De);return new f(T,le,Xe,x)}B.Compile=Sr})(W||(e.TypeCompiler=W={}))}}),Og=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=vg();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(Tg(),e)}}),Ag={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"},Ig=Ag;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:Ig[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Eg={};function $a(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Eg}var ml=Object.assign,To=Object.getOwnPropertyDescriptor,Vt=Object.defineProperty,gi=Object.prototype,Oo=[];Object.freeze(Oo);var Ca={};Object.freeze(Ca);var Sg=typeof Proxy<"u",xg=Object.toString();function gl(){Sg||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 Pa(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var bn=function(){};function Me(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 jo(e){return e!==null&&typeof e=="object"}function kt(e){if(!jo(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()===xg}function bl(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Lo(e,t,r){Vt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function vl(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 jo(n)&&n[r]===!0}}function In(e){return e instanceof Map}function bi(e){return e instanceof Set}var _l=typeof Object.getOwnPropertySymbols<"u";function Ng(e){var t=Object.keys(e);if(!_l)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return gi.propertyIsEnumerable.call(e,n)})):t}var Fo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:_l?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function aa(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function wl(e){return e===null?null:typeof e=="object"?""+e:e}function It(e,t){return gi.hasOwnProperty.call(e,t)}var $g=Object.getOwnPropertyDescriptors||function(t){var r={};return Fo(t).forEach(function(n){r[n]=To(t,n)}),r};function wf(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,Rg(n.key),n)}}function Ra(e,t,r){return t&&wf(e.prototype,t),r&&wf(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 Tl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ua(e,t)}function ua(e,t){return ua=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ua(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 Cg(e,t){if(e){if(typeof e=="string")return Tf(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 Tf(e,t)}}function Tf(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=Cg(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 Pg(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 Rg(e){var t=Pg(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)||Lo(e,rt,rr({},e[rt])),Ao(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.")}Ug(e,r,t),Ao(r)||(e[rt][t]=r)}function Ug(e,t,r){if(!Ao(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 Bg(e){return It(e,rt)||Lo(e,rt,rr({},e[rt])),e[rt]}function vi(e){return typeof e=="object"&&typeof e.kind=="string"}function Vo(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 Ll(this)},t.reportChanged=function(){Tt(),Fl(this),Ot()},t.toString=function(){return this.name_},e}(),Ua=Ar("Atom",_i);function Ol(e,t,r){t===void 0&&(t=bn),r===void 0&&(r=bn);var n=new _i(e);return t!==bn&&Xl(n,t),r!==bn&&Oi(n,r),n}function kg(e,t){return e===t}function Dg(e,t){return Fa(e,t)}function Mg(e,t){return Fa(e,t,1)}function jg(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var nt={identity:kg,structural:Dg,default:jg,shallow:Mg};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)?bl(e)?wn(e):ui(r,e):e}function Lg(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 Ko(e){return e}function Fg(e,t){return Tn(e)&&fe("observable.struct should not be used with observable values"),Fa(e,t)?t:e}var Vg="override";function Ao(e){return e.annotationType_===Vg}function wi(e,t){return{annotationType_:e,options_:t,make_:Kg,extend_:zg,decorate_20223_:qg}}function Kg(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=Al(e,this,t,r,!1);return Vt(n,t,s),2}function zg(e,t,r,n){var i=Al(e,this,t,r);return e.defineProperty_(t,i,n)}function qg(e,t){Vo(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,s=this,o=function(c){var y,g,D,R;return zr((y=(g=s.options_)==null?void 0:g.name)!=null?y:n.toString(),c,(D=(R=s.options_)==null?void 0:R.autoAction)!=null?D:!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 Gg(e,t,r,n){var i=t.annotationType_,s=n.value;Me(s)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
31
+ '`+i+"' can only be used on properties with a function value."))}function Al(e,t,r,n,i){var s,o,a,f,c,y,g;i===void 0&&(i=H.safeDescriptors),Gg(e,t,r,n);var D=n.value;if((s=t.options_)!=null&&s.bound){var R;D=D.bind((R=e.proxy_)!=null?R:e.target_)}return{value:zr((o=(a=t.options_)==null?void 0:a.name)!=null?o:r.toString(),D,(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 Il(e,t){return{annotationType_:e,options_:t,make_:Hg,extend_:Wg,decorate_20223_:Jg}}function Hg(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=El(e,this,t,r,!1,!1);return Vt(n,t,s),2}function Wg(e,t,r,n){var i,s=El(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,s,n)}function Jg(e,t){var r;Vo(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 Xg(e,t,r,n){var i=t.annotationType_,s=n.value;Me(s)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
32
+ '`+i+"' can only be used on properties with a generator function value."))}function El(e,t,r,n,i,s){s===void 0&&(s=H.safeDescriptors),Xg(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 Ba(e,t){return{annotationType_:e,options_:t,make_:Yg,extend_:Qg,decorate_20223_:Zg}}function Yg(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function Qg(e,t,r,n){return eb(e,this,t,r),e.defineComputedProperty_(t,rr({},this.options_,{get:r.get,set:r.set}),n)}function Zg(e,t){Vo(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 eb(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 zo(e,t){return{annotationType_:e,options_:t,make_:tb,extend_:rb,decorate_20223_:nb}}function tb(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function rb(e,t,r,n){var i,s;return ib(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:Kr,n)}function nb(e,t){if(t.kind==="field")throw fe("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");Vo(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],D=new wr(f,(c=(y=r.options_)==null?void 0:y.enhancer)!=null?c:Kr,g.name_+"."+i.toString(),!1);g.values_.set(i,D),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 ib(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 ob="true",sb=Sl();function Sl(e){return{annotationType_:ob,options_:e,make_:ab,extend_:ub,decorate_20223_:cb}}function ab(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(bl(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 D;r.value=r.value.bind((D=e.proxy_)!=null?D:e.target_)}return g.make_(e,t,r,n)}function ub(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 cb(e,t){fe("'"+this.annotationType_+"' cannot be used as a decorator")}var fb="observable",lb="observable.ref",db="observable.shallow",pb="observable.struct",xl={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(xl);function lo(e){return e||xl}var ca=zo(fb),yb=zo(lb,{enhancer:Ko}),hb=zo(db,{enhancer:Lg}),mb=zo(pb,{enhancer:Fg}),Nl=Kt(ca);function po(e){return e.deep===!0?Kr:e.deep===!1?Ko:bb(e.defaultDecorator)}function gb(e){var t;return e?(t=e.defaultDecorator)!=null?t:Sl(e):void 0}function bb(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Kr}function $l(e,t,r){if(vi(t))return ca.decorate_20223_(e,t);if(Vr(t)){En(e,t,ca);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)}ml($l,Nl);var vb={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?Av:yv)(t,po(n),n.name)},map:function(t,r){var n=lo(r);return new od(t,po(n),n.name)},set:function(t,r){var n=lo(r);return new ud(t,po(n),n.name)},object:function(t,r,n){return Qr(function(){return rv(H.useProxies===!1||n?.proxy===!1?$n({},n):lv({},n),t,r)})},ref:Kt(yb),shallow:Kt(hb),deep:Nl,struct:Kt(mb)},ke=ml($l,vb),Cl="computed",_b="computed.struct",fa=Ba(Cl),wb=Ba(_b,{equals:nt.structural}),Ge=function(t,r){if(vi(r))return fa.decorate_20223_(t,r);if(Vr(r))return En(t,r,fa);if(kt(t))return Kt(Ba(Cl,t));Me(t)||fe("First argument to `computed` should be an expression."),Me(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,fa);Ge.struct=Kt(wb);var Of,Af,Io=0,Tb=1,Ob=(Of=(Af=To(function(){},"name"))==null?void 0:Af.configurable)!=null?Of:!1,If={value:"action",configurable:!0,writable:!1,enumerable:!1};function zr(e,t,r,n){r===void 0&&(r=!1),Me(t)||fe("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&fe("actions should have valid names, got: '"+e+"'");function i(){return Pl(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Ob&&(If.value=e,Vt(i,"name",If)),i}function Pl(e,t,r,n,i){var s=Ab(e,t,n,i);try{return r.apply(n,i)}catch(o){throw s.error_=o,o}finally{Ib(s)}}function Ab(e,t,r,n){var i=He()&&!!e,s=0;if(i){s=Date.now();var o=n?Array.from(n):Oo;lt({type:Da,name:e,object:r,arguments:o})}var a=H.trackingDerivation,f=!t||!a;Tt();var c=H.allowStateChanges;f&&(Xr(),c=qo(!0));var y=ka(!0),g={runAsAction_:f,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:y,notifySpy_:i,startTime_:s,actionId_:Tb++,parentActionId_:Io};return Io=g.actionId_,g}function Ib(e){Io!==e.actionId_&&fe(30),Io=e.parentActionId_,e.error_!==void 0&&(H.suppressReactionErrors=!0),Go(e.prevAllowStateChanges_),oi(e.prevAllowStateReads_),Ot(),e.runAsAction_&&tr(e.prevDerivation_),e.notifySpy_&&dt({time:Date.now()-e.startTime_}),H.suppressReactionErrors=!1}function Eb(e,t){var r=qo(e);try{return t()}finally{Go(r)}}function qo(e){var t=H.allowStateChanges;return H.allowStateChanges=e,t}function Go(e){H.allowStateChanges=e}var Rl,Sb="create";Rl=Symbol.toPrimitive;var wr=function(e){Tl(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:Sb,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 wl(this.get())},r[Rl]=function(){return this.valueOf()},t}(_i),xb=Ar("ObservableValue",wr),Ul;Ul=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 Eo(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(){jb(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_)la(this)&&(this.warnAboutUntrackedRead_(),Tt(),this.value_=this.computeValue_(!1),Ot());else if(Ll(this),la(this)){var n=H.trackingContext;this.keepAlive_&&!n&&(H.trackingContext=this),this.trackAndCompute()&&Mb(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=qo(!1),s;if(n)s=Bl(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 Eo(o)}return Go(i),this.isComputing_=!1,s},t.suspend_=function(){this.keepAlive_||(da(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 wl(this.get())},t[Ul]=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 Eo=function(t){this.cause=void 0,this.cause=t};function bo(e){return e instanceof Eo}function la(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=ka(!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),oi(t),!0}if(e.dependenciesState_===Ie.STALE_)return tr(r),oi(t),!0}}return kl(e),tr(r),oi(t),!1}}}function Nb(){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 $b(e){!H.allowStateReads&&H.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Bl(e,t,r){var n=ka(!0);kl(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 Eo(o)}return H.inBatch--,H.trackingDerivation=i,Pb(e),Cb(e),oi(n),s}function Cb(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 Pb(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&&Ml(f,e),f.diffValue_=0}for(;i--;){var c=r[i];c.diffValue_===1&&(c.diffValue_=0,Db(c,e))}n!==Ie.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function da(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Ml(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 ka(e){var t=H.allowStateReads;return H.allowStateReads=e,t}function oi(e){H.allowStateReads=e}function kl(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=$a();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 Rb(){if((H.pendingReactions.length||H.inBatch||H.isRunningReactions)&&fe(36),Dl=!0,_o){var e=$a();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),H=new vo}}function Ub(){return H}function Bb(e){return e.observers_&&e.observers_.size>0}function kb(e){return e.observers_}function Db(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Ml(e,t){e.observers_.delete(t),e.observers_.size===0&&jl(e)}function jl(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,H.pendingUnobservations.push(e))}function Tt(){H.inBatch++}function Ot(){if(--H.inBatch===0){zl();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 Ll(e){$b(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&&jl(e),!1)}function Fl(e){e.lowestObserverState_!==Ie.STALE_&&(e.lowestObserverState_=Ie.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ie.UP_TO_DATE_&&(t.isTracing_!==Et.NONE&&Vl(t,e),t.onBecomeStale_()),t.dependenciesState_=Ie.STALE_}))}function Mb(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&&Vl(t,e)):t.dependenciesState_===Ie.UP_TO_DATE_&&(e.lowestObserverState_=Ie.UP_TO_DATE_)}))}function jb(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 Vl(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===Et.BREAK){var r=[];Kl(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 Kl(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 Kl(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),zl())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){Tt(),this.isScheduled_=!1;var n=H.trackingContext;if(H.trackingContext=this,la(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=Bl(this,n,void 0);H.trackingContext=o,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&da(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(),da(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),td(this,n)},e}(),Ef=100,pa=function(t){return t()};function zl(){H.inBatch>0||H.isRunningReactions||pa(Lb)}function Lb(){H.isRunningReactions=!0;for(var e=H.pendingReactions,t=0;e.length>0;){++t===Ef&&(console.error("Reaction doesn't converge to a stable state after "+Ef+" 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 So=Ar("Reaction",ai);function Fb(e){var t=pa;pa=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 Vb={type:"report-end",spyReportEnd:!0};function dt(e){Gr(e?rr({},e,{type:"report-end",spyReportEnd:!0}):Vb)}function ql(e){return H.spyListeners.push(e),Pa(function(){H.spyListeners=H.spyListeners.filter(function(t){return t!==e})})}var Da="action",Kb="action.bound",Gl="autoAction",zb="autoAction.bound",Hl="<unnamed action>",ya=wi(Da),qb=wi(Kb,{bound:!0}),ha=wi(Gl,{autoAction:!0}),Gb=wi(zb,{autoAction:!0,bound:!0});function Wl(e){var t=function(n,i){if(Me(n))return zr(n.name||Hl,n,e);if(Me(i))return zr(n,i,e);if(vi(i))return(e?ha:ya).decorate_20223_(n,i);if(Vr(i))return En(n,i,e?ha:ya);if(Vr(n))return Kt(wi(e?Gl:Da,{name:n,autoAction:e}));fe("Invalid arguments for `action`")};return t}var At=Wl(!1);Object.assign(At,ya);var ui=Wl(!0);Object.assign(ui,ha);At.bound=Kt(qb);ui.bound=Kt(Gb);function Hb(e){return Pl(e.name||Hl,!1,e,this,void 0)}function Sn(e){return Me(e)&&e.isMobxAction===!0}function zt(e,t){var r,n,i,s,o;t===void 0&&(t=Ca),Me(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(D)},t.onError,t.requiresObservable);else{var y=Jl(t),g=!1;c=new ai(a,function(){g||(g=!0,y(function(){g=!1,c.isDisposed_||c.track(D)}))},t.onError,t.requiresObservable)}function D(){e(c)}return(i=t)!=null&&(s=i.signal)!=null&&s.aborted||c.schedule_(),c.getDisposer_((o=t)==null?void 0:o.signal)}var Wb=function(t){return t()};function Jl(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Wb}function Jb(e,t,r){var n,i,s,o;r===void 0&&(r=Ca),(!Me(e)||!Me(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?Xb(r.onError,t):t),c=!r.scheduler&&!r.delay,y=Jl(r),g=!0,D=!1,R,j,te=r.compareStructural?nt.structural:r.equals||nt.default,W=new ai(a,function(){g||c?B():D||(D=!0,y(B))},r.onError,r.requiresObservable);function B(){if(D=!1,!W.isDisposed_){var z=!1;W.track(function(){var Y=Eb(!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 Xb(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var Yb="onBO",Qb="onBUO";function Xl(e,t,r){return Yl(Yb,e,t,r)}function Oi(e,t,r){return Yl(Qb,e,t,r)}function Yl(e,t,r,n){var i=typeof n=="function"?qt(t,r):qt(t),s=Me(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 Zb="never",yo="always",ev="observed";function tv(e){e.isolateGlobalState===!0&&Rb();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(H.useProxies=t===yo?!0:t===Zb?!1:typeof Proxy<"u"),t==="ifavailable"&&(H.verifyProxies=!0),r!==void 0){var n=r===yo?yo:r===ev;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&&Fb(e.reactionScheduler)}function rv(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=$g(t);return Qr(function(){var s=$n(e,n)[be];Fo(i).forEach(function(o){s.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function Ai(e,t){return Ql(qt(e,t))}function Ql(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=iv(e.observing_).map(Ql)),t}function nv(e,t){return Zl(qt(e,t))}function Zl(e){var t={name:e.name_};return Bb(e)&&(t.observers=Array.from(kb(e)).map(Zl)),t}function iv(e){return Array.from(new Set(e))}var ov=0;function ed(){this.message="FLOW_CANCELLED"}ed.prototype=Object.create(Error.prototype);var ea=Il("flow"),sv=Il("flow.bound",{bound:!0}),wn=Object.assign(function(t,r){if(vi(r))return ea.decorate_20223_(t,r);if(Vr(r))return En(t,r,ea);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=++ov,y=At(i+" - runid: "+c+" - init",n).apply(a,f),g,D=void 0,R=new Promise(function(j,te){var W=0;g=te;function B(ie){D=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){D=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(Me(ie?.then)){ie.then(Y,te);return}return ie.done?j(ie.value):(D=Promise.resolve(ie.value),D.then(B,z))}B(void 0)});return R.cancel=At(i+" - runid: "+c+" - cancel",function(){try{D&&Sf(D);var j=y.return(void 0),te=Promise.resolve(j.value);te.then(bn,bn),Sf(te),g(new ed)}catch(W){g(W)}}),R};return s.isMobXFlow=!0,s},ea);wn.bound=Kt(sv);function Sf(e){Me(e.cancel)&&e.cancel()}function ci(e){return e?.isMobXFlow===!0}function av(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]||Ua(e)||So(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"),av(e)}function uv(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(xb(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 uv(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 td(){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=cv(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 cv(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 fv={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 lv(e,t){var r,n;return gl(),e=$n(e,t),(n=(r=e[be]).proxy_)!=null?n:r.proxy_=new Proxy(e,fv)}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),Pa(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),Pa(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=Bg(e)),Fo(t).forEach(function(s){return i.make_(s,t[s])})}),e}var xf="splice",Rt="update",dv=1e4,pv={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(xo,r)?xo[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&&ld(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=Oo),_t(this)){var f=wt(this,{object:this.proxy_,type:xf,index:n,removedCount:i,added:s});if(!f)return Oo;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<dv){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:xf,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 yv(e,t,r,n){return r===void 0&&(r="ObservableArray@"+St()),n===void 0&&(n=!1),gl(),Qr(function(){var i=new Ma(r,t,n,!1);vl(i.values_,be,i);var s=new Proxy(i.values_,pv);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var xo={clear:function(){return this.splice(0)},replace:function(t){var r=this[be];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];var o=this[be];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[be].spliceWithArray_(t,r,n)},push:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[be].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return H.trackingDerivation&&fe(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){H.trackingDerivation&&fe(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[be],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Ce("at",pt);Ce("concat",pt);Ce("flat",pt);Ce("includes",pt);Ce("indexOf",pt);Ce("join",pt);Ce("lastIndexOf",pt);Ce("slice",pt);Ce("toString",pt);Ce("toLocaleString",pt);Ce("toSorted",pt);Ce("toSpliced",pt);Ce("with",pt);Ce("every",Dt);Ce("filter",Dt);Ce("find",Dt);Ce("findIndex",Dt);Ce("findLast",Dt);Ce("findLastIndex",Dt);Ce("flatMap",Dt);Ce("forEach",Dt);Ce("map",Dt);Ce("some",Dt);Ce("toReversed",Dt);Ce("reduce",rd);Ce("reduceRight",rd);function Ce(e,t){typeof Array.prototype[e]=="function"&&(xo[e]=t(e))}function pt(e){return function(){var t=this[be];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Dt(e){return function(t,r){var n=this,i=this[be];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,a){return t.call(r,o,a,n)})}}function rd(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 hv=Ar("ObservableArrayAdministration",Ma);function Nn(e){return jo(e)&&hv(e[be])}var nd,id,mv={},_r="add",No="delete";nd=Symbol.iterator;id=Symbol.toStringTag;var od=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]=mv,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,Me(Map)||fe(18),Qr(function(){s.keysAtom_=Ol(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),Ko,this.name_+"."+aa(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:No,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:No,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_+"."+aa(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[nd]=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)?Ng(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=gv(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 D=i.data_.get(y);o.set(y,D)}}}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)},Ra(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:id,get:function(){return"Map"}}]),e}(),Wt=Ar("ObservableMap",od);function gv(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 sd,ad,bv={};sd=Symbol.iterator;ad=Symbol.toStringTag;var ud=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]=bv,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,Me(Set)||fe(22),this.enhancer_=function(o,a){return n(o,a,i)},Qr(function(){s.atom_=Ol(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:No,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:No,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[sd]=function(){return this.values()},Ra(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:ad,get:function(){return"Set"}}]),e}(),Yr=Ar("ObservableSet",ud),Nf=Object.create(null),$f="remove",ma=function(){function e(r,n,i,s){n===void 0&&(n=new Map),s===void 0&&(s=sb),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_),dd(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_,Ko,this.name_+"."+aa(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Rf(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=To(o,n);if(a){var f=i.make_(this,n,a,o);if(f===0)return;if(f===1)break}o=Object.getPrototypeOf(o)}Pf(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);Rf(this,s,n);var a=s.extend_(this,n,i,o);return a&&Pf(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=Cf(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=Cf(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:$f});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 D;g=(D=To(this.target_,n))==null?void 0:D.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_),Fl(y)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(a=o.get(n))==null||a.set(n in this.target_),f||c){var R={type:$f,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(),Fo(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 La(e)instanceof ma||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 ma(e,new Map,String(n),gb(t));return Lo(e,be,i),e}var vv=Ar("ObservableObjectAdministration",ma);function Cf(e){return Nf[e]||(Nf[e]={get:function(){return this[be].getObservablePropValue_(e)},set:function(r){return this[be].setObservablePropValue_(e,r)}})}function Hr(e){return jo(e)?vv(e[be]):!1}function Pf(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[rt])==null||delete n[r]}function Rf(e,t,r){if(dd(t)||fe("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!Ao(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 _v=fd(0),wv=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),ta=0,cd=function(){};function Tv(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Tv(cd,Array.prototype);var ja=function(e,t,r){Tl(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),vl(go(c),be,y),s&&s.length&&c.spliceWithArray(0,0,s),wv&&Object.defineProperty(go(c),"0",_v)}),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}}})},Ra(n,[{key:"length",get:function(){return this[be].getArrayLength_()},set:function(o){this[be].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(cd,Symbol.toStringTag,Symbol.iterator);Object.entries(xo).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Lo(ja.prototype,t,r)});function fd(e){return{enumerable:!1,configurable:!0,get:function(){return this[be].get_(e)},set:function(r){this[be].set_(e,r)}}}function Ov(e){Vt(ja.prototype,""+e,fd(e))}function ld(e){if(e>ta){for(var t=ta;t<e+100;t++)Ov(t);ta=e}}ld(1e3);function Av(e,t,r){return new ja(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(Ua(e)||Ti(e)||So(e))return e}else if(Me(e)&&So(e[be]))return e[be];fe(28)}function La(e,t){if(e||fe(29),t!==void 0)return La(qt(e,t));if(Ua(e)||Ti(e)||So(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=La(e):r=qt(e)}return r.name_}function Qr(e){var t=Xr(),r=qo(!0);Tt();try{return e()}finally{Ot(),Go(r),tr(t)}}var Uf=gi.toString;function Fa(e,t,r){return r===void 0&&(r=-1),ga(e,t,r)}function ga(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=Uf.call(e);if(o!==Uf.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=Bf(e),t=Bf(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&&!(Me(f)&&f instanceof f&&Me(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(!ga(e[y],t[y],r-1,n,i))return!1}else{var g=Object.keys(e),D;if(y=g.length,Object.keys(t).length!==y)return!1;for(;y--;)if(D=g[y],!(It(t,D)&&ga(e[D],t[D],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function Bf(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]=Iv,e}function Iv(){return this}function dd(e){return e instanceof Object&&typeof e.annotationType_=="string"&&Me(e.make_)&&Me(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=$a();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:ql,extras:{getDebugName:fi},$mobx:be});var pd=Mt(bg(),1),DS=pd.default.configure,Wr=pd.default,ra=100,{WARN:Ev,LOG:MS,DEBUG:vr,VERBOSE:tt,ERROR:jS}=Se.setup(Se.INFO);tv({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Sv=()=>window.disableSpy=ql(e=>{tt("[mobx]",e)});typeof window=="object"&&(window.getDependencyTree=Ai,window.getObserverTree=nv,window.getAtom=qt,window.getDebugName=fi,window.enableSpy=Sv);var Qe=({caller:e,thread:t,pattern:r,args:n})=>(n=n||r,`${Be(()=>t?.name?t.name+" | ":"")}${e??"caller?"}${n?`{${typeof n=="string"?n:Wr(n)}}`:""}`);function xv(e,t){return Be(()=>nt.structural(e.get(),t.get()))}function Si(e,t){return nt.shallow(e.applogs,t.applogs)}function Va(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 Nv=0;function er(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++Nv}{${t}}`;tt(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,s=$v(e,a=>i=ke.array(a,{deep:!1,name:t,equals:r}),a=>{Be(()=>(r??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 $v(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(),Hb(()=>{r(s)})});function a(){o.track(()=>{let c=ra&&performance.now();vr(`[${i}] runAndTrack:`,{name:n??e.name,fn:e}),s=e(),vr(`[${i}] runAndTrack =>`,s),ra&&performance.now()-c>ra&&Ev(`[${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&&!Nb())return!n&&Ub().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,D=Ge(()=>(tt(`[${y}] update->rerun`,Be(()=>({args:a})),t),tt.isDisabled||td(),g=t.apply(this,a)),{...s,name:y});if(tt(`[${y}] deps`,Ai(D),{untrackedArgs:c}),o.set(c,D),!s.keepAlive){let R=Oi(D,()=>{tt(`[${y}] dispose`,D),R(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return D.get()}}function Cv(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?r+=s+`
55
+ `+" ".repeat(++t):s===")"?r+=`
56
+ `+" ".repeat(--t)+s:s===","&&n===0?r+=s+`
57
+ `+" ".repeat(t):s==="{"&&n===0?(n++,r+=s+`
58
+ `+" ".repeat(t+1)):s==="}"&&n===1?(n--,r+=`
59
+ `+" ".repeat(t)+s):s==="{"&&n>0?(n++,r+=s):(s==="}"&&n>1&&n--,r+=s)}return r}var{WARN:kf,LOG:LS,DEBUG:Pv,VERBOSE:FS,ERROR:br}=Se.setup(Se.INFO,{prefix:"[thread]"});function nr(e){return e.init!==void 0}var Ka=class{constructor(e,t,r,n=[]){this.name=e,this._applogs=n,this.parents=t===null?null:_f(t),this.filters=r,Be(()=>this.parents?.length===0)&&kf("[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):kf("unsubscribe called for non-existent",e)}notifySubscribers(e){Pv(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map||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 Cv(this.name)}};function ba(e){"@babel/helpers - typeof";return ba=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},ba(e)}function yd(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Df(e){yd(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||ba(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 Rv(e,t){yd(2,arguments);var r=Df(e),n=Df(t);return r.getTime()<n.getTime()}var Uv=typeof global=="object"&&global&&global.Object===Object&&global,hd=Uv,Bv=typeof self=="object"&&self&&self.Object===Object&&self,kv=hd||Bv||Function("return this")(),ir=kv,Dv=ir.Symbol,Gt=Dv,md=Object.prototype,Mv=md.hasOwnProperty,jv=md.toString,ni=Gt?Gt.toStringTag:void 0;function Lv(e){var t=Mv.call(e,ni),r=e[ni];try{e[ni]=void 0;var n=!0}catch{}var i=jv.call(e);return n&&(t?e[ni]=r:delete e[ni]),i}var Fv=Lv,Vv=Object.prototype,Kv=Vv.toString;function zv(e){return Kv.call(e)}var qv=zv,Gv="[object Null]",Hv="[object Undefined]",Mf=Gt?Gt.toStringTag:void 0;function Wv(e){return e==null?e===void 0?Hv:Gv:Mf&&Mf in Object(e)?Fv(e):qv(e)}var Cn=Wv;function Jv(e){return e!=null&&typeof e=="object"}var On=Jv,Xv="[object Symbol]";function Yv(e){return typeof e=="symbol"||On(e)&&Cn(e)==Xv}var di=Yv;function Qv(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Zv=Qv,e_=Array.isArray,Ht=e_,t_=1/0,jf=Gt?Gt.prototype:void 0,Lf=jf?jf.toString:void 0;function gd(e){if(typeof e=="string")return e;if(Ht(e))return Zv(e,gd)+"";if(di(e))return Lf?Lf.call(e):"";var t=e+"";return t=="0"&&1/e==-t_?"-0":t}var r_=gd;function n_(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pi=n_;function i_(e){return e}var bd=i_,o_="[object AsyncFunction]",s_="[object Function]",a_="[object GeneratorFunction]",u_="[object Proxy]";function c_(e){if(!pi(e))return!1;var t=Cn(e);return t==s_||t==a_||t==o_||t==u_}var vd=c_,f_=ir["__core-js_shared__"],na=f_,Ff=function(){var e=/[^.]+$/.exec(na&&na.keys&&na.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function l_(e){return!!Ff&&Ff in e}var d_=l_,p_=Function.prototype,y_=p_.toString;function h_(e){if(e!=null){try{return y_.call(e)}catch{}try{return e+""}catch{}}return""}var Zr=h_,m_=/[\\^$.*+?()[\]{}|]/g,g_=/^\[object .+?Constructor\]$/,b_=Function.prototype,v_=Object.prototype,__=b_.toString,w_=v_.hasOwnProperty,T_=RegExp("^"+__.call(w_).replace(m_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function O_(e){if(!pi(e)||d_(e))return!1;var t=vd(e)?T_:g_;return t.test(Zr(e))}var A_=O_;function I_(e,t){return e?.[t]}var E_=I_;function S_(e,t){var r=E_(e,t);return A_(r)?r:void 0}var en=S_,x_=en(ir,"WeakMap"),va=x_;function N_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var $_=N_,C_=800,P_=16,R_=Date.now;function U_(e){var t=0,r=0;return function(){var n=R_(),i=P_-(n-r);if(r=n,i>0){if(++t>=C_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var B_=U_;function k_(e){return function(){return e}}var D_=k_,M_=function(){try{var e=en(Object,"defineProperty");return e({},"",{}),e}catch{}}(),$o=M_,j_=$o?function(e,t){return $o(e,"toString",{configurable:!0,enumerable:!1,value:D_(t),writable:!0})}:bd,L_=j_,F_=B_(L_),V_=F_,K_=9007199254740991,z_=/^(?:0|[1-9]\d*)$/;function q_(e,t){var r=typeof e;return t=t??K_,!!t&&(r=="number"||r!="symbol"&&z_.test(e))&&e>-1&&e%1==0&&e<t}var za=q_;function G_(e,t,r){t=="__proto__"&&$o?$o(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var H_=G_;function W_(e,t){return e===t||e!==e&&t!==t}var qa=W_,J_=Object.prototype,X_=J_.hasOwnProperty;function Y_(e,t,r){var n=e[t];(!(X_.call(e,t)&&qa(n,r))||r===void 0&&!(t in e))&&H_(e,t,r)}var Q_=Y_,Vf=Math.max;function Z_(e,t,r){return t=Vf(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Vf(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(o),$_(e,this,a)}}var ew=Z_,tw=9007199254740991;function rw(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tw}var Ga=rw;function nw(e){return e!=null&&Ga(e.length)&&!vd(e)}var iw=nw,ow=Object.prototype;function sw(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ow;return e===r}var aw=sw;function uw(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var cw=uw,fw="[object Arguments]";function lw(e){return On(e)&&Cn(e)==fw}var Kf=lw,_d=Object.prototype,dw=_d.hasOwnProperty,pw=_d.propertyIsEnumerable,yw=Kf(function(){return arguments}())?Kf:function(e){return On(e)&&dw.call(e,"callee")&&!pw.call(e,"callee")},Ha=yw;function hw(){return!1}var mw=hw,wd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zf=wd&&typeof module=="object"&&module&&!module.nodeType&&module,gw=zf&&zf.exports===wd,qf=gw?ir.Buffer:void 0,bw=qf?qf.isBuffer:void 0,vw=bw||mw,_a=vw,_w="[object Arguments]",ww="[object Array]",Tw="[object Boolean]",Ow="[object Date]",Aw="[object Error]",Iw="[object Function]",Ew="[object Map]",Sw="[object Number]",xw="[object Object]",Nw="[object RegExp]",$w="[object Set]",Cw="[object String]",Pw="[object WeakMap]",Rw="[object ArrayBuffer]",Uw="[object DataView]",Bw="[object Float32Array]",kw="[object Float64Array]",Dw="[object Int8Array]",Mw="[object Int16Array]",jw="[object Int32Array]",Lw="[object Uint8Array]",Fw="[object Uint8ClampedArray]",Vw="[object Uint16Array]",Kw="[object Uint32Array]",Re={};Re[Bw]=Re[kw]=Re[Dw]=Re[Mw]=Re[jw]=Re[Lw]=Re[Fw]=Re[Vw]=Re[Kw]=!0;Re[_w]=Re[ww]=Re[Rw]=Re[Tw]=Re[Uw]=Re[Ow]=Re[Aw]=Re[Iw]=Re[Ew]=Re[Sw]=Re[xw]=Re[Nw]=Re[$w]=Re[Cw]=Re[Pw]=!1;function zw(e){return On(e)&&Ga(e.length)&&!!Re[Cn(e)]}var qw=zw;function Gw(e){return function(t){return e(t)}}var Hw=Gw,Td=typeof exports=="object"&&exports&&!exports.nodeType&&exports,si=Td&&typeof module=="object"&&module&&!module.nodeType&&module,Ww=si&&si.exports===Td,ia=Ww&&hd.process,Jw=function(){try{var e=si&&si.require&&si.require("util").types;return e||ia&&ia.binding&&ia.binding("util")}catch{}}(),Gf=Jw,Hf=Gf&&Gf.isTypedArray,Xw=Hf?Hw(Hf):qw,Od=Xw,Yw=Object.prototype,Qw=Yw.hasOwnProperty;function Zw(e,t){var r=Ht(e),n=!r&&Ha(e),i=!r&&!n&&_a(e),s=!r&&!n&&!i&&Od(e),o=r||n||i||s,a=o?cw(e.length,String):[],f=a.length;for(var c in e)(t||Qw.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||za(c,f)))&&a.push(c);return a}var e0=Zw;function t0(e,t){return function(r){return e(t(r))}}var r0=t0,n0=r0(Object.keys,Object),i0=n0,o0=Object.prototype,s0=o0.hasOwnProperty;function a0(e){if(!aw(e))return i0(e);var t=[];for(var r in Object(e))s0.call(e,r)&&r!="constructor"&&t.push(r);return t}var u0=a0;function c0(e){return iw(e)?e0(e):u0(e)}var Ad=c0,f0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l0=/^\w*$/;function d0(e,t){if(Ht(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||di(e)?!0:l0.test(e)||!f0.test(e)||t!=null&&e in Object(t)}var Wa=d0,p0=en(Object,"create"),yi=p0;function y0(){this.__data__=yi?yi(null):{},this.size=0}var h0=y0;function m0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var g0=m0,b0="__lodash_hash_undefined__",v0=Object.prototype,_0=v0.hasOwnProperty;function w0(e){var t=this.__data__;if(yi){var r=t[e];return r===b0?void 0:r}return _0.call(t,e)?t[e]:void 0}var T0=w0,O0=Object.prototype,A0=O0.hasOwnProperty;function I0(e){var t=this.__data__;return yi?t[e]!==void 0:A0.call(t,e)}var E0=I0,S0="__lodash_hash_undefined__";function x0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yi&&t===void 0?S0:t,this}var N0=x0;function Pn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Pn.prototype.clear=h0;Pn.prototype.delete=g0;Pn.prototype.get=T0;Pn.prototype.has=E0;Pn.prototype.set=N0;var Wf=Pn;function $0(){this.__data__=[],this.size=0}var C0=$0;function P0(e,t){for(var r=e.length;r--;)if(qa(e[r][0],t))return r;return-1}var Ho=P0,R0=Array.prototype,U0=R0.splice;function B0(e){var t=this.__data__,r=Ho(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():U0.call(t,r,1),--this.size,!0}var k0=B0;function D0(e){var t=this.__data__,r=Ho(t,e);return r<0?void 0:t[r][1]}var M0=D0;function j0(e){return Ho(this.__data__,e)>-1}var L0=j0;function F0(e,t){var r=this.__data__,n=Ho(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var V0=F0;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=C0;Rn.prototype.delete=k0;Rn.prototype.get=M0;Rn.prototype.has=L0;Rn.prototype.set=V0;var Wo=Rn,K0=en(ir,"Map"),hi=K0;function z0(){this.size=0,this.__data__={hash:new Wf,map:new(hi||Wo),string:new Wf}}var q0=z0;function G0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var H0=G0;function W0(e,t){var r=e.__data__;return H0(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Jo=W0;function J0(e){var t=Jo(this,e).delete(e);return this.size-=t?1:0,t}var X0=J0;function Y0(e){return Jo(this,e).get(e)}var Q0=Y0;function Z0(e){return Jo(this,e).has(e)}var eT=Z0;function tT(e,t){var r=Jo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var rT=tT;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=q0;Un.prototype.delete=X0;Un.prototype.get=Q0;Un.prototype.has=eT;Un.prototype.set=rT;var Xo=Un,nT="Expected a function";function Ja(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(nT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Ja.Cache||Xo),r}Ja.Cache=Xo;var iT=Ja,oT=500;function sT(e){var t=iT(e,function(n){return r.size===oT&&r.clear(),n}),r=t.cache;return t}var aT=sT,uT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cT=/\\(\\)?/g,fT=aT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(uT,function(r,n,i,s){t.push(i?s.replace(cT,"$1"):n||r)}),t}),lT=fT;function dT(e){return e==null?"":r_(e)}var pT=dT;function yT(e,t){return Ht(e)?e:Wa(e,t)?[e]:lT(pT(e))}var Yo=yT,hT=1/0;function mT(e){if(typeof e=="string"||di(e))return e;var t=e+"";return t=="0"&&1/e==-hT?"-0":t}var xi=mT;function gT(e,t){t=Yo(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 Xa=gT;function bT(e,t,r){var n=e==null?void 0:Xa(e,t);return n===void 0?r:n}var vT=bT;function _T(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Id=_T,Jf=Gt?Gt.isConcatSpreadable:void 0;function wT(e){return Ht(e)||Ha(e)||!!(Jf&&e&&e[Jf])}var TT=wT;function Ed(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=TT),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?Ed(a,t-1,r,n,i):Id(i,a):n||(i[i.length]=a)}return i}var OT=Ed;function AT(e){var t=e==null?0:e.length;return t?OT(e,1):[]}var IT=AT;function ET(e){return V_(ew(e,void 0,IT),e+"")}var ST=ET;function xT(){this.__data__=new Wo,this.size=0}var NT=xT;function $T(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var CT=$T;function PT(e){return this.__data__.get(e)}var RT=PT;function UT(e){return this.__data__.has(e)}var BT=UT,kT=200;function DT(e,t){var r=this.__data__;if(r instanceof Wo){var n=r.__data__;if(!hi||n.length<kT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Xo(n)}return r.set(e,t),this.size=r.size,this}var MT=DT;function Bn(e){var t=this.__data__=new Wo(e);this.size=t.size}Bn.prototype.clear=NT;Bn.prototype.delete=CT;Bn.prototype.get=RT;Bn.prototype.has=BT;Bn.prototype.set=MT;var wo=Bn;function jT(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var LT=jT;function FT(){return[]}var VT=FT,KT=Object.prototype,zT=KT.propertyIsEnumerable,Xf=Object.getOwnPropertySymbols,qT=Xf?function(e){return e==null?[]:(e=Object(e),LT(Xf(e),function(t){return zT.call(e,t)}))}:VT,GT=qT;function HT(e,t,r){var n=t(e);return Ht(e)?n:Id(n,r(e))}var WT=HT;function JT(e){return WT(e,Ad,GT)}var Yf=JT,XT=en(ir,"DataView"),wa=XT,YT=en(ir,"Promise"),Ta=YT,QT=en(ir,"Set"),Oa=QT,Qf="[object Map]",ZT="[object Object]",Zf="[object Promise]",el="[object Set]",tl="[object WeakMap]",rl="[object DataView]",eO=Zr(wa),tO=Zr(hi),rO=Zr(Ta),nO=Zr(Oa),iO=Zr(va),Fr=Cn;(wa&&Fr(new wa(new ArrayBuffer(1)))!=rl||hi&&Fr(new hi)!=Qf||Ta&&Fr(Ta.resolve())!=Zf||Oa&&Fr(new Oa)!=el||va&&Fr(new va)!=tl)&&(Fr=function(e){var t=Cn(e),r=t==ZT?e.constructor:void 0,n=r?Zr(r):"";if(n)switch(n){case eO:return rl;case tO:return Qf;case rO:return Zf;case nO:return el;case iO:return tl}return t});var nl=Fr,oO=ir.Uint8Array,il=oO,sO="__lodash_hash_undefined__";function aO(e){return this.__data__.set(e,sO),this}var uO=aO;function cO(e){return this.__data__.has(e)}var fO=cO;function Co(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Xo;++t<r;)this.add(e[t])}Co.prototype.add=Co.prototype.push=uO;Co.prototype.has=fO;var lO=Co;function dO(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var pO=dO;function yO(e,t){return e.has(t)}var hO=yO,mO=1,gO=2;function bO(e,t,r,n,i,s){var o=r&mO,a=e.length,f=t.length;if(a!=f&&!(o&&f>a))return!1;var c=s.get(e),y=s.get(t);if(c&&y)return c==t&&y==e;var g=-1,D=!0,R=r&gO?new lO:void 0;for(s.set(e,t),s.set(t,e);++g<a;){var j=e[g],te=t[g];if(n)var W=o?n(te,j,g,t,e,s):n(j,te,g,e,t,s);if(W!==void 0){if(W)continue;D=!1;break}if(R){if(!pO(t,function(B,z){if(!hO(R,z)&&(j===B||i(j,B,r,n,s)))return R.push(z)})){D=!1;break}}else if(!(j===te||i(j,te,r,n,s))){D=!1;break}}return s.delete(e),s.delete(t),D}var Sd=bO;function vO(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var _O=vO;function wO(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var TO=wO,OO=1,AO=2,IO="[object Boolean]",EO="[object Date]",SO="[object Error]",xO="[object Map]",NO="[object Number]",$O="[object RegExp]",CO="[object Set]",PO="[object String]",RO="[object Symbol]",UO="[object ArrayBuffer]",BO="[object DataView]",ol=Gt?Gt.prototype:void 0,oa=ol?ol.valueOf:void 0;function kO(e,t,r,n,i,s,o){switch(r){case BO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case UO:return!(e.byteLength!=t.byteLength||!s(new il(e),new il(t)));case IO:case EO:case NO:return qa(+e,+t);case SO:return e.name==t.name&&e.message==t.message;case $O:case PO:return e==t+"";case xO:var a=_O;case CO:var f=n&OO;if(a||(a=TO),e.size!=t.size&&!f)return!1;var c=o.get(e);if(c)return c==t;n|=AO,o.set(e,t);var y=Sd(a(e),a(t),n,i,s,o);return o.delete(e),y;case RO:if(oa)return oa.call(e)==oa.call(t)}return!1}var DO=kO,MO=1,jO=Object.prototype,LO=jO.hasOwnProperty;function FO(e,t,r,n,i,s){var o=r&MO,a=Yf(e),f=a.length,c=Yf(t),y=c.length;if(f!=y&&!o)return!1;for(var g=f;g--;){var D=a[g];if(!(o?D in t:LO.call(t,D)))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;){D=a[g];var B=e[D],z=t[D];if(n)var Y=o?n(z,B,D,t,e,s):n(B,z,D,e,t,s);if(!(Y===void 0?B===z||i(B,z,r,n,s):Y)){te=!1;break}W||(W=D=="constructor")}if(te&&!W){var ie=e.constructor,F=t.constructor;ie!=F&&"constructor"in e&&"constructor"in t&&!(typeof ie=="function"&&ie instanceof ie&&typeof F=="function"&&F instanceof F)&&(te=!1)}return s.delete(e),s.delete(t),te}var VO=FO,KO=1,sl="[object Arguments]",al="[object Array]",mo="[object Object]",zO=Object.prototype,ul=zO.hasOwnProperty;function qO(e,t,r,n,i,s){var o=Ht(e),a=Ht(t),f=o?al:nl(e),c=a?al:nl(t);f=f==sl?mo:f,c=c==sl?mo:c;var y=f==mo,g=c==mo,D=f==c;if(D&&_a(e)){if(!_a(t))return!1;o=!0,y=!1}if(D&&!y)return s||(s=new wo),o||Od(e)?Sd(e,t,r,n,i,s):DO(e,t,f,r,n,i,s);if(!(r&KO)){var R=y&&ul.call(e,"__wrapped__"),j=g&&ul.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 D?(s||(s=new wo),VO(e,t,r,n,i,s)):!1}var GO=qO;function xd(e,t,r,n,i){return e===t?!0:e==null||t==null||!On(e)&&!On(t)?e!==e&&t!==t:GO(e,t,r,n,xd,i)}var Nd=xd,HO=1,WO=2;function JO(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var f=a[0],c=e[f],y=a[1];if(o&&a[2]){if(c===void 0&&!(f in e))return!1}else{var g=new wo;if(n)var D=n(c,y,f,e,t,g);if(!(D===void 0?Nd(y,c,HO|WO,n,g):D))return!1}}return!0}var XO=JO;function YO(e){return e===e&&!pi(e)}var $d=YO;function QO(e){for(var t=Ad(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,$d(i)]}return t}var ZO=QO;function eA(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Cd=eA;function tA(e){var t=ZO(e);return t.length==1&&t[0][2]?Cd(t[0][0],t[0][1]):function(r){return r===e||XO(r,e,t)}}var rA=tA;function nA(e,t){return e!=null&&t in Object(e)}var iA=nA;function oA(e,t,r){t=Yo(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&&Ga(i)&&za(o,i)&&(Ht(e)||Ha(e)))}var sA=oA;function aA(e,t){return e!=null&&sA(e,t,iA)}var Pd=aA,uA=1,cA=2;function fA(e,t){return Wa(e)&&$d(t)?Cd(xi(e),t):function(r){var n=vT(r,e);return n===void 0&&n===t?Pd(r,e):Nd(t,n,uA|cA)}}var lA=fA;function dA(e){return function(t){return t?.[e]}}var pA=dA;function yA(e){return function(t){return Xa(t,e)}}var hA=yA;function mA(e){return Wa(e)?pA(xi(e)):hA(e)}var gA=mA;function bA(e){return typeof e=="function"?e:e==null?bd:typeof e=="object"?Ht(e)?lA(e[0],e[1]):rA(e):gA(e)}var vA=bA;function _A(e,t,r,n){if(!pi(e))return e;t=Yo(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:za(t[i+1])?[]:{})}Q_(a,f,c),a=a[f]}return e}var wA=_A;function TA(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Xa(e,o);r(a,o)&&wA(s,Yo(o,e),a)}return s}var OA=TA;function AA(e,t){return OA(e,t,function(r,n){return Pd(e,n)})}var IA=AA,EA=ST(function(e,t){return e==null?{}:IA(e,t)}),cl=EA,SA=4294967295,xA=SA-1,NA=Math.floor,$A=Math.min;function CA(e,t,r,n){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=r(t);for(var o=t!==t,a=t===null,f=di(t),c=t===void 0;i<s;){var y=NA((i+s)/2),g=r(e[y]),D=g!==void 0,R=g===null,j=g===g,te=di(g);if(o)var W=n||j;else c?W=j&&(n||D):a?W=j&&D&&(n||!R):f?W=j&&D&&!R&&(n||!te):R||te?W=!1:W=n?g<=t:g<t;W?i=y+1:s=y}return $A(s,xA)}var PA=CA;function RA(e,t,r){return PA(e,t,vA(r,2))}var UA=RA,{WARN:VS,LOG:KS,DEBUG:zS,VERBOSE:fl,ERROR:BA}=Se.setup(Se.INFO),Rd=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Ud=(e,t,r="asc")=>Rd(e.ts,t.ts,r);function Jr(e,t="asc"){return e.sort((r,n)=>Ud(r,n,t))}var Bd=(e,t)=>Rv(new Date(e.ts),new Date(t.ts));var kd=(e,t,r)=>nt.structural(cl(e,r),cl(t,r)),Ya=e=>{let t=new Map;for(let r of e){if(!r)throw BA("falsy entry in applogs",e),new Error("falsy entry in applogs");let n=Wr(r);t.set(n,r)}return Array.from(t.values())};function Dd(e){return typeof e=="string"&&e.startsWith("?")}function Md(e){return e.slice(1)}function Qa(e,t){let r={};return[Object.entries(e).reduce((i,[s,o])=>{if(Dd(o)){let a=Md(o),f=t[a];f?i[s]=f:r[s]=a}else i[s]=o;return i},{}),r]}function jd(e,t,r){fl("[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 fl("[matchPartStatic] =>",e.startsWith("!")?"!":"",n),e.startsWith("!")?!n:n}var Ld=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},ll=function(t){return Ld(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:Ld,mean:ll,average:ll,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 Fd(){return new Date().toISOString()}var{WARN:dl,LOG:qS,DEBUG:pl,VERBOSE:Lr,ERROR:kA}=Se.setup(Se.INFO),Qo=class extends Ka{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||dl("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(){pl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&dl(`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(UA(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))pl("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:GS,LOG:HS,DEBUG:WS,VERBOSE:sa,ERROR:DA}=Se.setup(Se.INFO),Tr=it("rollingFilter",function(t,r,n={}){let i=Kd(r),s=Aa(i),o=ke.array(Be(()=>s(t.applogs)),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${Wr(i)}}`}`}),a=g=>{let D;return nr(g)?D={init:s(g.init)}:D={added:s(g.added),removed:g.removed},sa(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",D),D},f=new Qo(`${t.name} | ${n.name||`rollingFilter{${Wr(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,a),c=Jb(()=>JSON.parse(JSON.stringify(r)),g=>{sa(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=Aa(i),f.triggerRemap()}),y=Oi(o,()=>{sa(`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})}),Vd=it("rollingMapper",function(t,r,n={}){let i=Be(()=>r.call(null,{init:t.applogs},t));if(!nr(i))throw DA("Initial run must return init event");let s=i.init;return new Qo(`${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})}),MA=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}`:""}}`}),Kd=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 Aa(e){return t=>t.filter(r=>{for(let[n,i]of Object.entries(e)){let s=r[n.startsWith("!")?n.slice(1):n];if(!jd(n,i,s))return!1}return!0})}var{WARN:jA,LOG:JS,DEBUG:LA,VERBOSE:XS,ERROR:Ia}=Se.setup(Se.INFO);function zd(e){return!!e.ts}function qd(e,t){return zd(e)?e:{...e,ts:t}}function Gd(e,t){let{en:r,at:n}=e,i=Tr(t,{en:r,at:n});if(i.size>1)throw Ia("[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(kd(e,s,["en","at","vl","ts","ag"]))throw Ia("[withPvFrom] Same as previous:",{log:e,pv:s,thread:t});e.pv&&!o&&jA("[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}}function Po(e){let t=()=>(Be(()=>e.length<2&&LA(`joinThreads with count=${e.length}`)),Jr(Ya(e.flatMap(i=>{let s=i.applogs;if(!s)throw Ia("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 Qo(Be(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var Ue=Mt(Qt(),1),Hd=Mt(Og(),1),Ro=e=>Ue.Type.Union([e,Ue.Type.Null()]);var Wd=/^(k51qz|baguq)[0-9a-z]{56,57}$/,FA=/^[0-9A-Fa-f]{7,8}$/g;Ue.FormatRegistry.Set("EntityID",e=>!!e.match(FA)||!!e.match(Wd));var Za=Ue.Type.String();Ue.FormatRegistry.Set("CID",e=>!!e.match(Wd));var Uo=Ue.Type.String({format:"CID"}),VA=/^http([s]?):\/\/.*\..*/;Ue.FormatRegistry.Set("URL",e=>!!e.match(VA));var KA=Ue.Type.String({format:"URL"}),Jd=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}),Ea=Hd.TypeCompiler.Compile(Jd);var zA=Ea.Check.bind(Ea),Xd=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=Hd.TypeCompiler.Compile(Xd),Yd=e=>Array.from(Bo.Errors(e)),Sa=Bo.Check.bind(Bo),qA=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?Po([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},Qd=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 Po(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 Po(er(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:YS,LOG:mi,DEBUG:Or,VERBOSE:xe,ERROR:ko}=Se.setup(Se.INFO,{prefix:"[q]"}),GA=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 ko("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Vd(t,function(o,a){let f=nr(o),c,y=[],g=f?null:[];f?(i=new Map,c=o.init):c=o.added;let D;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(D&&(r?D>j.ts:D<j.ts))throw ko("lastWriteWins.mapper logs not sorted:",D,r?">":"<",j.ts,{log:j,i:R,newLogs:c,inverseToOnlyReturnFirstLogs:r});D=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})}),QS=it("withoutDeleted",function(t){if(xe(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw ko("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}),HA=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=WA(t,o,a,i);return xe.isDisabled||zt(()=>xe("query result:",_n(f))),f},{equals:Va,argsDebugName:(e,t,r)=>Qe({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),WA=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]=Qa(n,a?.variables??{});xe("[queryStep.doQuery] patternWithoutVars: ",f);let y=Tr(t,f),g=Zd(c),D=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 qA(Zo.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:",[...D])),i.debug&&mi("[queryStep] step result:",Be(()=>D.map(({variables:R,logsOfThisNode:j})=>({variables:R,thread:j.applogs})))),D}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 Qd(o)},{equals:Va,argsDebugName:(e,t,r)=>Qe({caller:"queryStep",thread:e,pattern:r})}),ZS=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]=Qa(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 Qd(s)},{equals:Va,argsDebugName:(e,t,r)=>Qe({caller:"queryNot",thread:e,pattern:r})}),ex=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(Zd(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})}),tx=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=HA(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})}),rx=it("queryEntity",function(t,r,n,i){Or(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let s=Tr(t,{en:n,at:XA(r,i)});return xe("queryEntity applogs:",s.applogs),Ge(()=>s.isEmpty?null:Object.fromEntries(s.map(({at:o,vl:a})=>[o.slice(r.length+1),a])))},{equals:xv,argsDebugName:(e,t,r)=>Qe({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),nx=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 ko("[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 Xl(r,i),r}),JA=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 ix=it("entityOverlapCount",function(t,r){return Ge(()=>JA(t,r).get().length)});function Zd(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function XA(e,t){return t.map(r=>YA(e,r))}function YA(e,t){return`${e}/${t}`}var{WARN:QA,LOG:ZA,DEBUG:ox,VERBOSE:e1,ERROR:ii}=Se.setup(Se.INFO),ep=class extends Ka{constructor(e,t=[],r){super(e,null,r,t),xn(this,{})}insert(e){let t=Fd(),r=GA(this),n=e.map(i=>{let s=qd(i,t),o=Gd(s,r),a=Qs(o).toString(),f={...o,cid:a};if(!Sa(f))throw ii(`Bogus Applog ${JSON.stringify(f)}`,Yd(f));return Object.freeze(f)});return this.insertRaw(n)}insertRaw(e){let t=Ya(e);if(t.length!==e.length)throw ii(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let r=e.filter(s=>!Sa(s));if(r.length)throw ii(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});let n=e.filter(s=>this.hasApplog(s,!1));if(n.length)throw ii(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(!e.length){QA("[insertRaw] skipping empty insert empty logs array");return}ZA("Inserting:",e.length===1?e[0]:e,{ds:this}),Jr(e);let i=this._applogs.length&&Bd(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}},Zo=class xa extends ep{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,xn(this,{_applogs:ke.shallow})}static empty(t){return xa.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new xa(r??"in-memory",t,[],n)}get readOnly(){return this._readOnly}persist(t){if(e1("[InMem.persist] no persist for",t),this.readOnly)throw ii("[persist] called for readOnly thread")}};var t1=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}}}),r1=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,D=s.length;do{if(y>=D||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}}}),n1=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}}}),iu=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:t1(),decode:r1(),encodingLength:n1()}}}),i1=42;function o1(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Yt.decode(e.subarray(1))}var np={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};np.tags[i1]=o1;var s1=e=>Ws(e,np),tn=Mt(iu(),1),eu={SHA2_256:18,LENGTH:32,DAG_PB:112},a1=40;function es(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 u1(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 c1(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}},f1={toTyped:Ni.CarV1HeaderOrV2Pragma,toRepresentation:$i.CarV1HeaderOrV2Pragma},Jx=Hs(),Xx=Mt(iu(),1),Yx=[new Z(C.map,2),new Z(C.string,"version"),new Z(C.uint,1),new Z(C.string,"roots")],Qx=new Z(C.tag,42);async function ip(e,t){let r=es(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=s1(n);if(f1.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=u1(await e.exactly(a1,!0));e.seek(s.dataOffset-e.pos);let o=await ip(e,1);return Object.assign(o,s)}async function l1(e){let t=await e.exactly(2,!1);if(t[0]===eu.SHA2_256&&t[1]===eu.LENGTH){let o=await e.exactly(34,!0),a=ti(o);return Yt.create(0,eu.DAG_PB,a)}let r=es(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=es(await e.upTo(8),e),i=await e.exactly(c1(await e.upTo(8)),!0),s=ti(i);return Yt.create(r,n,s)}async function op(e){let t=e.pos,r=es(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await l1(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function d1(e){let{cid:t,blockLength:r}=await op(e);return{bytes:await e.exactly(r,!0),cid:t}}async function p1(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await op(e),s={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(s.blockLength),s}function sp(e){let t=(async()=>{let r=await ip(e);if(r.version===2){let n=e.pos-r.dataOffset;e=h1(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await d1(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await p1(e)}}}function ap(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 y1(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 up(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return y1(r)}function h1(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 m1=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 tp(ap(e))}static async fromIterable(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return tp(up(e))}};async function tp(e){let t=sp(e),{version:r,roots:n}=await t.header();return new m1(r,n,t.blocksIndex())}var cp=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}},Zx=class ru extends cp{[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 fp(t);return new ru(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await lp(t);return new ru(r,n,i)}},eN=class nu extends cp{[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 fp(t);return new nu(r,n,i)}static async fromIterable(t){let{version:r,roots:n,iterator:i}=await lp(t);return new nu(r,n,i)}};async function fp(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return dp(ap(e))}async function lp(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return dp(up(e))}async function dp(e){let t=sp(e),{version:r,roots:n}=await t.header();return{version:r,roots:n,iterator:t.blocks()}}var tN=Mt(iu(),1);var rN=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:g1,LOG:nN,DEBUG:tu,VERBOSE:iN,ERROR:rp}=Se.setup(Se.INFO);async function ou(e){let{roots:t,blocks:r}=await pp(e);if(!t||!r)throw rp("decodeCar is funky",{roots:t,blocks:r});t.length!==1&&g1("Unexpected roots count:",t);let n=r.get(t[0]),i;tu("root:",n,{blocks:r}),n.info?(i=r.get(n.applogs.toString()).logs,tu("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 rp("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}}),tu("Decoded car logs:",n,{roots:t,blocks:r,applogs:s}),{applogs:s}}async function pp(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 su(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}()}var{WARN:rs,LOG:kN,DEBUG:Ci,VERBOSE:DN,ERROR:ts}=us.setup(us.DEBUG),b1=114,v1=["https://ipfs.4everland.io/ipfs/CID/?format=car&dag-scope=all","https://cloudflare-ipfs.com/ipfs/CID/?format=car&dag-scope=all"];async function MN(e,{readOnly:t=!0,pinnedCID:r}={}){let n=ht.parse(e);Ci("[retrieveThread] parsedPubID",n);let i;if(n.code!==b1)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 ts("[retrieveThread] neither pubID nor pinnedCID provided");try{i=await _1(e),Ci("Resolved pub to CID",i.toString())}catch(y){throw ts(`Failed to resolve IPNS ${e}:`,y)}}let s=await w1(i),{applogs:o}=await ou(s),a=o.filter(y=>y instanceof Uint8Array);a.length&&rs(`Found ${a.length} encrypted logs - skipping`);let f=o.filter(y=>!(y instanceof Uint8Array));Jr(f);let c=Zo.fromArray(f,`preview${e&&e!==i.toString()?"-"+e:""}@${i.toString()}`,t);return{cid:i,thread:c,encryptedCount:a.length}}async function _1(e){let r=await(await fetch(`https://name.web3.storage/name/${e}`)).json();return r.value.startsWith("/ipfs/")||rs("IPNS value is not '/ipfs/..':",r),ht.parse(r.value.replace("/ipfs/",""))}async function w1(e){Ci("Retrieving:",e);let t;for(let r of v1){let n=r.replaceAll("CID",e.toString()),i=await fetch(n);(!i?.ok||!i?.body)&&(t=ts(`[retrieveCar] unexpected response ${i?.statusText}`,{url:n}),rs("Gateway failed:",n,t)),t=su(i.body.getReader())}if(t instanceof Error)throw t;return(await T1(t)).car}async function T1(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(ts("Failed to read car:",s,{blocks:n,header:r}),n.length===0)throw s;rs(`Returning half-baked car with ${n.length} blocks`)}return{complete:i,car:new Pr(r,n)}}export{MN as a,_1 as b,w1 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-JMXBXW7V.min.js.map